[rhq] Branch 'release-3.0.0-test-build' - 29 commits - modules/core modules/enterprise release.sh
by ips
modules/core/dbutils/pom.xml | 12
modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml | 10
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 110 ++--
modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java | 8
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java | 219 +++++++++
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java | 10
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java | 6
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java | 23 +
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java | 9
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java | 21
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java | 34 +
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java | 3
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java | 42 +
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/jsf-navigation-auto-group/measurement-navigation.xml | 20
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml | 20
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp | 225 +++++-----
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp | 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml | 144 ++----
modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml | 21
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml | 8
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml | 53 +-
modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml | 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml | 3
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml | 21
modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml | 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java | 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java | 5
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java | 34 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java | 19
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java | 181 ++++----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java | 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java | 26 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java | 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java | 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java | 23 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryGenerator.java | 26 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java | 14
modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java | 2
release.sh | 74 +--
44 files changed, 1012 insertions(+), 471 deletions(-)
New commits:
commit 1e10fbe07f2d55aa118baffbaec4e02127983ff5
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jun 29 16:33:27 2010 -0400
Work to perform rhq tag release script in its own branch
diff --git a/release.sh b/release.sh
index 2722eda..c4b9e46 100755
--- a/release.sh
+++ b/release.sh
@@ -286,7 +286,6 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}"
</settings>
EOF
-
# Clone and/or checkout the source from git.
if [ -d "$WORKING_DIR" ]; then
@@ -328,15 +327,42 @@ if [ ! -d "$WORKING_DIR" ]; then
fi
-# If the specified tag already exists remotely and we're in production mode, then abort. If it exists and we're in test mode, then we'll delete it after we've had a successful dry run of release:prepare and are ready to tag.
+# If the specified tag already exists then abort. It should not exist since production runs should have
+# unique tags and test runs should have been done in a temporary branch
EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"`
-if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "production" ]; then
- abort "A remote tag named $RELEASE_TAG already exists - aborting, since we are in production mode..."
+if [ -n "$EXISTING_REMOTE_TAG" ]; then
+ abort "A remote tag named $RELEASE_TAG already exists - aborting, perhaps a bad build configuration..."
fi
-# Run a test build before tagging. This will also publish the snapshot artifacts to the local repo to "bootstrap" the repo.
+# if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to
+# continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents
+# change before it completes.
+if [ "$MODE" = "production" ]; then
+ BUILD_BRANCH="${RELEASE_BRANCH}"
+else
+ BUILD_BRANCH="${RELEASE_BRANCH}-test-build"
+# delete the branch if it exists, so we can recreate it fresh
+ EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"`
+ if [ "$EXISTING_REMOTE_TAG" ]; then
+ echo "Deleting remote branch origin/$BUILD_BRANCH"
+ git branch -D -r "origin/$BUILD_BRANCH"
+ echo "Deleting local branch $BUILD_BRANCH"
+ git branch -D "$BUILD_BRANCH"
+ fi
+ echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH"
+ git checkout -b "$BUILD_BRANCH"
+ echo "Creating remote branch $BUILD_BRANCH"
+ git push origin "$BUILD_BRANCH"
+fi
+
+
+# We should now have the build_branch checked out
+echo "Current Branch is $BUILD_BRANCH"
+
+
+# Run a test build before tagging. This will publish the snapshot artifacts to the local repo to "bootstrap" the repo.
echo "Building project to ensure tests pass and to bootstrap local Maven repo (this will take about 15-30 minutes)..."
# NOTE: There is no need to do a mvn clean below, since we just did either a clone or clean checkout above.
@@ -347,42 +373,26 @@ echo "Test build succeeded!"
# Clean up the snapshot jars produced by the test build from module target dirs.
-
echo "Cleaning up snapshot jars produced by test build from module target dirs..."
mvn clean $MAVEN_ARGS
[ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
-# Do a dry run of tagging the release.
+# If this is a production build perform a dry run of tagging the release. Skip this for test builds to reduce the
+# build time
-echo "Doing a dry run of tagging the release..."
-mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true
-[ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again."
-mvn release:clean $MAVEN_ARGS
-[ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again."
-echo
-echo "Tagging dry run succeeded!"
-
-
-# If there's an existing remote tag, and we didn't abort earlier, we must be in test mode, so we can safely delete it before we call mvn release:prepare to recreate it.
-
-if [ -n "$EXISTING_REMOTE_TAG" ]; then
- echo "A remote tag named $RELEASE_TAG already exists - deleting it, since we are in test mode..."
- git push origin ":refs/tags/$RELEASE_TAG"
- [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)."
-fi
-
-
-# See if the specified tag already exists locally - if so, delete it (even if in production mode).
-EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"`
-if [ -n "$EXISTING_LOCAL_TAG" ]; then
- echo "A local tag named $RELEASE_TAG already exists - deleting it..."
- git tag -d "$RELEASE_TAG"
- [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)."
+if [ "$MODE" = "production" ]; then
+ echo "Doing a dry run of tagging the release..."
+ mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true
+ [ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again."
+ mvn release:clean $MAVEN_ARGS
+ [ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again."
+ echo
+ echo "Tagging dry run succeeded!"
fi
-# If the dry run succeeded, tag it for real.
+# If the dry run was skipped or succeeded, tag it for real.
echo "Tagging the release..."
mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=false -Dusername=$GIT_USERNAME
commit 436507fb74a475f4c1161becf06c5331c7ae9fbf
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jun 29 16:50:31 2010 -0400
LT commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 7b91970..2c8a8a2 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
@@ -1,121 +1,121 @@
-<%@ page language="java" %>
-<%@ page errorPage="/common/Error.jsp" %>
-
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
-
-<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script>
-<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css">
-
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="MINUTES_LABEL" var="CONST_MINUTES" />
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="HOURS_LABEL" var="CONST_HOURS" />
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="DAYS_LABEL" var="CONST_DAYS" />
-
-<!-- BASE SERVER CONFIG TITLE -->
-<tiles:insert definition=".header.tab">
- <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/>
-</tiles:insert>
-<!-- / -->
-
-<!-- BASE SERVER CONFIG CONTENTS -->
-<table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td>
- <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td>
- <td class="BlockContent">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
-<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
- <td class="ErrorField">
- <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
- </td>
- <td class="ErrorField" width="100%">
- <html:select property="agentMaxQuietTimeAllowed">
- <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
- </html:select>
- </td>
-</logic:messagesPresent>
-<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
- <td class="BlockContent">
- <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
- </td>
- <td class="BlockContent" width="100%">
- <html:select property="agentMaxQuietTimeAllowed">
- <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
- </html:select>
- </td>
-</logic:messagesNotPresent>
- </tr>
-<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
- <tr>
- <td class="ErrorField" colspan="2">
- <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span>
- </td>
- </tr>
-</logic:messagesPresent>
-<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
- <tr>
- <td class="BlockContent" colspan="2">
- </td>
- </tr>
-</logic:messagesNotPresent>
- </table>
- </td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4" border="0">
- <tr>
- <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td>
- <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-
-<hq:authorization permission="superuser">
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4" border="0">
- <tr>
- <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td>
- <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-</hq:authorization>
-
-<fmt:message var="productName" key="product.shortName" />
-<c:if test="${productName eq 'RHQ'}">
-<hq:authorization permission="superuser">
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4" border="0">
- <tr>
- <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td>
- <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-</hq:authorization>
-</c:if>
-
-</table>
+<%@ page language="java" %>
+<%@ page errorPage="/common/Error.jsp" %>
+
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
+
+<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script>
+<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css">
+
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="MINUTES_LABEL" var="CONST_MINUTES" />
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="HOURS_LABEL" var="CONST_HOURS" />
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="DAYS_LABEL" var="CONST_DAYS" />
+
+<!-- BASE SERVER CONFIG TITLE -->
+<tiles:insert definition=".header.tab">
+ <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/>
+</tiles:insert>
+<!-- / -->
+
+<!-- BASE SERVER CONFIG CONTENTS -->
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td>
+ <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td>
+ </tr>
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td>
+ <td class="BlockContent">
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
+ <td class="ErrorField">
+ <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
+ </td>
+ <td class="ErrorField" width="100%">
+ <html:select property="agentMaxQuietTimeAllowed">
+ <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
+ </html:select>
+ </td>
+</logic:messagesPresent>
+<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
+ <td class="BlockContent">
+ <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
+ </td>
+ <td class="BlockContent" width="100%">
+ <html:select property="agentMaxQuietTimeAllowed">
+ <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
+ </html:select>
+ </td>
+</logic:messagesNotPresent>
+ </tr>
+<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
+ <tr>
+ <td class="ErrorField" colspan="2">
+ <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span>
+ </td>
+ </tr>
+</logic:messagesPresent>
+<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
+ <tr>
+ <td class="BlockContent" colspan="2">
+ </td>
+ </tr>
+</logic:messagesNotPresent>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+<hq:authorization permission="superuser">
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</hq:authorization>
+
+<fmt:message var="productName" key="product.shortName" />
+<c:if test="${productName eq 'RHQ'}">
+<hq:authorization permission="superuser">
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</hq:authorization>
+</c:if>
+
+</table>
commit db911f971bb286fe600c4257b85f917bb3227004
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 15:33:19 2010 -0400
BZ-607898: fix for sending alert notifications with multiple direct email addresses
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java
index 02183f6..5a958b1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java
@@ -118,9 +118,13 @@ public abstract class AlertSender<T extends ServerPluginComponent> {
* where '|' delimits all elements as well as wraps
* the entire expression.
*/
- @SuppressWarnings("unchecked")
public static <T> List<T> unfence(String fencedData, Class<T> type) {
- String[] elements = fencedData.split("\\|");
+ return unfence(fencedData, type, "\\|");
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> List<T> unfence(String fencedData, Class<T> type, String delimiter) {
+ String[] elements = fencedData.split(delimiter);
List<T> results = new ArrayList<T>(elements.length);
if (Integer.class.equals(type)) {
diff --git a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java
index 773d99a..81b1383 100644
--- a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java
+++ b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java
@@ -40,7 +40,7 @@ public class EmailSender extends AlertSender {
return new SenderResult(ResultState.FAILURE, "No email address given");
}
- List<String> emails = AlertSender.unfence(emailAddressString, String.class);
+ List<String> emails = AlertSender.unfence(emailAddressString, String.class, ",");
return new SenderResult(ResultState.DEFERRED_EMAIL, "Sending to addresses: " + emails, emails);
}
commit 23886a27cb17cf2ab0f707ea37c3a2bba2778b91
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 15:12:56 2010 -0400
only display the "experiemtnal features" toggle for community distributions/builds
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 068b230..7b91970 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
@@ -101,6 +101,8 @@
</tr>
</hq:authorization>
+<fmt:message var="productName" key="product.shortName" />
+<c:if test="${productName eq 'RHQ'}">
<hq:authorization permission="superuser">
<tr>
<td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
@@ -114,5 +116,6 @@
</td>
</tr>
</hq:authorization>
+</c:if>
</table>
commit ec2e38d1704d1eafd6b3349acfe66f10aff322d7
Merge: 1d53a6b... 533337f...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 29 20:24:15 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 1d53a6b65e5d51456c57728c9d07bb36093df7b0
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 29 20:23:00 2010 +0200
BZ 560803 add index on measurement_def.numeric_type
BZ 535686 add index on call time value.end_time to speed up purges
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 92ae1d2..d536ce6 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.87</db.schema.version>
+ <db.schema.version>2.88</db.schema.version>
</properties>
<dependencies>
@@ -95,9 +95,9 @@
db = project.properties.db
if (db == 'dev') {
- database = project.properties['rhq.dev.ds.db-name']
- }
- // This is a bit of a temporary hack to work around
+ database = project.properties['rhq.dev.ds.db-name']
+ }
+ // This is a bit of a temporary hack to work around
// https://cvs.codehaus.org/browse/GMAVEN-46 which results in
// groovy scripts not being able to get the correct values of
// build properties that are overridden on the command line.
@@ -105,7 +105,7 @@
// trying to use a database named rhqupgrade.
else if (project.properties['upgrade.db']) {
database = 'rhqupgrade'
- }
+ }
else {
database = project.properties['rhq.test.ds.db-name']
}
@@ -275,7 +275,7 @@
<goal>run</goal>
</goals>
</execution>
-
+
<execution>
<!--
This execution will abort the build if the database schema is not up to date.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
index 38c759c..8108cb9 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
@@ -34,6 +34,9 @@
<field ref="NAME"/>
<field ref="RAW_NUMERIC_TYPE"/>
</index>
+ <index name="RHQ_METRIC_DEF_NT_IDX">
+ <field ref="NUMERIC_TYPE"/>
+ </index>
</table>
@@ -86,7 +89,7 @@
<field ref="TIME_STAMP"/>
</primaryKey>
</constraint>
-
+
<index name="RHQ_MEAS_DATA_1H_TIME_IDX">
<field ref="TIME_STAMP"/>
</index>
@@ -108,7 +111,7 @@
<field ref="TIME_STAMP"/>
</primaryKey>
</constraint>
-
+
<index name="RHQ_MEAS_DATA_6H_TIME_IDX">
<field ref="TIME_STAMP"/>
</index>
@@ -166,6 +169,9 @@
<column name="MAXIMUM" type="DOUBLE" required="true"/>
<column name="TOTAL" type="DOUBLE" required="true"/>
<column name="COUNT" type="LONG" required="true"/>
+ <index name="RHQ_CT_DA_VA_END_TIM_IDX">
+ <field ref="END_TIME"/>
+ </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 1d3bd04..daf68f4 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -17,13 +17,13 @@
Update Version: ${target.schema.version}
</echo>
- <dbupgrade jdbcUrl="${jdbc.url}"
- jdbcUser="${jdbc.user}"
- jdbcPassword="${jdbc.password}"
+ <dbupgrade jdbcUrl="${jdbc.url}"
+ jdbcUser="${jdbc.user}"
+ jdbcPassword="${jdbc.password}"
valueColumn="PROPERTY_VALUE"
- table="RHQ_SYSTEM_CONFIG"
- keyColumn="PROPERTY_KEY"
- keyMatch="DB_SCHEMA_VERSION"
+ table="RHQ_SYSTEM_CONFIG"
+ keyColumn="PROPERTY_KEY"
+ keyMatch="DB_SCHEMA_VERSION"
targetSchemaVersion="${target.schema.version}">
<schemaSpec version="2.0">
@@ -31,7 +31,7 @@
</schemaSpec>
<schemaSpec version="2.1">
- <!-- Keep the columnType VARCHAR2, but increase size;
+ <!-- Keep the columnType VARCHAR2, but increase size;
(see note for RHQ_ALERT_CONDITION table in alert-schema.xml for more ifo) -->
<schema-alterColumn table="RHQ_ALERT_CONDITION" column="OPTION_STATUS" columnType="VARCHAR2" precision="256" />
</schemaSpec>
@@ -1805,7 +1805,7 @@
</schemaSpec>
<schemaSpec version="2.61">
- <schema-createSequence name="RHQ_DISTRIBUTION_TYPE_ID_SEQ" initial="10001" />
+ <schema-createSequence name="RHQ_DISTRIBUTION_TYPE_ID_SEQ" initial="10001" />
<schema-directSQL>
<statement>
CREATE TABLE RHQ_DISTRIBUTION_TYPE ( ID INTEGER PRIMARY KEY )
@@ -1829,12 +1829,12 @@
</schema-directSQL>
<schema-createSequence name="RHQ_DISTRIBUTION_ID_SEQ" initial="10001" />
- <schema-directSQL>
+ <schema-directSQL>
<statement desc="Creating table RHQ_DISTRIBUTION">
CREATE TABLE RHQ_DISTRIBUTION ( ID INTEGER PRIMARY KEY )
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_DISTRIBUTION" column="ID" nullable="false" />
+ <schema-alterColumn table="RHQ_DISTRIBUTION" column="ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION" column="DISTRIBUTION_TYPE_ID" columnType="INTEGER" />
<schema-alterColumn table="RHQ_DISTRIBUTION" column="DISTRIBUTION_TYPE_ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION" column="LABEL" precision="64" columnType="VARCHAR2" />
@@ -1897,7 +1897,7 @@
</schemaSpec>
<schemaSpec version="2.63">
- <schema-addColumn table="RHQ_REPO" column="IS_CANDIDATE" columnType="BOOLEAN" />
+ <schema-addColumn table="RHQ_REPO" column="IS_CANDIDATE" columnType="BOOLEAN" />
<schema-directSQL>
<statement targetDBVendor="postgresql">
@@ -1907,7 +1907,7 @@
UPDATE RHQ_REPO SET IS_CANDIDATE = 0
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_REPO" column="IS_CANDIDATE" nullable="false" />
+ <schema-alterColumn table="RHQ_REPO" column="IS_CANDIDATE" nullable="false" />
</schemaSpec>
<!-- Generic tagging support -->
@@ -1932,7 +1932,7 @@
CREATE TABLE RHQ_DISTRIBUTION_FILE (ID INTEGER PRIMARY KEY)
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="ID" nullable="false" />
+ <schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION_FILE" column="DISTRIBUTION_ID" columnType="INTEGER" />
<schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="DISTRIBUTION_ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION_FILE" column="RELATIVE_FILENAME" precision="256" columnType="VARCHAR2" />
@@ -2358,8 +2358,8 @@
</statement>
<statement desc="Creating RHQ_BUNDLE_TYPE unique constraint">
CREATE UNIQUE INDEX RHQ_BUNDLE_TYPE_UNIQUE ON RHQ_BUNDLE_TYPE (name)
- </statement>
- </schema-directSQL>
+ </statement>
+ </schema-directSQL>
<!-- RHQ_BUNDLE -->
<schema-createSequence name="RHQ_BUNDLE_ID_SEQ" initial="10001" />
@@ -2396,12 +2396,12 @@
ADD CONSTRAINT RHQ_B_PACKAGE_TYPE_ID_FK
FOREIGN KEY (PACKAGE_TYPE_ID)
REFERENCES RHQ_PACKAGE_TYPE (ID)
- </statement>
+ </statement>
<statement desc="Creating RHQ_BUNDLE unique constraint">
CREATE UNIQUE INDEX RHQ_BUNDLE_UNIQUE ON RHQ_BUNDLE (bundle_type_id, name)
- </statement>
+ </statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_VERSION -->
<schema-createSequence name="RHQ_BUNDLE_VERSION_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2439,7 +2439,7 @@
CREATE UNIQUE INDEX RHQ_BUNDLE_VERSION_UNIQUE ON RHQ_BUNDLE_VERSION (bundle_id, name, version)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_VERSION_REPO -->
<schema-directSQL>
<statement desc="Creating table RHQ_BUNDLE_VERSION_REPO">
@@ -2466,7 +2466,7 @@
REFERENCES RHQ_REPO (ID)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_FILE -->
<schema-createSequence name="RHQ_BUNDLE_FILE_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2479,7 +2479,7 @@
<schema-alterColumn table="RHQ_BUNDLE_FILE" column="BUNDLE_VERSION_ID" nullable="FALSE" />
<schema-addColumn table="RHQ_BUNDLE_FILE" column="PACKAGE_VERSION_ID" columnType="INTEGER" />
<schema-alterColumn table="RHQ_BUNDLE_FILE" column="PACKAGE_VERSION_ID" nullable="FALSE" />
-
+
<schema-directSQL>
<statement desc="Creating RHQ_BUNDLE_FILE foreign key relation to RHQ_BUNDLE_VERSION">
ALTER TABLE RHQ_BUNDLE_FILE
@@ -2494,7 +2494,7 @@
REFERENCES RHQ_PACKAGE_VERSION (ID)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_DESTINATION -->
<schema-createSequence name="RHQ_BUNDLE_DESTINATION_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2513,9 +2513,9 @@
<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-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-alterColumn table="RHQ_BUNDLE_DESTINATION" column="DEPLOY_DIR" nullable="FALSE" />
<schema-directSQL>
<statement desc="Creating RHQ_BUNDLE_DESTINATION foreign key relation to RHQ_BUNDLE">
@@ -2535,7 +2535,7 @@
ON RHQ_BUNDLE_DESTINATION (bundle_id, group_id, deploy_dir)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_DEPLOYMENT -->
<schema-createSequence name="RHQ_BUNDLE_DEPLOYMENT_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2561,8 +2561,8 @@
<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-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="REPLACED_BUNDLE_DEPLOYMENT_ID" columnType="INTEGER" />
+ <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">
@@ -2576,7 +2576,7 @@
ADD CONSTRAINT RHQ_BD_B_DESTINATION_ID_FK
FOREIGN KEY (BUNDLE_DESTINATION_ID)
REFERENCES RHQ_BUNDLE_DESTINATION (ID)
- </statement>
+ </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
@@ -2588,9 +2588,9 @@
ADD CONSTRAINT RHQ_BD_B_DEPLOYMENT_ID_FK
FOREIGN KEY (REPLACED_BUNDLE_DEPLOYMENT_ID)
REFERENCES RHQ_BUNDLE_DEPLOYMENT (ID)
- </statement>
- </schema-directSQL>
-
+ </statement>
+ </schema-directSQL>
+
<!-- RHQ_BUNDLE_RES_DEPLOY -->
<schema-createSequence name="RHQ_BUNDLE_RES_DEPLOY_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2622,11 +2622,11 @@
REFERENCES RHQ_RESOURCE (ID)
</statement>
<statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique constraint on def-resource mapping">
- CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX
+ CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX
ON RHQ_BUNDLE_RES_DEPLOY (BUNDLE_DEPLOYMENT_ID, RESOURCE_ID)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_RES_DEP_HIST -->
<schema-createSequence name="RHQ_BUNDLE_RES_DEP_HIST_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2644,7 +2644,7 @@
<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-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" columnType="VARCHAR2" precision="32" />
<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" />
@@ -2656,7 +2656,7 @@
FOREIGN KEY (BUNDLE_RES_DEPLOY_ID)
REFERENCES RHQ_BUNDLE_RES_DEPLOY (ID)
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
<schemaSpec version="2.79">
@@ -2683,11 +2683,11 @@
ALTER TABLE RHQ_PACKAGE_BITS DROP COLUMN BITS
</statement>
<statement desc="Change bytea column to oid in postgres.">
- ALTER TABLE RHQ_PACKAGE_BITS RENAME COLUMN NEWOID TO BITS
+ ALTER TABLE RHQ_PACKAGE_BITS RENAME COLUMN NEWOID TO BITS
</statement>
</schema-directSQL>
</schemaSpec>
-
+
<schemaSpec version="2.82">
<schema-directSQL>
<statement desc="Creating table RHQ_SAVED_SEARCH">
@@ -2744,8 +2744,8 @@
CREATE TABLE RHQ_SUBJECT_ROLE_LDAP_MAP ( SUBJECT_ID INTEGER, ROLE_ID INTEGER )
</statement>
<statement desc="Creating composite PK for RHQ_SUBJECT_ROLE_LDAP_MAP">
- ALTER TABLE RHQ_SUBJECT_ROLE_LDAP_MAP
- ADD CONSTRAINT RHQ_SUBJECT_ROLE_LDAP_MAP_PK
+ ALTER TABLE RHQ_SUBJECT_ROLE_LDAP_MAP
+ ADD CONSTRAINT RHQ_SUBJECT_ROLE_LDAP_MAP_PK
PRIMARY KEY ( SUBJECT_ID, ROLE_ID )
</statement>
<statement desc="Creating FK relation to RHQ_SUBJECT table for SUBJECT_ID column">
@@ -2763,7 +2763,7 @@
</schema-directSQL>
<schema-alterColumn table="RHQ_SUBJECT_ROLE_LDAP_MAP" column="SUBJECT_ID" nullable="FALSE" />
<schema-alterColumn table="RHQ_SUBJECT_ROLE_LDAP_MAP" column="ROLE_ID" nullable="FALSE" />
-
+
<!-- Fixing ldap group authz by adding remaining mapping elements left out(RHQ_ROLE_LDAP_GROUP) -->
<!-- RHQ_ROLE_LDAP_GROUP -->
<schema-createSequence name="RHQ_ROLE_LDAP_GROUP_ID_SEQ" initial="10001" />
@@ -2771,11 +2771,11 @@
<statement desc="Creating table RHQ_ROLE_LDAP_GROUP">
CREATE TABLE RHQ_ROLE_LDAP_GROUP ( ID INTEGER PRIMARY KEY, ROLE_ID INTEGER )
</statement>
- </schema-directSQL>
+ </schema-directSQL>
<schema-alterColumn table="RHQ_ROLE_LDAP_GROUP" column="ID" nullable="FALSE" />
<schema-alterColumn table="RHQ_ROLE_LDAP_GROUP" column="ROLE_ID" nullable="FALSE" />
<schema-addColumn table="RHQ_ROLE_LDAP_GROUP" column="LDAP_GROUP_NAME" columnType="VARCHAR2" precision="128" />
-
+
<schema-directSQL>
<statement>
ALTER TABLE RHQ_ROLE_LDAP_GROUP
@@ -2787,7 +2787,7 @@
CREATE UNIQUE INDEX RHQ_ROLE_LDAP_GROUP_IDX
ON RHQ_ROLE_LDAP_GROUP ( LDAP_GROUP_NAME, ROLE_ID )
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
<!-- Remove the old tagging system -->
@@ -2949,7 +2949,7 @@
REFERENCES RHQ_TAGGING ( ID )
</statement>
</schema-directSQL>
-
+
<schema-directSQL>
<statement>
CREATE TABLE RHQ_TAGGING_BUNDLE_DEST_MAP ( BUNDLE_DESTINATION_ID INTEGER )
@@ -2976,9 +2976,9 @@
FOREIGN KEY ( TAG_ID )
REFERENCES RHQ_TAGGING ( ID )
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
-
+
<schemaSpec version="2.86">
<schema-directSQL>
<statement desc="Adding MANAGE_BUNDLE permission to overlord">
@@ -2989,18 +2989,28 @@
</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">
+ </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.88">
+ <schema-directSQL>
+ <statement desc="Add end time index on call time data to speed up purges">
+ CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE (end_time)
+ </statement>
+ <statement desc="Add index on measurement definition numeric type">
+ CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF (numeric_type)
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
</dbupgrade>
</target>
</project>
commit 533337f5538f8fea1d09cf2abf4c458106c306c3
Merge: b2bd54e... 344be2f...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jun 29 13:57:58 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit b2bd54e4a6ac3475cc66a65ae3e4088d7ee28be3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jun 29 13:55:12 2010 -0400
fix so vertical scrolling works correctly for content within RichFaces tabPanels on Resource Configuration > Current tab and Admin > Plugins pages when on IE 6/7 (https://bugzilla.redhat.com/show_bug.cgi?id=601744)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
index aa9f90d..7629fd7 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
@@ -49,7 +49,7 @@ id - the id of the Resource being accessed
</div>
</div>
<div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;">
- <div id="centerContentWrapper" class="content-right">
+ <div id="centerContentWrapper" class="content-right" style="position: relative">
<div style="left: 0; right: 0; height: 100%;">
<ui:insert name="summary"><p>Default Entity Summary</p></ui:insert>
<ui:insert name="tabBar"><p>Default Entity TabBar</p></ui:insert>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
index 00666c1..5031f75 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
@@ -15,7 +15,7 @@
<ui:composition template="/rhq/layout/main-layout.xhtml">
<ui:define name="body-area">
- <div id="content-full" style="width: 100%; height: 100%; overflow: auto;">
+ <div id="content-full" style="width: 100%; height: 100%; overflow: auto; position: relative">
<h:panelGroup id="Breadcrumb" layout="block" rendered="#{empty disableBreadcrumbs}">
<ui:insert name="breadcrumbs">Default Full Screen Breadcrumbs</ui:insert>
</h:panelGroup>
commit 344be2ff459e13af30832c48d201ac7714fe229b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 13:47:21 2010 -0400
BZ-609158: hide "alerting on call-time data" and "group-wise call-time data view" behind the "experimental feature" conditional rendering feature
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java
index ccf46dd..81648a2 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java
@@ -131,7 +131,8 @@ public abstract class DefinitionFormPrepareAction extends TilesAction {
if (defForm.getTraits().size() > 0 && triggerNotSet)
defForm.getCondition(0).setTrigger("onTrait");
- request.setAttribute("showCalltimeMetrics", defForm.getCalltimeMetrics().size() > 0);
+ boolean isExperimental = LookupUtil.getSystemManager().isExperimentalFeaturesEnabled();
+ request.setAttribute("showCalltimeMetrics", isExperimental && defForm.getCalltimeMetrics().size() > 0);
if (defForm.getCalltimeMetrics().size() > 0 && triggerNotSet)
defForm.getCondition(0).setTrigger("onCallTime");
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
index 5a01f31..13d1786 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
@@ -81,7 +81,9 @@ THIS TEXT WILL BE REMOVED AS WELL.
<onc:subtab name="Graphs" url="/rhq/autogroup/monitor/graphs.xhtml" />
<onc:subtab name="Tables" url="/rhq/autogroup/monitor/tables.xhtml" />
<onc:subtab name="Schedules" url="/rhq/autogroup/monitor/schedules.xhtml" />
- <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" />
+ <c:if test="#{GlobalPermissionsUIBean.experimental}">
+ <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" />
+ </c:if>
</onc:tab>
<onc:tab name="Events" image="/images/icons/Events_grey_16.png">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
index ac806e8..08b9d77 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
@@ -58,7 +58,9 @@ THIS TEXT WILL BE REMOVED AS WELL.
<onc:subtab name="Graphs" url="/rhq/group/monitor/graphs.xhtml"/>
<onc:subtab name="Tables" url="/rhq/group/monitor/tables.xhtml"/>
<onc:subtab name="Schedules" url="/rhq/group/monitor/schedules.xhtml"/>
- <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/>
+ <c:if test="#{GlobalPermissionsUIBean.experimental}">
+ <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/>
+ </c:if>
</onc:tab>
<onc:tab name="Inventory" image="/images/icons/Inventory_grey_16.png">
commit 332fe9ad8a96d058eee69285cd7960f119b9d6d5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 13:45:07 2010 -0400
support a GLOBAL bit for toggling on/off experimental features in the product
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java
index 237858d..48694d8 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java
@@ -37,6 +37,7 @@ public class SystemConfigForm extends BaseValidatorForm {
private String agentMaxQuietTimeAllowedVal = "0";
private boolean enableAgentAutoUpdate = false;
private boolean enableDebugMode = false;
+ private boolean enableExperimentalFeatures = false;
private String helpUserId = "";
private String helpPassword = "";
private String maintIntervalVal = "0";
@@ -75,6 +76,7 @@ public class SystemConfigForm extends BaseValidatorForm {
buf.append(" agentMaxQuietTimeAllowed=").append(agentMaxQuietTimeAllowed);
buf.append(" enableAgentAutoUpdate=").append(enableAgentAutoUpdate);
buf.append(" enableDebugMode=").append(enableDebugMode);
+ buf.append(" enableExperimentalFeatures=").append(enableExperimentalFeatures);
buf.append(" helpUserId=").append(helpUserId);
buf.append(" helpPassword=").append(helpPassword);
buf.append(" ldapEnabled=").append(ldapEnabled);
@@ -103,6 +105,7 @@ public class SystemConfigForm extends BaseValidatorForm {
agentMaxQuietTimeAllowedVal = null;
enableAgentAutoUpdate = true;
enableDebugMode = false;
+ enableExperimentalFeatures = false;
helpUserId = "";
helpPassword = "";
maintInterval = "";
@@ -165,6 +168,16 @@ public class SystemConfigForm extends BaseValidatorForm {
}
enableDebugMode = Boolean.valueOf(enableDebugModeStr).booleanValue();
+ String enableExperimentalFeaturesStr = prop.getProperty(RHQConstants.EnableExperimentalFeatures);
+ if (enableExperimentalFeaturesStr == null) {
+ enableExperimentalFeaturesStr = Boolean.FALSE.toString();
+ } else if (enableExperimentalFeaturesStr.equals("0")) {
+ enableExperimentalFeaturesStr = Boolean.FALSE.toString();
+ } else if (enableExperimentalFeaturesStr.equals("1")) {
+ enableExperimentalFeaturesStr = Boolean.TRUE.toString();
+ }
+ enableExperimentalFeatures = Boolean.valueOf(enableExperimentalFeaturesStr).booleanValue();
+
String maintIntervalValStr = prop.getProperty(RHQConstants.DataMaintenance);
Long maintIntervalLong = new Long(maintIntervalValStr);
maintInterval = findTimeUnit(maintIntervalLong.longValue());
@@ -292,6 +305,8 @@ public class SystemConfigForm extends BaseValidatorForm {
prop.setProperty(RHQConstants.EnableDebugMode, String.valueOf(enableDebugMode));
+ prop.setProperty(RHQConstants.EnableExperimentalFeatures, String.valueOf(enableExperimentalFeatures));
+
long maintIntervalLong = convertToMillisecond(Integer.parseInt(maintIntervalVal), maintInterval);
prop.setProperty(RHQConstants.DataMaintenance, String.valueOf(maintIntervalLong));
@@ -383,6 +398,14 @@ public class SystemConfigForm extends BaseValidatorForm {
this.enableDebugMode = b;
}
+ public boolean getEnableExperimentalFeatures() {
+ return this.enableExperimentalFeatures;
+ }
+
+ public void setEnableExperimentalFeatures(boolean b) {
+ this.enableExperimentalFeatures = b;
+ }
+
public String getMaintIntervalVal() {
return maintIntervalVal;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
index 9cf263f..9f6ffd0 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
@@ -23,7 +23,6 @@ import java.util.Set;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
-import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -34,6 +33,7 @@ public class GlobalPermissionsUIBean {
private boolean settings;
private boolean isSuperuser;
private boolean isDebugMode;
+ private boolean isExperimental;
public GlobalPermissionsUIBean() {
Subject user = EnterpriseFacesContextUtility.getSubject();
@@ -48,7 +48,8 @@ public class GlobalPermissionsUIBean {
}
SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- isDebugMode = Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode));
+ isDebugMode = systemManager.isDebugModeEnabled();
+ isExperimental = systemManager.isExperimentalFeaturesEnabled();
}
public boolean isSuperuser() {
@@ -59,6 +60,10 @@ public class GlobalPermissionsUIBean {
return isDebugMode;
}
+ public boolean isExperimental() {
+ return isExperimental;
+ }
+
public boolean isSecurity() {
return security;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java
index 2c9104d..efe3dba 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java
@@ -18,19 +18,23 @@
*/
package org.rhq.enterprise.gui.common.framework;
+import java.util.TimeZone;
+
+import javax.faces.component.UIComponent;
+
import com.sun.facelets.Facelet;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jboss.seam.Component;
+
import org.rhq.core.util.maven.MavenArtifactNotFoundException;
import org.rhq.core.util.maven.MavenArtifactProperties;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
-import javax.faces.component.UIComponent;
-import java.util.TimeZone;
-
/**
* A JSF managed bean that exposes various general server information - RHQ version, timezone, etc.
*
@@ -50,6 +54,12 @@ public class ServerInfoUIBean {
return Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode));
}
+ public boolean isExperimentalFeaturesEnabled() {
+ SystemManagerLocal systemManager = LookupUtil.getSystemManager();
+ return Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(
+ RHQConstants.EnableExperimentalFeatures));
+ }
+
public String getFacesVersion() {
return getManifestVersion(UIComponent.class);
}
@@ -81,11 +91,10 @@ public class ServerInfoUIBean {
if (pkg != null) {
version = pkg.getImplementationVersion();
if (version == null) {
- version = pkg.getSpecificationVersion();
+ version = pkg.getSpecificationVersion();
}
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.error("Error while looking up manifest version for " + clazz + ".", e);
}
return version;
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 2d93e15..2510400 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
@@ -591,6 +591,7 @@ admin.settings.BaseURL=GUI Console URL:
admin.settings.AgentMaxQuietTimeAllowed=Agent Max Quiet Time Allowed:
admin.settings.EnableAgentAutoUpdate=Enable Agent Auto-Updates:
admin.settings.EnableDebugMode=Enable Debug Mode:
+admin.settings.EnableExperimentalFeatures=Enable Experimental Features:
admin.settings.HttpProxyUrl=HTTP Proxy URL:
admin.settings.HttpProxyPort=HTTP Proxy Port:
admin.settings.SenderEmailAddressLabel=From Email Address:
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 30df9ef..068b230 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
@@ -101,4 +101,18 @@
</tr>
</hq:authorization>
+<hq:authorization permission="superuser">
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</hq:authorization>
+
</table>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
index 7bb1d72..6712b3d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
@@ -63,10 +63,12 @@ public class RHQConstants {
// Are we allowing automatic AgentUpdate binary download
public static final String EnableAgentAutoUpdate = "ENABLE_AGENT_AUTO_UPDATE";
-
- // Are we rendering a special "debug" menu for administrators?
+ // Are we rendering a special "debug" menu for administrators?
public static final String EnableDebugMode = "ENABLE_DEBUG_MODE";
+ // Are we rendering features which are marked as experimental for this installation?
+ public static final String EnableExperimentalFeatures = "ENABLE_EXPERIMENTAL_FEATURES";
+
// How long do we keep data compressed in hourly intervals?
public static final String DataPurge1Hour = "CAM_DATA_PURGE_1H";
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index edb5059..4dc713b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -267,7 +267,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
// to support Oracle (whose booleans may be 1 or 0) transform the boolean settings properly
String propName = prop.getPropertyKey();
if (RHQConstants.EnableAgentAutoUpdate.equals(propName) || RHQConstants.EnableDebugMode.equals(propName)
- || RHQConstants.DataReindex.equals(propName)) {
+ || RHQConstants.DataReindex.equals(propName) || RHQConstants.EnableExperimentalFeatures.equals(propName)) {
String booleanValue = prop.getPropertyValue();
if ("0".equals(booleanValue)) {
prop.setPropertyValue(Boolean.FALSE.toString());
@@ -473,8 +473,8 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
// we need to undeploy it first - on windows the files are locked and can't be renamed until undeployed
ObjectName name = ObjectNameFactory.create("jboss.system:service=MainDeployer");
MBeanServerConnection mbs = MBeanServerLocator.locateJBoss();
- MainDeployerMBean mbean = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance(mbs, name,
- MainDeployerMBean.class, false);
+ MainDeployerMBean mbean = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance(mbs,
+ name, MainDeployerMBean.class, false);
URL url = deployedInstallWar.toURI().toURL();
String urlString = url.toString().replace("%20", " "); // bug in undeployer doesn't like %20 - it wants a real space
((MainDeployerMBean) mbean).undeploy(urlString);
@@ -542,6 +542,23 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
}
}
+ public boolean isDebugModeEnabled() {
+ try {
+ return Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode, "false"));
+ } catch (Throwable t) {
+ return false; // paranoid catch-all
+ }
+ }
+
+ public boolean isExperimentalFeaturesEnabled() {
+ try {
+ return Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableExperimentalFeatures,
+ "false"));
+ } catch (Throwable t) {
+ return false; // paranoid catch-all
+ }
+ }
+
/**
* Retrieves the currently active license. Returns null if there is no active license. Otherwise it needs to
* propogate the appropriate error back up to the caller, otherwise the error will be masked, and from a UI
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
index 18bb904..e339c8b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
@@ -150,6 +150,10 @@ public interface SystemManagerLocal {
*/
void loadSystemConfigurationCache();
+ boolean isDebugModeEnabled();
+
+ boolean isExperimentalFeaturesEnabled();
+
//////////////////////////////////
// license specific methods follow
commit e0d9d1a44ecd4d42fc681eb0be0302578eb9191a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:46:16 2010 -0400
do not update the resource type when importing/creating resources.
the group category used to be based off of the explicit membership,
but that assumption was changed for 1.2.0 release so we could support
a compatible left-nav tree with recursive access to descendant for
easy authorization. this method only modifies the implicit resource
membership, not the explicit, so setResourceType would be a no-op.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index 5e7707d..8e33ca1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -765,8 +765,13 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso
* created, but which initially creates one or more resource groups of size 1; if this happens, the
* group will be created as a compatible group, if resources are later added via an inventory sync, and
* if this compatible group's membership changes, we need to recalculate the group category
+ *
+ * NOTE: this is no longer true. the group category used to be based off of the explicit membership,
+ * but that assumption was changed for 1.2.0 release so we could support a compatible left-nav
+ * tree with recursive access to descendant for easy authorization. this method only modifies
+ * the implicit resource membership, not the explicit, so setResourceType would be a no-op.
*/
- setResourceType(implicitRecursiveGroupId);
+ //setResourceType(implicitRecursiveGroupId);
}
} catch (Exception e) {
throw new ResourceGroupUpdateException("Could not add resource[id=" + resource.getId()
@@ -923,6 +928,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso
}
@SuppressWarnings("unchecked")
+ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void setResourceType(int resourceGroupId) throws ResourceGroupDeleteException {
Query query = entityManager.createNamedQuery(ResourceType.QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP);
query.setParameter("groupId", resourceGroupId);
commit 0beacaaa68b779b9677851568ed2e718b5c18d0d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:44:44 2010 -0400
BZ-608898: prevent deadlock during dynagroup recalculation
* first add/remove resources to the recalculated group, commit that work
* then reset the ResourceType on the group as necessary, based off of new membership
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
index 9a11216..5570738 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
@@ -303,6 +303,14 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal {
groupDefinitionId, result);
/*
+ * as a result of recalculation, the membership may have changed such that a group which was previously
+ * marked as compatible now becomes a mixed group. if that happens, then the GroupCategory needs to be
+ * updated and any compatible group constructs need to be removed from this group. the following method
+ * will achieve both of those goals
+ */
+ resourceGroupManager.setResourceType(nextResourceGroupId);
+
+ /*
* remove all ids returned from the helper. by the time we're done looping over all
* ExpressionEvaluator.Result objects, the remaining objects in managedResourceGroupIds should represent
* groups that no longer managed by this definition (either due to an inventory or expression change), and
@@ -374,8 +382,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal {
resourceGroupManager.removeResourcesFromGroup(overlord, resourceGroupId, ArrayUtils
.unwrapCollection(idsToRemove));
- resourceGroupManager.setResourceType(resourceGroupId);
-
long endTime = System.currentTimeMillis();
log.debug("calculateGroupMembership_helper took " + (endTime - startTime) + " millis");
commit eaf523492da7127850506e4f5919b4b9ce253e24
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:43:15 2010 -0400
BZ-608898: when setting the ResourceGroup on an AlertDefinition, do not load existing AlertDefinitions
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
index a64de62..94ae2fe 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
@@ -518,9 +518,11 @@ public class AlertDefinition implements Serializable {
public void setResourceGroup(ResourceGroup resourceGroup) {
this.resourceGroup = resourceGroup;
+ /*
if (this.resourceGroup != null) {
this.resourceGroup.getAlertDefinitions().add(this);
}
+ */
}
public ResourceType getResourceType() {
commit 9679c7a712fbeb644d4b01a52e347bba634195b7
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:42:21 2010 -0400
BZ-608898: when deleting/purging group alert definitions, only load ids
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
index e553ca8..8eb7efd 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
@@ -50,6 +50,7 @@ public class AlertDefinitionCriteria extends Criteria {
private Integer filterAlertTemplateResourceTypeId; // requires overrides
private String filterAlertTemplateResourceTypeName; // requires overrides
private List<Integer> filterResourceIds; // requires overrides
+ private List<Integer> filterResourceGroupIds; // requires overrides
private Boolean filterEnabled;
private String filterOperationName; // requires overrides
private Boolean filterDeleted;
@@ -66,11 +67,12 @@ public class AlertDefinitionCriteria extends Criteria {
filterOverrides.put("alertTemplateResourceTypeId", "resourceType.id = ?");
filterOverrides.put("alertTemplateResourceTypeName", "resourceType.name like ?");
filterOverrides.put("resourceIds", "resource.id IN ( ? )");
+ filterOverrides.put("resourceGroupIds", "resourceGroup.id IN ( ? )");
filterOverrides.put("operationName", "operationDefinition.name like ?");
}
@Override
- public Class getPersistentClass() {
+ public Class<?> getPersistentClass() {
return AlertDefinition.class;
}
@@ -106,6 +108,10 @@ public class AlertDefinitionCriteria extends Criteria {
this.filterResourceIds = Arrays.asList(filterResourceIds);
}
+ public void addFilterResourceGroupIds(Integer... filterResourceGroupIds) {
+ this.filterResourceGroupIds = Arrays.asList(filterResourceGroupIds);
+ }
+
public void addFilterEnabled(Boolean filterEnabled) {
this.filterEnabled = filterEnabled;
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java
index 57701ce..a2eb45e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java
@@ -36,6 +36,7 @@ import org.jboss.annotation.IgnoreDependency;
import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
@@ -45,6 +46,7 @@ import org.rhq.core.server.PersistenceUtility;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
+import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
/**
* @author Joseph Marques
@@ -330,16 +332,23 @@ public class GroupAlertDefinitionManagerBean implements GroupAlertDefinitionMana
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void purgeAllGroupAlertDefinitions(Subject subject, int resourceGroupId) {
- List<AlertDefinition> groupAlertDefinitions = findGroupAlertDefinitions(subject, resourceGroupId, PageControl
- .getUnlimitedInstance());
-
- int i = 0;
- Integer[] groupAlertDefinitionIds = new Integer[groupAlertDefinitions.size()];
- for (AlertDefinition groupAlertDefinition : groupAlertDefinitions) {
- groupAlertDefinitionIds[i++] = groupAlertDefinition.getId();
- }
+ Integer[] groupAlertDefinitionIdsForResourceGroup = findGroupAlertDefinitionIds(resourceGroupId);
+ removeGroupAlertDefinitions(subject, groupAlertDefinitionIdsForResourceGroup);
+ }
- removeGroupAlertDefinitions(subject, groupAlertDefinitionIds);
+ @SuppressWarnings("unchecked")
+ private Integer[] findGroupAlertDefinitionIds(int resourceGroupId) {
+ AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
+ criteria.addFilterResourceGroupIds(resourceGroupId);
+ criteria.setPageControl(PageControl.getUnlimitedInstance());
+
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ generator.alterProjection("alertdefinition.id");
+ Query query = generator.getQuery(entityManager);
+ List<Integer> groupAlertDefinitionIds = query.getResultList();
+
+ Integer[] results = groupAlertDefinitionIds.toArray(new Integer[groupAlertDefinitionIds.size()]);
+ return results;
}
public void removeGroupAlertDefinitions(Subject subject, int resourceGroupId, int[] resourceIdsToRemove) {
@@ -347,13 +356,12 @@ public class GroupAlertDefinitionManagerBean implements GroupAlertDefinitionMana
return;
}
- List<AlertDefinition> groupAlertDefinitions = findGroupAlertDefinitions(subject, resourceGroupId, PageControl
- .getUnlimitedInstance());
+ Integer[] groupAlertDefinitionIdsForResourceGroup = findGroupAlertDefinitionIds(resourceGroupId);
List<Integer> allChildrenDefinitionIds = new ArrayList<Integer>();
Subject overlord = subjectManager.getOverlord();
- for (AlertDefinition groupAlertDefinition : groupAlertDefinitions) {
- List<Integer> childDefinitions = getChildrenAlertDefinitionIds(subject, groupAlertDefinition.getId());
+ for (Integer nextGroupAlertDefinitionId : groupAlertDefinitionIdsForResourceGroup) {
+ List<Integer> childDefinitions = getChildrenAlertDefinitionIds(subject, nextGroupAlertDefinitionId);
allChildrenDefinitionIds.addAll(childDefinitions);
alertDefinitionManager.removeAlertDefinitions(overlord, childDefinitions
.toArray(new Integer[childDefinitions.size()]));
commit 72f529c71dc2d472a225d84933108a9c836d2da8
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:34:24 2010 -0400
remove unused dependency
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
index 991eb57..a48cd85 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
@@ -32,8 +32,6 @@ import javax.persistence.Query;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.annotation.IgnoreDependency;
-
import org.rhq.core.domain.alert.AlertCondition;
import org.rhq.core.domain.alert.AlertConditionCategory;
import org.rhq.core.domain.alert.AlertConditionLog;
@@ -76,9 +74,6 @@ public class AlertDefinitionManagerBean implements AlertDefinitionManagerLocal,
private AuthorizationManagerLocal authorizationManager;
@EJB
private AlertDefinitionManagerLocal alertDefinitionManager;
- @EJB
- @IgnoreDependency
- private AlertNotificationManagerLocal alertNotificationManager;
@EJB
private StatusManagerLocal agentStatusManager;
commit 636aaf2c1b4b75e02c905416294384de6660b8dc
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Jun 28 12:19:55 2010 +0200
BZ 602176 - the timeline is auto-scrollable, so that it displays in full even if it doesn't fit the screen.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
index 85f8696..e964274 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
@@ -33,6 +33,8 @@
.timeline-band-layer-inner { font-size: smaller; }
.table-start-label { font-size: smaller; }
</style>
+ <link rel="stylesheet" type="text/css" media="screen" href="/css/win.css"/>
+ <link rel="stylesheet" type="text/css" media="screen" href="/css/form-style.css"/>
</head>
<%
int eventId = WebUtility.getOptionalIntRequestParameter(request, "eventId", -1);
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml
index 1dd2c5c..0fe7d0f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml
@@ -31,7 +31,7 @@
<h:panelGrid columns="1" width="97%">
<iframe src ="/resource/common/monitor/events/EventsView.jsp?id=#{param.id}"
- width="100%" height="550" scrolling="no" frameborder="0" />
+ width="100%" height="550" scrolling="auto" frameborder="0" style="min-width: 635px"/>
</h:panelGrid>
</rich:panel>
commit c4b841ac57b3d2cc6c0302184d027d499da2375c
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 23:30:21 2010 -0400
delete obsolete call-time data code
* CallTimeData reports already ensure that (schedule_id, begin_time) is unique
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
index 265c0e7..253765d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
@@ -88,12 +88,6 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
+ "(schedule_id, call_destination) " + "SELECT ?, ? FROM RHQ_numbers WHERE i = 42 "
+ "AND NOT EXISTS (SELECT * FROM " + DATA_KEY_TABLE_NAME + " WHERE schedule_id = ? AND call_destination = ?)";
- /*
- private static final String CALLTIME_VALUE_DELETE_SUPERCEDED_STATEMENT = "DELETE FROM " + DATA_VALUE_TABLE_NAME
- + " WHERE key_id = " + "(SELECT id FROM " + DATA_KEY_TABLE_NAME
- + " WHERE schedule_id = ? AND call_destination = ?) AND begin_time = ?";
- */
-
private static final String CALLTIME_VALUE_INSERT_STATEMENT = "INSERT /*+ APPEND */ INTO " + DATA_VALUE_TABLE_NAME
+ "(id, key_id, begin_time, end_time, minimum, maximum, total, count) "
+ "SELECT %s, key.id, ?, ?, ?, ?, ?, ? FROM RHQ_numbers num, RHQ_calltime_data_key key WHERE num.i = 42 "
@@ -135,32 +129,6 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
// First make sure a single row exists in the key table for each reported call destination.
callTimeDataManager.insertCallTimeDataKeys(callTimeDataSet);
- /*
- * TODO: JM - Is this really needed? Under what circumstances are duplicates generated? Are we presuming
- * this is a misbehaving plugin, or a problem at the comm-layer where the same piece of data is delivered
- * twice? I'm tentatively removing this because it is a big hit to call-time data reporting performance.
- * If, however, evidence is presented that implores us to bring this functionality back, it should be
- * implemented by getting rid of the duplicate data points that share the same key_id and begin_time.
- * These records can be found with:
- *
- * SELECT key_id, begin_time, count(id)
- * FROM rhq_calltime_data_value
- * GROUP BY key_id, begin_time
- * HAVING count(id) > 1
- *
- * This is functionally equivalent to the CALLTIME_VALUE_DELETE_SUPERCEDED_STATEMENT query, but takes
- * advantage of the fact that key_id represents the already-computed pair of schedule_id/destination, thus
- * allowing the duplicate-search to be implemented against a single table.
- *
- * Taking this solution one step further, an appropriate delete statement can be crafted which leverages
- * the above concept but deletes all but one of the duplicates (perhaps leaving the record with the
- * smallest id/pk). This purge routine can either be grouped in with the rest in DataPurgeJob, or it can
- * be implemented as its own quartz job that runs more (or less) frequently, depending on our needs
- * (i.e., how often we anticipate duplicates)
- */
- // Delete any existing rows that have the same key and begin time as the data about to be inserted.
- //callTimeDataManager.deleteRedundantCallTimeDataValues(callTimeDataSet);
-
// Finally, add the stats themselves to the value table.
callTimeDataManager.insertCallTimeDataValues(callTimeDataSet);
}
@@ -373,55 +341,6 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
}
/*
- @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
- public void deleteRedundantCallTimeDataValues(Set<CallTimeData> callTimeDataSet) {
-
- int[] results;
- PreparedStatement ps = null;
- Connection conn = null;
-
- try {
- conn = rhqDs.getConnection();
- ps = conn.prepareStatement(CALLTIME_VALUE_DELETE_SUPERCEDED_STATEMENT);
- for (CallTimeData callTimeData : callTimeDataSet) {
- ps.setInt(1, callTimeData.getScheduleId());
- Set<String> callDestinations = callTimeData.getValues().keySet();
- for (String callDestination : callDestinations) {
- ps.setString(2, callDestination);
- CallTimeDataValue value = callTimeData.getValues().get(callDestination);
- ps.setLong(3, value.getBeginTime());
- ps.addBatch();
- }
- }
-
- results = ps.executeBatch();
-
- int deletedRowCount = 0;
- for (int i = 0; i < results.length; i++) {
- if ((results[i] < 0) && (results[i] != -2)) // oracle returns -2 because it can't count updated rows
- {
- throw new MeasurementStorageException("Failed to delete redundant call-time data rows - result ["
- + results[i] + "] for batch command [" + i + "] is less than 0.");
- }
-
- deletedRowCount += results[i];
- }
-
- log
- .debug("Deleted "
- + ((deletedRowCount >= 0) ? deletedRowCount : "?")
- + " redundant call-time data value rows that were superceded by data in the measurement report currently being processed.");
- } catch (SQLException e) {
- logSQLException("Failed to delete redundant call-time data values", e);
- } catch (Throwable t) {
- log.error("Failed to delete redundant call-time data values", t);
- } finally {
- JDBCUtil.safeClose(conn, ps, null);
- }
- }
- */
-
- /*
* internal method, do not expose to the remote API
*/
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
commit bff7953bd68384a51ae5d9f8c629f42e3d29d9e6
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 23:28:15 2010 -0400
use hints for postgres and oracle to allow faster insertion of call-time data
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
index 5a25f85..265c0e7 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
@@ -21,6 +21,7 @@ package org.rhq.enterprise.server.measurement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
+import java.sql.Statement;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -44,6 +45,7 @@ import org.rhq.core.db.DatabaseType;
import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.db.H2DatabaseType;
import org.rhq.core.db.OracleDatabaseType;
+import org.rhq.core.db.Postgresql83DatabaseType;
import org.rhq.core.db.PostgresqlDatabaseType;
import org.rhq.core.db.SQLServerDatabaseType;
import org.rhq.core.domain.auth.Subject;
@@ -78,7 +80,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
private static final String DATA_VALUE_TABLE_NAME = "RHQ_CALLTIME_DATA_VALUE";
private static final String DATA_KEY_TABLE_NAME = "RHQ_CALLTIME_DATA_KEY";
- private static final String CALLTIME_KEY_INSERT_STATEMENT = "INSERT INTO " + DATA_KEY_TABLE_NAME
+ private static final String CALLTIME_KEY_INSERT_STATEMENT = "INSERT /*+ APPEND */ INTO " + DATA_KEY_TABLE_NAME
+ "(id, schedule_id, call_destination) " + "SELECT %s, ?, ? FROM RHQ_numbers WHERE i = 42 "
+ "AND NOT EXISTS (SELECT * FROM " + DATA_KEY_TABLE_NAME + " WHERE schedule_id = ? AND call_destination = ?)";
@@ -92,7 +94,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
+ " WHERE schedule_id = ? AND call_destination = ?) AND begin_time = ?";
*/
- private static final String CALLTIME_VALUE_INSERT_STATEMENT = "INSERT INTO " + DATA_VALUE_TABLE_NAME
+ private static final String CALLTIME_VALUE_INSERT_STATEMENT = "INSERT /*+ APPEND */ INTO " + DATA_VALUE_TABLE_NAME
+ "(id, key_id, begin_time, end_time, minimum, maximum, total, count) "
+ "SELECT %s, key.id, ?, ?, ?, ?, ?, ? FROM RHQ_numbers num, RHQ_calltime_data_key key WHERE num.i = 42 "
+ "AND key.id = (SELECT id FROM " + DATA_KEY_TABLE_NAME + " WHERE schedule_id = ? AND call_destination = ?)";
@@ -312,6 +314,18 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
try {
conn = rhqDs.getConnection();
DatabaseType dbType = DatabaseTypeFactory.getDatabaseType(conn);
+
+ if (dbType instanceof Postgresql83DatabaseType) {
+ Statement st = null;
+ try {
+ // Take advantage of async commit here
+ st = conn.createStatement();
+ st.execute("SET synchronous_commit = off");
+ } finally {
+ JDBCUtil.safeClose(st);
+ }
+ }
+
if (dbType instanceof PostgresqlDatabaseType || dbType instanceof OracleDatabaseType
|| dbType instanceof H2DatabaseType) {
String keyNextvalSql = JDBCUtil.getNextValSql(conn, "RHQ_calltime_data_key");
@@ -420,6 +434,18 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
try {
conn = rhqDs.getConnection();
DatabaseType dbType = DatabaseTypeFactory.getDatabaseType(conn);
+
+ if (dbType instanceof Postgresql83DatabaseType) {
+ Statement st = null;
+ try {
+ // Take advantage of async commit here
+ st = conn.createStatement();
+ st.execute("SET synchronous_commit = off");
+ } finally {
+ JDBCUtil.safeClose(st);
+ }
+ }
+
if (dbType instanceof PostgresqlDatabaseType || dbType instanceof OracleDatabaseType
|| dbType instanceof H2DatabaseType) {
String valueNextvalSql = JDBCUtil.getNextValSql(conn, "RHQ_calltime_data_value");
commit 867c5b0107739274ba8ba196a00941d561eb87c5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 22:05:17 2010 -0400
fix sorting on "total" column for "monitor > response" sub-tab for all entity contexts
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
index b2d9b12..40aabcb 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
@@ -115,7 +115,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="MAX(calltimedatavalue.total)">
+ <onc:sortableColumnHeader sort="SUM(calltimedatavalue.total)">
<h:outputText value="Total" />
</onc:sortableColumnHeader>
</f:facet>
commit d70c9fe43f3f95ba4611b9eabaae52786721ab94
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 22:03:12 2010 -0400
fix JSF navigation rules for sort actions on group "monitor > response" sub-tab
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
index 917281b..d7ef174 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
@@ -57,14 +57,14 @@
<navigation-case>
<!-- catch all navigation-case: if any actions return 'success', go here -->
<from-outcome>success</from-outcome>
- <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id>
+ <to-view-id>/rhq/group/monitor/response.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<!-- sorting rule -->
<from-outcome>sort</from-outcome>
- <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id>
+ <to-view-id>/rhq/group/monitor/response.xhtml?groupId=#{param.groupId}&category=COMPATIBLE</to-view-id>
<redirect/>
</navigation-case>
commit f4c6a3d30b18e70bdbb16391ade3a1e2907745ca
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 18:30:19 2010 -0400
lower some measurement schedule logging statements from INFO to DEBUG
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
index 546a020..dc1395e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerBean.java
@@ -562,7 +562,9 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
+ "SELECT DISTINCT ms.resource.agent.id " //
+ " FROM MeasurementSchedule ms " //
+ " WHERE ms.id IN ( " + measurementScheduleSubQuery + " ) ";
- log.info("agentsQueryString: " + agentsQueryString);
+ if (log.isDebugEnabled()) {
+ log.debug("agentsQueryString: " + agentsQueryString);
+ }
Query agentsQuery = entityManager.createQuery(agentsQueryString);
agentIds = agentsQuery.getResultList();
} catch (Throwable t) {
@@ -581,7 +583,9 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
+ " FROM MeasurementSchedule ms " //
+ " WHERE ms.id IN ( " + measurementScheduleSubQuery + " ) " //
+ " AND ms.resource.agent.id = :agentId";
- log.info("scheduleRequestQueryString: " + scheduleRequestQueryString);
+ if (log.isDebugEnabled()) {
+ log.debug("scheduleRequestQueryString: " + scheduleRequestQueryString);
+ }
Query scheduleRequestQuery = entityManager.createQuery(scheduleRequestQueryString);
Map<Integer, ResourceMeasurementScheduleRequest> agentRequests = new HashMap<Integer, ResourceMeasurementScheduleRequest>();
@@ -654,12 +658,16 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
+ "UPDATE Resource res " //
+ " SET res.mtime = :now " //
+ " WHERE res.id IN ( " + resourceSubQuery + " ) ";
- log.info("markResourceQueryString: " + markResourceQueryString);
+ if (log.isDebugEnabled()) {
+ log.debug("markResourceQueryString: " + markResourceQueryString);
+ }
Query markResourceQuery = entityManager.createQuery(markResourceQueryString);
markResourceQuery.setParameter("now", System.currentTimeMillis());
int affectedRows = markResourceQuery.executeUpdate();
- log.info("Marked " + affectedRows + " for future measurement scheudle update");
+ if (log.isDebugEnabled()) {
+ log.debug("Marked " + affectedRows + " for future measurement scheudle update");
+ }
} catch (Throwable t) {
log.error("Could not notify agents of updates", t);
}
@@ -717,7 +725,11 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
updateQuery.setParameter("agentId", agentId);
updateQuery.setParameter("definitionIds", measurementDefinitionIds);
int updateCount = updateQuery.executeUpdate();
- log.info("" + updateCount + " resources mtime fields were updated as a result of this metric template update");
+
+ if (log.isDebugEnabled()) {
+ log.debug("" + updateCount
+ + " resources mtime fields were updated as a result of this metric template update");
+ }
}
public void updateSchedulesForAutoGroup(Subject subject, int parentResourceId, int childResourceType,
@@ -769,7 +781,9 @@ public class MeasurementScheduleManagerBean implements MeasurementScheduleManage
try {
AgentClient agentClient = LookupUtil.getAgentManager().getAgentClient(agent);
if (agentClient.ping(2000) == false) {
- log.debug("Won't send MeasurementSchedules to offline Agent[id=" + agent.getId() + "]");
+ if (log.isDebugEnabled()) {
+ log.debug("Won't send MeasurementSchedules to offline Agent[id=" + agent.getId() + "]");
+ }
return false;
}
agentClient.getMeasurementAgentService().updateCollection(resourceMeasurementScheduleRequest);
commit 77ea6433ec689ce3c58bf88bed4f8662ab7b1443
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 18:29:35 2010 -0400
BZ-608921: group-wise call-time data views
* add new CallTimeDataCriteria object
** ability to filter by resource / group / auto-group
* write findCallTimeDataForContext, which handles all data view queries now
** have all methods called from the UI delegate to findCallTimeDataForContext
* add response.xhtml at the compatible group and auto-group levels
** add "monitor > response" tab definitions in main.xhtml layout files
* add JSF navigation rules to measurement-navigation.xml files for group/autogroup
enhance call-time data reporting
* elide the destination column
** this prevents overflowing the horizontal area of the enclosing layout element
** only show up to the last 50 characters of the destination
** hovering over the destination field will give a tooltip with the full-length destiniation
* add the ability to filter call-time data records by destination substring
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java
new file mode 100644
index 0000000..8156d9a
--- /dev/null
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/CallTimeDataCriteria.java
@@ -0,0 +1,219 @@
+/*
+ * 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.criteria;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.rhq.core.domain.measurement.DataType;
+import org.rhq.core.domain.measurement.calltime.CallTimeDataValue;
+import org.rhq.core.domain.util.PageOrdering;
+
+/**
+ * @author Joseph Marques
+ */
+@XmlRootElement
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@SuppressWarnings("unused")
+public class CallTimeDataCriteria extends Criteria {
+ private static final long serialVersionUID = 1L;
+
+ private Integer filterResourceId; // requires overrides
+ private Integer filterResourceGroupId; // requires overrides
+ private Integer filterAutoGroupResourceTypeId; // requires overrides
+ private Integer filterAutoGroupParentResourceId; // requires overrides
+ private Long filterBeginTime; // requires overrides
+ private Long filterEndTime; // requires overrides
+ private Double filterMinimum;
+ private Double filterMaximum;
+ private Double filterTotal;
+ private Long filterCount;
+ private String filterDestination; // requires overrides
+ private DataType filterDataType = DataType.CALLTIME; // requires overrides, not user modifiable
+
+ private PageOrdering sortMinimum; // requires overrides
+ private PageOrdering sortMaximum; // requires overrides
+ private PageOrdering sortAverage; // requires overrides
+ private PageOrdering sortTotal; // requires overrides
+ private PageOrdering sortCount; // requires overrides
+
+ @Override
+ public Class<?> getPersistentClass() {
+ return CallTimeDataValue.class;
+ }
+
+ public CallTimeDataCriteria() {
+ /*
+ filterOverrides.put("resourceId", "key.schedule.resource.id = ?");
+ filterOverrides.put("resourceGroupId", "key.schedule.resource.id IN " //
+ + "( SELECT res.id " //
+ + " FROM Resource res " //
+ + " JOIN res.implicitGroups ig " //
+ + " WHERE ig.id = ? )");
+ filterOverrides.put("autoGroupResourceTypeId", "key.schedule.resource.id IN " //
+ + "( SELECT res.id " //
+ + " FROM Resource res " //
+ + " JOIN res.resourceType type " //
+ + " WHERE type.id = ? )");
+ filterOverrides.put("autoGroupParentResourceId", "key.schedule.resource.id IN " //
+ + "( SELECT res.id " //
+ + " FROM Resource res " //
+ + " JOIN res.parentResource parent " //
+ + " WHERE parent.id = ? )");
+ */
+ filterOverrides.put("resourceId", "id IN " //
+ + "( SELECT callData.id " //
+ + " FROM CallTimeDataValue callData " //
+ + " WHERE callData.key.schedule.resource.id = ? )");
+
+ filterOverrides.put("resourceGroupId", "id IN " //
+ + "( SELECT callData.id " //
+ + " FROM CallTimeDataValue callData, Resource res " //
+ + " JOIN res.implicitGroups ig " //
+ + " WHERE callData.key.schedule.resource.id = res.id " //
+ + " AND ig.id = ? ) ");
+
+ filterOverrides.put("autoGroupResourceTypeId", "id IN " //
+ + "( SELECT callData.id " //
+ + " FROM CallTimeDataValue callData, Resource res " //
+ + " WHERE callData.key.schedule.resource.id = res.id " //
+ + " AND res.resourceType.id = ? )");
+
+ filterOverrides.put("autoGroupParentResourceId", "id IN " //
+ + "( SELECT callData.id " //
+ + " FROM CallTimeDataValue callData, Resource res " //
+ + " WHERE callData.key.schedule.resource.id = res.id " //
+ + " AND res.parentResource.id = ? )");
+
+ filterOverrides.put("beginTime", "beginTime > ?");
+ filterOverrides.put("endTime", "endTime < ?");
+
+ filterOverrides.put("destination", "key.callDestination like ?");
+ /*
+ filterOverrides.put("destination", "id IN " //
+ + "( SELECT callData.id " //
+ + " FROM CallTimeDataValue callData " //
+ + " WHERE callData.key.callDestination like ? )");
+ */
+ filterOverrides.put("dataType", "key.schedule.definition.dataType = ?");
+ /*
+ filterOverrides.put("dataType", "id IN " //
+ + "( SELECT callData.id " //
+ + " FROM CallTimeDataValue callData " //
+ + " WHERE callData.key.schedule.definition.dataType = ? )");
+ */
+
+ sortOverrides.put("minimum", "MIN(" + getAlias() + ".minimum)");
+ sortOverrides.put("maximum", "MAX(" + getAlias() + ".maximum)");
+ sortOverrides.put("average", "(SUM(" + getAlias() + ".total) / SUM(" + getAlias() + ".count))");
+ sortOverrides.put("total", "SUM(" + getAlias() + ".total)");
+ sortOverrides.put("count", "SUM(" + getAlias() + ".count)");
+
+ }
+
+ public void addFilterResourceId(Integer filterResourceId) {
+ this.filterResourceId = filterResourceId;
+ }
+
+ public void addFilterResourceGroupId(Integer filterResourceGroupId) {
+ this.filterResourceGroupId = filterResourceGroupId;
+ }
+
+ public void addFilterAutoGroupResourceTypeId(Integer filterAutoGroupResourceTypeId) {
+ this.filterAutoGroupResourceTypeId = filterAutoGroupResourceTypeId;
+ }
+
+ public void addFilterAutoGroupParentResourceId(Integer filterAutoGroupParentResourceId) {
+ this.filterAutoGroupParentResourceId = filterAutoGroupParentResourceId;
+ }
+
+ public void addFilterBeginTime(Long filterBeginTime) {
+ this.filterBeginTime = filterBeginTime;
+ }
+
+ public void addFilterEndTime(Long filterEndTime) {
+ this.filterEndTime = filterEndTime;
+ }
+
+ public void addFilterMinimum(Double filterMinimum) {
+ this.filterMinimum = filterMinimum;
+ }
+
+ public void addFilterMaximum(Double filterMaximum) {
+ this.filterMaximum = filterMaximum;
+ }
+
+ public void addFilterTotal(Double filterTotal) {
+ this.filterTotal = filterTotal;
+ }
+
+ // use basic type not object wrapper because it requires non-null value
+ public void addFilterCount(long filterCount) {
+ if (filterCount < 1) {
+ throw new IllegalArgumentException("Filter 'count' must be greater than 0");
+ }
+ this.filterCount = filterCount;
+ }
+
+ public void addFilterDestination(String filterDestination) {
+ this.filterDestination = filterDestination;
+ }
+
+ public void addFilterDataType(DataType filterDataType) {
+ if (true) {
+ throw new IllegalArgumentException(
+ "Filter 'dataType' is not user modifiable, it must remain DataType.CALLTIME");
+ }
+ //this.filterDataType = filterDataType;
+ }
+
+ public void addSortMinimum(PageOrdering sortMinimum) {
+ addSortField("minimum");
+ this.sortMinimum = sortMinimum;
+ }
+
+ public void addSortMaximum(PageOrdering sortMaximum) {
+ addSortField("maximum");
+ this.sortMaximum = sortMaximum;
+ }
+
+ public void addSortAverage(PageOrdering sortAverage) {
+ addSortField("average");
+ this.sortAverage = sortAverage;
+ }
+
+ public void addSortTotal(PageOrdering sortTotal) {
+ addSortField("total");
+ this.sortTotal = sortTotal;
+ }
+
+ public void addSortCount(PageOrdering sortCount) {
+ addSortField("count");
+ this.sortCount = sortCount;
+ }
+
+ public boolean hasCustomizedSorting() {
+ return true;
+ }
+}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java
index f591ad6..c93c137 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/measurement/calltime/CallTimeUIBean.java
@@ -1,16 +1,10 @@
package org.rhq.enterprise.gui.measurement.calltime;
-import java.util.List;
-
-import javax.faces.application.FacesMessage;
import javax.faces.model.DataModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.MeasurementSchedule;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
@@ -24,7 +18,6 @@ import org.rhq.enterprise.gui.util.WebUtility;
import org.rhq.enterprise.server.common.EntityContext;
import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementPreferences;
-import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
import org.rhq.enterprise.server.measurement.MeasurementPreferences.MetricRangePreferences;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -33,14 +26,15 @@ import org.rhq.enterprise.server.util.LookupUtil;
*/
public class CallTimeUIBean extends PagedDataTableUIBean {
- private final Log log = LogFactory.getLog(this.getClass());
+ private final Log log = LogFactory.getLog(CallTimeUIBean.class);
public static final String MANAGED_BEAN_NAME = "CallTimeUIBean";
private CallTimeDataManagerLocal callTimeDataManager = LookupUtil.getCallTimeDataManager();
- private MeasurementScheduleManagerLocal scheduleManager = LookupUtil.getMeasurementScheduleManager();
+ //private MeasurementScheduleManagerLocal scheduleManager = LookupUtil.getMeasurementScheduleManager();
private EntityContext context;
+ private String destinationFilter;
public CallTimeUIBean() {
context = WebUtility.getEntityContext();
@@ -50,6 +44,17 @@ public class CallTimeUIBean extends PagedDataTableUIBean {
return this.context;
}
+ public String getDestinationFilter() {
+ if (destinationFilter == null) {
+ destinationFilter = FacesContextUtility.getOptionalRequestParameter("callTimeForm:destinationFilter");
+ }
+ return this.destinationFilter;
+ }
+
+ public void setDestinationFilter(String destinationFilter) {
+ this.destinationFilter = destinationFilter;
+ }
+
@Override
public DataModel getDataModel() {
if (dataModel == null) {
@@ -66,16 +71,17 @@ public class CallTimeUIBean extends PagedDataTableUIBean {
@Override
public PageList<CallTimeDataComposite> fetchPage(PageControl pc) {
- Subject subject = getSubject();
WebUser user = EnterpriseFacesContextUtility.getWebUser();
MeasurementPreferences preferences = user.getMeasurementPreferences();
MetricRangePreferences rangePreferences = preferences.getMetricRangePreferences();
+ /*
+ Subject subject = getSubject();
PageList<CallTimeDataComposite> results = new PageList<CallTimeDataComposite>();
if (context.category == EntityContext.Category.Resource) {
int resourceId = getResource().getId();
- List<MeasurementSchedule> callTimeSchedules = scheduleManager
- .findSchedulesForResourceAndType(subject, resourceId, DataType.CALLTIME, null, false);
+ List<MeasurementSchedule> callTimeSchedules = scheduleManager.findSchedulesForResourceAndType(subject,
+ resourceId, DataType.CALLTIME, null, false);
if (callTimeSchedules.size() == 0) {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN,
"This resource does not support response time metrics.");
@@ -88,15 +94,17 @@ public class CallTimeUIBean extends PagedDataTableUIBean {
rangePreferences.begin, rangePreferences.end, pc);
}
} else if (context.category == EntityContext.Category.ResourceGroup) {
- FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN,
- "Response time metrics are not yet supported for compatible groups.");
+ results = callTimeDataManager.findCallTimeDataForCompatibleGroup(subject, context.groupId,
+ rangePreferences.begin, rangePreferences.end, pc);
} else if (context.category == EntityContext.Category.AutoGroup) {
- FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN,
- "Response time metrics are not yet supported for auto-groups.");
+ results = callTimeDataManager.findCallTimeDataForAutoGroup(subject, context.parentResourceId,
+ context.resourceTypeId, rangePreferences.begin, rangePreferences.end, pc);
} else {
log.error(context.getUnknownContextMessage());
}
-
+ */
+ PageList<CallTimeDataComposite> results = callTimeDataManager.findCallTimeDataForContext(getSubject(),
+ context, rangePreferences.begin, rangePreferences.end, getDestinationFilter(), pc);
return results;
}
}
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml
index a21940f..2daf795 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-auto-group/measurement-navigation.xml
@@ -49,6 +49,26 @@
</navigation-case>
</navigation-rule>
+
+ <!-- changing metric display range on Monitor > Response -->
+ <navigation-rule>
+ <from-view-id>/rhq/autogroup/monitor/response.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go here -->
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/autogroup/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+ <to-view-id>/rhq/autogroup/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
<!-- changing metric display range on Events > History -->
<navigation-rule>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
index fd2378b..917281b 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/jsf-navigation-resource-group/measurement-navigation.xml
@@ -50,4 +50,24 @@
</navigation-rule>
+ <!-- changing metric display range on Monitor > Response -->
+ <navigation-rule>
+ <from-view-id>/rhq/group/monitor/response.xhtml</from-view-id>
+
+ <navigation-case>
+ <!-- catch all navigation-case: if any actions return 'success', go here -->
+ <from-outcome>success</from-outcome>
+ <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ <navigation-case>
+ <!-- sorting rule -->
+ <from-outcome>sort</from-outcome>
+ <to-view-id>/rhq/group/monitor/response.xhtml?parent=#{param.parent}&type=#{param.type}</to-view-id>
+ <redirect/>
+ </navigation-case>
+
+ </navigation-rule>
+
</faces-config>
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
index 28fac3c..5a01f31 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
@@ -36,98 +36,80 @@ REQUEST PARAMETERS:
THIS TEXT WILL BE REMOVED AS WELL.
<ui:param name="defaultPageTitle"
- value="'#{AutoGroupUIBean.parentResource.name}'.'#{AutoGroupUIBean.childResourceType.name}'" />
+ value="'#{AutoGroupUIBean.parentResource.name}'.'#{AutoGroupUIBean.childResourceType.name}'" />
- <ui:define name="summary">
-
- <ui:remove>
- <!-- NOTE: Besides being included here, summary.xhtml is also leveraged by JSP-based pages. Specifically, it is
- included (via an AJAX request) in /common/components/PageTitle.jsp.
- AutoGroups have no obvious summary information past what is in the breadcrumbs -->
- </ui:remove>
+ <ui:define name="summary">
+ <ui:remove>
+ <!-- NOTE: Besides being included here, summary.xhtml is also leveraged by JSP-based pages. Specifically, it is
+ included (via an AJAX request) in /common/components/PageTitle.jsp.
+ AutoGroups have no obvious summary information past what is in the breadcrumbs -->
+ </ui:remove>
<h:panelGroup layout="block" style="width: 100%; background-color: #E5E5E5;">
-
-
<table width="100%" style="padding-right: 20px; padding-top: 5px;" cellpadding="0" cellspacing="0">
+ <tr>
+ <td width="30">
+ <h:graphicImage value="/images/icons/Auto_group_#{AutoGroupUIBean.childResourceType.category}_up_24.png"/>
+ </td>
+ <td nowrap="nowrap">
+ <h:outputText value="#{AutoGroupUIBean.childResourceType.name} AutoGroup" style="font-size: 18px;" />
+ <br/>
+ <onc:resourceLineage resourceId="#{AutoGroupUIBean.parentResource.id}" />
+ <h:outputText value=" > " />
+ <h:outputLink value="/rhq/autogroup/monitor/graphs.xhtml">
+ <f:param name="parent" value="#{AutoGroupUIBean.parentResource.id}" />
+ <f:param name="type" value="#{AutoGroupUIBean.childResourceType.id}" />
+ <h:outputText value="#{AutoGroupUIBean.childResourceType.name}" />
+ </h:outputLink>
+ </td>
+ </tr>
+ </table>
+ </h:panelGroup>
+
+ <rich:spacer height="10px"/>
- <tr>
- <td width="30">
-
- <h:graphicImage value="/images/icons/Auto_group_#{AutoGroupUIBean.childResourceType.category}_up_24.png"/>
- </td>
- <td nowrap="nowrap">
-
- <h:outputText value="#{AutoGroupUIBean.childResourceType.name} AutoGroup" style="font-size: 18px;" /><br/>
-
-
- <onc:resourceLineage
- resourceId="#{AutoGroupUIBean.parentResource.id}" />
- <h:outputText value=" > " />
- <h:outputLink value="/rhq/autogroup/monitor/graphs.xhtml">
- <f:param name="parent"
- value="#{AutoGroupUIBean.parentResource.id}" />
- <f:param name="type"
- value="#{AutoGroupUIBean.childResourceType.id}" />
- <h:outputText value="#{AutoGroupUIBean.childResourceType.name}" />
- </h:outputLink>
-
- </td>
- </tr>
- </table>
-
-</h:panelGroup>
-
- <rich:spacer height="10px"/>
-
- </ui:define>
-
- <ui:define name="tabBar">
-
- <onc:tabBar selectedTabName="#{selectedTabName}">
-
- <f:param name="parent" value="#{param.parent}" />
- <f:param name="type" value="#{param.type}" />
-
- <onc:tab name="Monitor" image="/images/icons/Monitor_grey_16.png">
- <onc:subtab name="Graphs"
- url="/rhq/autogroup/monitor/graphs.xhtml" />
- <onc:subtab name="Tables"
- url="/rhq/autogroup/monitor/tables.xhtml" />
- <onc:subtab name="Schedules"
- url="/rhq/autogroup/monitor/schedules.xhtml" />
- </onc:tab>
- <onc:tab name="Events" image="/images/icons/Events_grey_16.png">
- <onc:subtab name="History"
- url="/rhq/autogroup/events/history.xhtml" />
- </onc:tab>
-
- </onc:tabBar>
-
- <!-- Shows the results of the last action executed. -->
- <h:messages showSummary="false" showDetail="true"
- infoClass="InfoBlock" warnClass="WarnBlock"
- errorClass="ErrorBlock" fatalClass="FatalBlock"
- globalOnly="true" layout="table" width="100%" />
-
- </ui:define>
+ </ui:define>
+ <ui:define name="tabBar">
+
+ <onc:tabBar selectedTabName="#{selectedTabName}">
+ <f:param name="parent" value="#{param.parent}" />
+ <f:param name="type" value="#{param.type}" />
+
+ <onc:tab name="Monitor" image="/images/icons/Monitor_grey_16.png">
+ <onc:subtab name="Graphs" url="/rhq/autogroup/monitor/graphs.xhtml" />
+ <onc:subtab name="Tables" url="/rhq/autogroup/monitor/tables.xhtml" />
+ <onc:subtab name="Schedules" url="/rhq/autogroup/monitor/schedules.xhtml" />
+ <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" />
+ </onc:tab>
+
+ <onc:tab name="Events" image="/images/icons/Events_grey_16.png">
+ <onc:subtab name="History" url="/rhq/autogroup/events/history.xhtml" />
+ </onc:tab>
+ </onc:tabBar>
+
+ <!-- Shows the results of the last action executed. -->
+ <h:messages showSummary="false"
+ showDetail="true"
+ infoClass="InfoBlock"
+ warnClass="WarnBlock"
+ errorClass="ErrorBlock"
+ fatalClass="FatalBlock"
+ globalOnly="true"
+ layout="table"
+ width="100%" />
+ </ui:define>
<ui:define name="nav">
-
<ui:include src="/rhq/resource/navigation/ResourcesTree.xhtml" />
-
</ui:define>
-
- <ui:define name="content">
- <p />
-
- <h1>Default AutoGroup Content</h1>
-
- <p />
- </ui:define>
+ <ui:define name="content">
+ <p />
+ <h1>Default AutoGroup Content</h1>
+ <p />
+ </ui:define>
</ui:composition>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml
new file mode 100644
index 0000000..793cdd6
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/monitor/response.xhtml
@@ -0,0 +1,21 @@
+<ui:composition template="/rhq/autogroup/layout/main.xhtml"
+ 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:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:param name="pageTitle" value="AutoGroup '#{AutoGroupUIBean.parentResource.name}'.'#{AutoGroupUIBean.childResourceType.name}' - Metric Response Time" />
+ <ui:param name="selectedTabName" value="Monitor.Response" />
+
+ <ui:define name="content">
+
+ <ui:include src="/rhq/common/monitor/response.xhtml" />
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
index d38802c..b2d9b12 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
@@ -16,27 +16,37 @@
</f:facet>
<h:form id="callTimeForm">
+ <a4j:keepAlive beanName="CallTimeUIBean"/>
+
<!-- On submit make sure these are provided for the context of any new instance of the UI beans -->
<c:if test="#{CallTimeUIBean.context.resourceId != -1}">
- <input type="hidden" name="id"
- value="#{CallTimeUIBean.context.resourceId}" />
+ <input type="hidden" name="id" value="#{CallTimeUIBean.context.resourceId}" />
</c:if>
<c:if test="#{CallTimeUIBean.context.groupId != -1}">
- <input type="hidden" name="groupId"
- value="#{CallTimeUIBean.context.groupId}" />
+ <input type="hidden" name="groupId" value="#{CallTimeUIBean.context.groupId}" />
</c:if>
<c:if
test="#{CallTimeUIBean.context.parentResourceId != -1}">
- <input type="hidden" name="parent"
- value="#{CallTimeUIBean.context.parentResourceId}" />
+ <input type="hidden" name="parent" value="#{CallTimeUIBean.context.parentResourceId}" />
</c:if>
<c:if test="#{CallTimeUIBean.context.resourceTypeId != -1}">
- <input type="hidden" name="type"
- value="#{CallTimeUIBean.context.resourceTypeId}" />
+ <input type="hidden" name="type" value="#{CallTimeUIBean.context.resourceTypeId}" />
</c:if>
- <ui:param name="callTimeDataModel" value="#{CallTimeUIBean.dataModel}" />
+ <h:panelGrid columns="3" cellspacing="3">
+ <h:outputLabel for="destinationFilter" value="Destination Filter: " />
+ <h:inputText id="destinationFilter" value="#{CallTimeUIBean.destinationFilter}"
+ onkeypress="return ignoreEnterKey(event);"
+ style="width: 300px;" />
+ <a4j:commandButton value="GO" reRender="callTimeDataTable, callTimeDataTableScroller"
+ status="commonStatus"
+ actionListener="#{CallTimeUIBean.clearDataModel}"
+ styleClass="buttonmed">
+ <s:defaultAction/>
+ </a4j:commandButton>
+ </h:panelGrid>
+ <ui:param name="callTimeDataModel" value="#{CallTimeUIBean.dataModel}" />
<rich:dataTable id="callTimeDataTable"
value="#{callTimeDataModel}"
rows="#{PageControl.CallTimeHistory.pageSize}"
@@ -54,7 +64,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="key.callDestination">
+ <onc:sortableColumnHeader sort="calltimedatavalue.key.callDestination">
<h:outputText value="Destination" />
</onc:sortableColumnHeader>
</f:facet>
@@ -63,7 +73,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="SUM(value.count)">
+ <onc:sortableColumnHeader sort="SUM(calltimedatavalue.count)">
<h:outputText value="Request Count" />
</onc:sortableColumnHeader>
</f:facet>
@@ -72,7 +82,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="MIN(value.minimum)">
+ <onc:sortableColumnHeader sort="MIN(calltimedatavalue.minimum)">
<h:outputText value="Minimum" />
</onc:sortableColumnHeader>
</f:facet>
@@ -83,7 +93,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="(SUM(value.total)/SUM(value.count))">
+ <onc:sortableColumnHeader sort="SUM(calltimedatavalue.total)/SUM(calltimedatavalue.count)">
<h:outputText value="Average" />
</onc:sortableColumnHeader>
</f:facet>
@@ -94,7 +104,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="MAX(value.maximum)">
+ <onc:sortableColumnHeader sort="MAX(calltimedatavalue.maximum)">
<h:outputText value="Maximum" />
</onc:sortableColumnHeader>
</f:facet>
@@ -102,10 +112,21 @@
<f:converter converterId="ShortDurationConverter"/>
</h:outputText>
</rich:column>
+
+ <rich:column>
+ <f:facet name="header">
+ <onc:sortableColumnHeader sort="MAX(calltimedatavalue.total)">
+ <h:outputText value="Total" />
+ </onc:sortableColumnHeader>
+ </f:facet>
+ <h:outputText value="#{item.total}">
+ <f:converter converterId="ShortDurationConverter"/>
+ </h:outputText>
+ </rich:column>
<f:facet name="footer">
<rich:columnGroup>
- <rich:column colspan="5" width="100%">
+ <rich:column colspan="6" width="100%">
<ui:param name="paginationDataTableName" value="callTimeDataTable" />
<ui:param name="paginationDataModel" value="#{callTimeDataModel}" />
<ui:param name="paginationPageControl" value="#{PageControl.CallTimeHistory}" />
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
index 51b9a88..ac806e8 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
@@ -58,6 +58,7 @@ THIS TEXT WILL BE REMOVED AS WELL.
<onc:subtab name="Graphs" url="/rhq/group/monitor/graphs.xhtml"/>
<onc:subtab name="Tables" url="/rhq/group/monitor/tables.xhtml"/>
<onc:subtab name="Schedules" url="/rhq/group/monitor/schedules.xhtml"/>
+ <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/>
</onc:tab>
<onc:tab name="Inventory" image="/images/icons/Inventory_grey_16.png">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml
new file mode 100644
index 0000000..44cbcfa
--- /dev/null
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/monitor/response.xhtml
@@ -0,0 +1,21 @@
+<ui:composition template="/rhq/group/layout/main.xhtml"
+ 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:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich">
+
+ <ui:param name="pageTitle" value="#{ResourceGroupUIBean.groupCategoryName} '#{ResourceGroupUIBean.name}' - Metric Response Time" />
+ <ui:param name="selectedTabName" value="Monitor.Response" />
+
+ <ui:define name="content">
+
+ <ui:include src="/rhq/common/monitor/response.xhtml" />
+
+ </ui:define>
+
+</ui:composition>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
index c6a43b8..5a25f85 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerBean.java
@@ -47,6 +47,7 @@ import org.rhq.core.db.OracleDatabaseType;
import org.rhq.core.db.PostgresqlDatabaseType;
import org.rhq.core.db.SQLServerDatabaseType;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.CallTimeDataCriteria;
import org.rhq.core.domain.measurement.MeasurementSchedule;
import org.rhq.core.domain.measurement.calltime.CallTimeData;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
@@ -61,7 +62,10 @@ import org.rhq.enterprise.server.alert.engine.AlertConditionCacheManagerLocal;
import org.rhq.enterprise.server.alert.engine.AlertConditionCacheStats;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
import org.rhq.enterprise.server.authz.PermissionException;
+import org.rhq.enterprise.server.common.EntityContext;
import org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor;
+import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
+import org.rhq.enterprise.server.util.CriteriaQueryRunner;
/**
* The manager for call-time metric data.
@@ -149,7 +153,7 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
* Taking this solution one step further, an appropriate delete statement can be crafted which leverages
* the above concept but deletes all but one of the duplicates (perhaps leaving the record with the
* smallest id/pk). This purge routine can either be grouped in with the rest in DataPurgeJob, or it can
- * be implemented as its own quartz job that runs more (or less) frequently, depending on how needs
+ * be implemented as its own quartz job that runs more (or less) frequently, depending on our needs
* (i.e., how often we anticipate duplicates)
*/
// Delete any existing rows that have the same key and begin time as the data about to be inserted.
@@ -196,15 +200,69 @@ public class CallTimeDataManagerBean implements CallTimeDataManagerLocal, CallTi
}
public PageList<CallTimeDataComposite> findCallTimeDataForCompatibleGroup(Subject subject, int groupId,
- int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl) {
- // TODO
- return null;
+ long beginTime, long endTime, PageControl pageControl) {
+ return findCallTimeDataForContext(subject, EntityContext.forGroup(groupId), beginTime, endTime, null,
+ pageControl);
}
public PageList<CallTimeDataComposite> findCallTimeDataForAutoGroup(Subject subject, int parentResourceId,
- int childResourceTypeId, int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl) {
- // TODO
- return null;
+ int childResourceTypeId, long beginTime, long endTime, PageControl pageControl) {
+ return findCallTimeDataForContext(subject, EntityContext.forAutoGroup(parentResourceId, childResourceTypeId),
+ beginTime, endTime, null, pageControl);
+ }
+
+ public PageList<CallTimeDataComposite> findCallTimeDataForContext(Subject subject, EntityContext context,
+ long beginTime, long endTime, String destination, PageControl pageControl) {
+
+ // lookup measurement definition id
+
+ CallTimeDataCriteria criteria = new CallTimeDataCriteria();
+ criteria.addFilterBeginTime(beginTime);
+ criteria.addFilterEndTime(endTime);
+ if (destination != null && !destination.trim().equals("")) {
+ criteria.addFilterDestination(destination);
+ }
+
+ pageControl.initDefaultOrderingField("SUM(calltimedatavalue.total)/SUM(calltimedatavalue.count)",
+ PageOrdering.DESC); // only set if no ordering yet specified
+ pageControl.addDefaultOrderingField("calltimedatavalue.key.callDestination", PageOrdering.ASC); // add this to sort, if not already specified
+ criteria.setPageControl(pageControl);
+
+ //criteria.addSortAverage(PageOrdering.DESC);
+
+ if (context.category == EntityContext.Category.Resource) {
+ criteria.addFilterResourceId(context.resourceId);
+ } else if (context.category == EntityContext.Category.ResourceGroup) {
+ criteria.addFilterResourceGroupId(context.groupId);
+ } else if (context.category == EntityContext.Category.AutoGroup) {
+ criteria.addFilterAutoGroupParentResourceId(context.parentResourceId);
+ criteria.addFilterAutoGroupResourceTypeId(context.resourceTypeId);
+ }
+
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ String replacementSelectList = "" //
+ + " new org.rhq.core.domain.measurement.calltime.CallTimeDataComposite( " //
+ + " calltimedatavalue.key.callDestination, " //
+ + " MIN(calltimedatavalue.minimum), " //
+ + " MAX(calltimedatavalue.maximum), " //
+ + " SUM(calltimedatavalue.total), " //
+ + " SUM(calltimedatavalue.count), " //
+ + " SUM(calltimedatavalue.total) / SUM(calltimedatavalue.count) ) ";
+ generator.alterProjection(replacementSelectList);
+ generator.setGroupByClause("calltimedatavalue.key.callDestination");
+
+ if (authorizationManager.isInventoryManager(subject) == false) {
+ generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE,
+ "key.schedule.resource", subject.getId());
+ }
+
+ //log.info(generator.getParameterReplacedQuery(false));
+ //log.info(generator.getParameterReplacedQuery(true));
+
+ CriteriaQueryRunner<CallTimeDataComposite> queryRunner = new CriteriaQueryRunner<CallTimeDataComposite>(
+ criteria, generator, entityManager);
+ PageList<CallTimeDataComposite> results = queryRunner.execute();
+ return results;
}
/**
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java
index ce2615c..6c0180b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerLocal.java
@@ -29,6 +29,7 @@ import org.rhq.core.domain.measurement.calltime.CallTimeData;
import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.enterprise.server.common.EntityContext;
/**
* The manager for call-time metric data.
@@ -40,11 +41,14 @@ public interface CallTimeDataManagerLocal {
PageList<CallTimeDataComposite> findCallTimeDataForResource(Subject subject, int scheduleId, long beginTime,
long endTime, PageControl pageControl);;
- PageList<CallTimeDataComposite> findCallTimeDataForCompatibleGroup(Subject subject, int groupId,
- int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl);
+ PageList<CallTimeDataComposite> findCallTimeDataForCompatibleGroup(Subject subject, int groupId, long beginTime,
+ long endTime, PageControl pageControl);
PageList<CallTimeDataComposite> findCallTimeDataForAutoGroup(Subject subject, int parentResourceId,
- int childResourceTypeId, int measurementDefinitionId, long beginTime, long endTime, PageControl pageControl);
+ int childResourceTypeId, long beginTime, long endTime, PageControl pageControl);
+
+ PageList<CallTimeDataComposite> findCallTimeDataForContext(Subject subject, EntityContext context, long beginTime,
+ long endTime, String destination, PageControl pageControl);
int purgeCallTimeData(Date deleteUpToTime) throws SQLException;
commit 635f40e0c8d5320535ae76a3460f6f90a3032b25
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 18:23:12 2010 -0400
enhance CriteriaQueryGenerator for queries with groupBy clauses
* be able to generate count-queries for statements containing groupBy clauses
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 9680e43..459d7d4 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
@@ -281,7 +281,13 @@ public final class CriteriaQueryGenerator {
StringBuilder results = new StringBuilder();
results.append("SELECT ");
if (countQuery) {
- results.append("COUNT(").append(alias).append(")").append(NL);
+ if (groupByClause == null) { // non-grouped method
+ results.append("COUNT(").append(alias).append(")").append(NL);
+ } else {
+ // gets the count of the number of aggregate/grouped rows
+ // NOTE: this only works when the gorupBy is a single element, as opposed to a list of elements
+ results.append("COUNT(DISTINCT ").append(groupByClause).append(")").append(NL);
+ }
} else {
if (projection == null) {
results.append(alias).append(NL);
commit ed2e74b6d29dc707ad401874fdb0a48d386b86a8
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 18:21:29 2010 -0400
BZ-608920 - fix pagination/sorting for event>history
* pagination was failed because empty "details" filter wasn't being interpreted as null
* sorting was broken becauset the native SQL solutio nwas replaced by criteria API, use uses as a different alias scheme
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml
index 65ae270..a6b25a7 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/events/history.xhtml
@@ -105,7 +105,7 @@
<rich:column style="white-space: nowrap;">
<f:facet name="header">
- <onc:sortableColumnHeader sort="ev.severity">
+ <onc:sortableColumnHeader sort="severity">
<h:outputText styleClass="headerText" value="Severity" />
</onc:sortableColumnHeader>
</f:facet>
@@ -121,7 +121,7 @@
<rich:column rendered="#{EventHistoryUIBean.context.resourceId == -1}">
<f:facet name="header">
- <onc:sortableColumnHeader sort="res.name">
+ <onc:sortableColumnHeader sort="resource.name">
<h:outputText styleClass="headerText" value="Resource" />
</onc:sortableColumnHeader>
</f:facet>
@@ -130,7 +130,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="evs.location">
+ <onc:sortableColumnHeader sort="location">
<h:outputText styleClass="headerText" value="Source" />
</onc:sortableColumnHeader>
</f:facet>
@@ -152,7 +152,7 @@
<rich:column>
<f:facet name="header">
- <onc:sortableColumnHeader sort="ev.timestamp">
+ <onc:sortableColumnHeader sort="timestamp">
<h:outputText styleClass="headerText" value="Time occurred" />
</onc:sortableColumnHeader>
</f:facet>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
index ebbe99b..8f89095 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
@@ -373,8 +373,12 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote {
criteria.addFilterStartTime(begin);
criteria.addFilterEndTime(end);
criteria.addFilterSeverities(severities);
- criteria.addFilterSourceName(source);
- criteria.addFilterDetail(detail);
+ if (source != null && !source.trim().equals("")) {
+ criteria.addFilterSourceName(source);
+ }
+ if (detail != null && !detail.trim().equals("")) {
+ criteria.addFilterDetail(detail);
+ }
criteria.setPageControl(pc);
@@ -408,6 +412,9 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote {
"source.resource", subject.getId());
}
+ //log.info(generator.getParameterReplacedQuery(false));
+ //log.info(generator.getParameterReplacedQuery(true));
+
CriteriaQueryRunner<EventComposite> queryRunner = new CriteriaQueryRunner<EventComposite>(criteria, generator,
entityManager);
return queryRunner.execute();
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 8d6e518..9680e43 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
@@ -397,12 +397,7 @@ public final class CriteriaQueryGenerator {
}
// order by clause
- boolean overridden = true;
- PageControl pc = criteria.getPageControlOverrides();
- if (pc == null) {
- overridden = false;
- pc = getPageControl(criteria);
- }
+ PageControl pc = getPageControl(criteria);
boolean first = true;
for (OrderingField orderingField : pc.getOrderingFields()) {
commit be48faf5f78f6f5ba33f3ab63c96a48e156fd6f7
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 18:14:47 2010 -0400
add more trace statements so that future pagination/sorting bugs are easier to discover
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
index ca3f353..0b1614f 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/paging/PagedListDataModel.java
@@ -119,9 +119,11 @@ public abstract class PagedListDataModel<T> extends DataModel {
private PageList<T> getPage() {
// ensure page exists - first time going to this view
if (pageList == null) {
+ log.trace("pageList was null, will get PageControl then load the page");
PageControl pageControl = getPageControl();
PageList<T> results = getDataPage(pageControl);
pageList = results;
+ log.trace("pageList was loaded, found " + (pageList == null ? "null" : pageList.size() + " result items"));
}
return pageList;
@@ -153,14 +155,21 @@ public abstract class PagedListDataModel<T> extends DataModel {
endRow = startRow + nRows - 1;
}
+ if (log.isTraceEnabled()) {
+ log.trace("getRowData(" + currentRowIndex + "): startRow=" + startRow + ", endRow=" + endRow);
+ }
// paging backwards - will we ever get in this if-statement if pageControl.getPageSize == SIZE_UNLIMITED?
if (currentRowIndex < startRow) {
int rowsBack = startRow - currentRowIndex;
int pagesBack = (int) Math.ceil(rowsBack / (double) pageControl.getPageSize());
int newPage = pageControl.getPageNumber() - pagesBack;
+ if (log.isTraceEnabled()) {
+ log.trace("paging down by " + rowsBack + " rows / " + pagesBack + " pages, new page is " + newPage);
+ }
if (newPage < 0) {
newPage = 0;
+ log.trace("newPage was negative, setting page to 0");
}
pageControl.setPageNumber(newPage);
@@ -173,6 +182,9 @@ public abstract class PagedListDataModel<T> extends DataModel {
int rowsForward = currentRowIndex - endRow;
int pagesForward = (int) Math.ceil(rowsForward / (double) pageControl.getPageSize());
int newPage = pageControl.getPageNumber() + pagesForward;
+ if (log.isTraceEnabled()) {
+ log.trace("paging up by " + rowsForward + " rows / " + pagesForward + " pages, new page is " + newPage);
+ }
pageControl.setPageNumber(newPage);
pageList = getDataPage(pageControl);
@@ -187,7 +199,12 @@ public abstract class PagedListDataModel<T> extends DataModel {
* a default PageControl object for this PageControlView
*/
int getIndex = currentRowIndex - startRow;
+ if (log.isTraceEnabled()) {
+ log.trace("currentRowIndex=" + currentRowIndex + ", startRow=" + startRow + ", getIndex=" + getIndex
+ + ", pageListSize=" + pageList.size());
+ }
if (getIndex < 0 || getIndex >= pageList.size()) {
+ log.trace("getIndex is out of pageList's bounds, getting default page control");
// getting the default will repersist the new PageControl too
pageControl = getDefaultPageControl();
pageList = getDataPage(pageControl);
@@ -195,8 +212,16 @@ public abstract class PagedListDataModel<T> extends DataModel {
// pageControl startRow should now be zero
this.currentRowIndex = 0; // and tell the framework to start back at 0
getIndex = 0; // now the getIndex should be 0
+
+ if (log.isTraceEnabled()) {
+ log.trace("currentRowIndex=" + currentRowIndex + ", startRow=" + startRow + ", getIndex=" + getIndex
+ + ", pageListSize=" + pageList.size());
+ }
}
+ if (log.isTraceEnabled() && pageList.get(getIndex) == null) {
+ log.trace("Data item at position " + getIndex + " was null");
+ }
return pageList.get(getIndex);
}
@@ -242,7 +267,11 @@ public abstract class PagedListDataModel<T> extends DataModel {
public PageControl getPageControl() {
WebUser user = EnterpriseFacesContextUtility.getWebUser();
- return getPagedDataTableUIBean().getPageControl(user, pageControlView);
+ PageControl pageControl = getPagedDataTableUIBean().getPageControl(user, pageControlView);
+ if (log.isTraceEnabled()) {
+ log.trace("getPageControl() -->" + pageControl);
+ }
+ return pageControl;
}
public PageControl getDefaultPageControl() {
@@ -251,6 +280,9 @@ public abstract class PagedListDataModel<T> extends DataModel {
}
public void setPageControl(PageControl pageControl) {
+ if (log.isTraceEnabled()) {
+ log.trace("setPageControl(" + pageControl + ")");
+ }
WebUser user = EnterpriseFacesContextUtility.getWebUser();
getPagedDataTableUIBean().setPageControl(user, pageControlView, pageControl);
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
index d2c712e..202084c 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/CriteriaQueryRunner.java
@@ -29,11 +29,17 @@ import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.Query;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.rhq.core.domain.criteria.Criteria;
+import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
public class CriteriaQueryRunner<T> {
+ private static final Log LOG = LogFactory.getLog(CriteriaQueryRunner.class);
+
private Criteria criteria;
private CriteriaQueryGenerator queryGenerator;
private EntityManager entityManager;
@@ -59,13 +65,19 @@ public class CriteriaQueryRunner<T> {
long count = (Long) countQuery.getSingleResult();
List<T> results = query.getResultList();
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("resultSize=" + results.size() + ", count=" + count);
+ }
+
if (autoInitializeBags && (!queryGenerator.getPersistentBagFields().isEmpty())) {
for (T entity : results) {
initPersistentBags(entity);
}
}
- return new PageList<T>(results, (int) count, CriteriaQueryGenerator.getPageControl(criteria));
+ PageControl pageControl = CriteriaQueryGenerator.getPageControl(criteria);
+ PageList<T> pagedResults = new PageList<T>(results, (int) count, pageControl);
+ return pagedResults;
}
public void initPersistentBags(Object entity) {
commit b915bdd6ccedda48d32ac968c774761a1db4b470
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 01:39:03 2010 -0400
elide call-time destination so the data does not overflow horizontal borders
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
index 7ba5f44..d38802c 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/monitor/response.xhtml
@@ -58,7 +58,7 @@
<h:outputText value="Destination" />
</onc:sortableColumnHeader>
</f:facet>
- <h:outputText value="#{item.callDestination}" />
+ <h:outputText value="#{onf:elideString(item.callDestination, 50, 'left')}" title="#{item.callDestination}"/>
</rich:column>
<rich:column>
commit b33f05dc1fa3f3dd403b192ffec6a319799c216b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 01:35:09 2010 -0400
cosmetic - use generics properly to get rid of warning suppression
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
index 5ceec84..ebbe99b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerBean.java
@@ -304,7 +304,6 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote {
return results;
}
- @SuppressWarnings("unchecked")
public EventSeverity[] getSeverityBucketsByContext(Subject subject, EntityContext context, long begin, long end,
int bucketCount) {
@@ -327,7 +326,8 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote {
"source.resource", subject.getId());
}
- CriteriaQueryRunner<Object[]> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager);
+ CriteriaQueryRunner<Object[]> queryRunner = new CriteriaQueryRunner<Object[]>(criteria, generator,
+ entityManager);
PageList<Object[]> flyWeights = queryRunner.execute();
EventSeverity[] buckets = new EventSeverity[bucketCount];
@@ -390,7 +390,6 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote {
return findEventCompositesByCriteria(subject, criteria);
}
- @SuppressWarnings("unchecked")
public PageList<EventComposite> findEventCompositesByCriteria(Subject subject, EventCriteria criteria) {
CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
String replacementSelectList = "" //
@@ -409,7 +408,8 @@ public class EventManagerBean implements EventManagerLocal, EventManagerRemote {
"source.resource", subject.getId());
}
- CriteriaQueryRunner<EventComposite> queryRunner = new CriteriaQueryRunner(criteria, generator, entityManager);
+ CriteriaQueryRunner<EventComposite> queryRunner = new CriteriaQueryRunner<EventComposite>(criteria, generator,
+ entityManager);
return queryRunner.execute();
}
commit e677753f9e98f966b75bf0dccfc4fb9125f0acda
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 01:34:37 2010 -0400
add the ability to give the criteria class author full control over sorting
* if hasCustomizedSorting () returns true, CriteriaQueryGenenerator will not prepend auto-generated entity alias to sort fields
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
index c08aa5d..d4e3fcb 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/Criteria.java
@@ -122,6 +122,16 @@ public abstract class Criteria implements Serializable {
this.pageControlOverrides = pageControl;
}
+ /*
+ * By default, the ordering fields are automatically prepend with the alias of entity that this criteria object
+ * wraps. However, some authors of criteria objects want full control of this alias during sort operations. if
+ * this method returns true, then the alias will not be prepend to the generated "order by" clause, which makes
+ * author responsible for constructing the fully-qualified ordering token for each sort override.
+ */
+ public boolean hasCustomizedSorting() {
+ return false;
+ }
+
public void clearPaging() {
PageControl unlimited = PageControl.getUnlimitedInstance();
this.pageNumber = unlimited.getPageNumber();
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 cb10f56..8d6e518 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
@@ -417,9 +417,14 @@ public final class CriteriaQueryGenerator {
String override = criteria.getJPQLSortOverride(fieldName);
String suffix = (override == null) ? fieldName : override;
- // if the suffix is numerical, do not prefix the alias
- // this allows us to sort by column ordinal, which is required for availability on the group browser
- String sortFragment = (isNumber(suffix)) ? suffix : (alias + "." + suffix);
+ /*
+ * do not prefix the alias when:
+ *
+ * 1) if the suffix is numerical, which allows usto sort by column ordinal
+ * 2) if the user wants full control and has explicitly chosen to disable alias prepending
+ */
+ boolean doNotPrefixAlias = isNumber(suffix) || criteria.hasCustomizedSorting();
+ String sortFragment = doNotPrefixAlias ? suffix : (alias + "." + suffix);
PageOrdering ordering = orderingField.getOrdering();
commit d57176a120c5089d00e9b97a7d5eb88453e76912
Author: Joseph Marques <joseph(a)redhat.com>
Date: Mon Jun 28 01:33:16 2010 -0400
criteria objects should use numeric wrappers not basic types
* using numberic wrappers allows users to unset the item by passing null.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java
index 9912c1c..f7dbb6a 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/EventCriteria.java
@@ -27,6 +27,7 @@ import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
import org.rhq.core.domain.event.Event;
import org.rhq.core.domain.event.EventSeverity;
@@ -35,6 +36,7 @@ import org.rhq.core.domain.util.PageOrdering;
/**
* @author Joseph Marques
*/
+@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@SuppressWarnings("unused")
public class EventCriteria extends Criteria {
@@ -96,11 +98,11 @@ public class EventCriteria extends Criteria {
this.filterSourceName = filterSourceName;
}
- public void addFilterStartTime(long filterStartTime) {
+ public void addFilterStartTime(Long filterStartTime) {
this.filterStartTime = filterStartTime;
}
- public void addFilterEndTime(long filterEndTime) {
+ public void addFilterEndTime(Long filterEndTime) {
this.filterEndTime = filterEndTime;
}
13 years, 10 months
[rhq] Branch 'release-3.0.0' - 2 commits - modules/enterprise release.sh
by Jay Shaughnessy
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp | 242 +++++-----
release.sh | 74 +--
2 files changed, 163 insertions(+), 153 deletions(-)
New commits:
commit 1e10fbe07f2d55aa118baffbaec4e02127983ff5
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jun 29 16:33:27 2010 -0400
Work to perform rhq tag release script in its own branch
diff --git a/release.sh b/release.sh
index 2722eda..c4b9e46 100755
--- a/release.sh
+++ b/release.sh
@@ -286,7 +286,6 @@ cat <<EOF >"${MAVEN_SETTINGS_FILE}"
</settings>
EOF
-
# Clone and/or checkout the source from git.
if [ -d "$WORKING_DIR" ]; then
@@ -328,15 +327,42 @@ if [ ! -d "$WORKING_DIR" ]; then
fi
-# If the specified tag already exists remotely and we're in production mode, then abort. If it exists and we're in test mode, then we'll delete it after we've had a successful dry run of release:prepare and are ready to tag.
+# If the specified tag already exists then abort. It should not exist since production runs should have
+# unique tags and test runs should have been done in a temporary branch
EXISTING_REMOTE_TAG=`git ls-remote --tags origin "$RELEASE_TAG"`
-if [ -n "$EXISTING_REMOTE_TAG" ] && [ "$MODE" = "production" ]; then
- abort "A remote tag named $RELEASE_TAG already exists - aborting, since we are in production mode..."
+if [ -n "$EXISTING_REMOTE_TAG" ]; then
+ abort "A remote tag named $RELEASE_TAG already exists - aborting, perhaps a bad build configuration..."
fi
-# Run a test build before tagging. This will also publish the snapshot artifacts to the local repo to "bootstrap" the repo.
+# if this is a test build then create a temporary build branch off of RELEASE_BRANCH. This allows checkins to
+# continue in RELEASE_BRANCH without affecting the release plugin work, which will fail if the branch contents
+# change before it completes.
+if [ "$MODE" = "production" ]; then
+ BUILD_BRANCH="${RELEASE_BRANCH}"
+else
+ BUILD_BRANCH="${RELEASE_BRANCH}-test-build"
+# delete the branch if it exists, so we can recreate it fresh
+ EXISTING_BUILD_BRANCH=`git ls-remote --heads origin "$BUILD_BRANCH"`
+ if [ "$EXISTING_REMOTE_TAG" ]; then
+ echo "Deleting remote branch origin/$BUILD_BRANCH"
+ git branch -D -r "origin/$BUILD_BRANCH"
+ echo "Deleting local branch $BUILD_BRANCH"
+ git branch -D "$BUILD_BRANCH"
+ fi
+ echo "Creating and checking out local branch $BUILD_BRANCH from $RELEASE_BRANCH"
+ git checkout -b "$BUILD_BRANCH"
+ echo "Creating remote branch $BUILD_BRANCH"
+ git push origin "$BUILD_BRANCH"
+fi
+
+
+# We should now have the build_branch checked out
+echo "Current Branch is $BUILD_BRANCH"
+
+
+# Run a test build before tagging. This will publish the snapshot artifacts to the local repo to "bootstrap" the repo.
echo "Building project to ensure tests pass and to bootstrap local Maven repo (this will take about 15-30 minutes)..."
# NOTE: There is no need to do a mvn clean below, since we just did either a clone or clean checkout above.
@@ -347,42 +373,26 @@ echo "Test build succeeded!"
# Clean up the snapshot jars produced by the test build from module target dirs.
-
echo "Cleaning up snapshot jars produced by test build from module target dirs..."
mvn clean $MAVEN_ARGS
[ "$?" -ne 0 ] && abort "Failed to cleanup snbapshot jars produced by test build from module target dirs. Please see above Maven output for details, fix any issues, then try again."
-# Do a dry run of tagging the release.
+# If this is a production build perform a dry run of tagging the release. Skip this for test builds to reduce the
+# build time
-echo "Doing a dry run of tagging the release..."
-mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true
-[ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again."
-mvn release:clean $MAVEN_ARGS
-[ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again."
-echo
-echo "Tagging dry run succeeded!"
-
-
-# If there's an existing remote tag, and we didn't abort earlier, we must be in test mode, so we can safely delete it before we call mvn release:prepare to recreate it.
-
-if [ -n "$EXISTING_REMOTE_TAG" ]; then
- echo "A remote tag named $RELEASE_TAG already exists - deleting it, since we are in test mode..."
- git push origin ":refs/tags/$RELEASE_TAG"
- [ "$?" -ne 0 ] && abort "Failed to delete remote tag ($RELEASE_TAG)."
-fi
-
-
-# See if the specified tag already exists locally - if so, delete it (even if in production mode).
-EXISTING_LOCAL_TAG=`git tag -l "$RELEASE_TAG"`
-if [ -n "$EXISTING_LOCAL_TAG" ]; then
- echo "A local tag named $RELEASE_TAG already exists - deleting it..."
- git tag -d "$RELEASE_TAG"
- [ "$?" -ne 0 ] && abort "Failed to delete local tag ($RELEASE_TAG)."
+if [ "$MODE" = "production" ]; then
+ echo "Doing a dry run of tagging the release..."
+ mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=true
+ [ "$?" -ne 0 ] && abort "Tagging dry run failed. Please see above Maven output for details, fix any issues, then try again."
+ mvn release:clean $MAVEN_ARGS
+ [ "$?" -ne 0 ] && abort "Failed to cleanup release plugin working files from tagging dry run. Please see above Maven output for details, fix any issues, then try again."
+ echo
+ echo "Tagging dry run succeeded!"
fi
-# If the dry run succeeded, tag it for real.
+# If the dry run was skipped or succeeded, tag it for real.
echo "Tagging the release..."
mvn release:prepare $MAVEN_ARGS -DreleaseVersion=$RELEASE_VERSION -DdevelopmentVersion=$DEVELOPMENT_VERSION -Dresume=false -Dtag=$RELEASE_TAG "-DpreparationGoals=install $MAVEN_ARGS -Dmaven.test.skip=true -Ddbsetup-do-not-check-schema=true" -DdryRun=false -Dusername=$GIT_USERNAME
commit 436507fb74a475f4c1161becf06c5331c7ae9fbf
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Tue Jun 29 16:50:31 2010 -0400
LT commit
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 7b91970..2c8a8a2 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
@@ -1,121 +1,121 @@
-<%@ page language="java" %>
-<%@ page errorPage="/common/Error.jsp" %>
-
-<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
-<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
-<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
-<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
-
-<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script>
-<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css">
-
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="MINUTES_LABEL" var="CONST_MINUTES" />
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="HOURS_LABEL" var="CONST_HOURS" />
-<hq:constant
- classname="org.rhq.enterprise.gui.legacy.Constants"
- symbol="DAYS_LABEL" var="CONST_DAYS" />
-
-<!-- BASE SERVER CONFIG TITLE -->
-<tiles:insert definition=".header.tab">
- <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/>
-</tiles:insert>
-<!-- / -->
-
-<!-- BASE SERVER CONFIG CONTENTS -->
-<table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td>
- <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td>
- <td class="BlockContent">
- <table width="100%" cellpadding="0" cellspacing="0" border="0">
- <tr>
-<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
- <td class="ErrorField">
- <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
- </td>
- <td class="ErrorField" width="100%">
- <html:select property="agentMaxQuietTimeAllowed">
- <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
- </html:select>
- </td>
-</logic:messagesPresent>
-<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
- <td class="BlockContent">
- <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
- </td>
- <td class="BlockContent" width="100%">
- <html:select property="agentMaxQuietTimeAllowed">
- <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
- </html:select>
- </td>
-</logic:messagesNotPresent>
- </tr>
-<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
- <tr>
- <td class="ErrorField" colspan="2">
- <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span>
- </td>
- </tr>
-</logic:messagesPresent>
-<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
- <tr>
- <td class="BlockContent" colspan="2">
- </td>
- </tr>
-</logic:messagesNotPresent>
- </table>
- </td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4" border="0">
- <tr>
- <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td>
- <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-
-<hq:authorization permission="superuser">
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4" border="0">
- <tr>
- <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td>
- <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-</hq:authorization>
-
-<fmt:message var="productName" key="product.shortName" />
-<c:if test="${productName eq 'RHQ'}">
-<hq:authorization permission="superuser">
- <tr>
- <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
- <td class="BlockContent">
- <table cellpadding="0" cellspacing="4" border="0">
- <tr>
- <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td>
- <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td>
- </tr>
- </table>
- </td>
- </tr>
-</hq:authorization>
-</c:if>
-
-</table>
+<%@ page language="java" %>
+<%@ page errorPage="/common/Error.jsp" %>
+
+<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-html-el" prefix="html" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
+
+<script src="<html:rewrite page="/js/"/>functions.js" type="text/javascript"></script>
+<link rel=stylesheet href="<html:rewrite page="/css/"/>win.css" type="text/css">
+
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="MINUTES_LABEL" var="CONST_MINUTES" />
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="HOURS_LABEL" var="CONST_HOURS" />
+<hq:constant
+ classname="org.rhq.enterprise.gui.legacy.Constants"
+ symbol="DAYS_LABEL" var="CONST_DAYS" />
+
+<!-- BASE SERVER CONFIG TITLE -->
+<tiles:insert definition=".header.tab">
+ <tiles:put name="tabKey" value="admin.settings.BaseConfigTab"/>
+</tiles:insert>
+<!-- / -->
+
+<!-- BASE SERVER CONFIG CONTENTS -->
+<table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td width="45%" class="BlockLabel"><fmt:message key="admin.settings.BaseURL"/></td>
+ <td width="55%" class="BlockContent"><html:text size="31" property="baseUrl" /></td>
+ </tr>
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.AgentMaxQuietTimeAllowed"/></td>
+ <td class="BlockContent">
+ <table width="100%" cellpadding="0" cellspacing="0" border="0">
+ <tr>
+<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
+ <td class="ErrorField">
+ <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
+ </td>
+ <td class="ErrorField" width="100%">
+ <html:select property="agentMaxQuietTimeAllowed">
+ <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
+ </html:select>
+ </td>
+</logic:messagesPresent>
+<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
+ <td class="BlockContent">
+ <html:text size="2" property="agentMaxQuietTimeAllowedVal" />
+ </td>
+ <td class="BlockContent" width="100%">
+ <html:select property="agentMaxQuietTimeAllowed">
+ <html:option value="${CONST_MINUTES}"><fmt:message key="admin.settings.Minutes"/></html:option>
+ </html:select>
+ </td>
+</logic:messagesNotPresent>
+ </tr>
+<logic:messagesPresent property="agentMaxQuietTimeAllowedVal">
+ <tr>
+ <td class="ErrorField" colspan="2">
+ <span class="ErrorFieldContent"> <html:errors property="agentMaxQuietTimeAllowedVal"/></span>
+ </td>
+ </tr>
+</logic:messagesPresent>
+<logic:messagesNotPresent property="agentMaxQuietTimeAllowedVal">
+ <tr>
+ <td class="BlockContent" colspan="2">
+ </td>
+ </tr>
+</logic:messagesNotPresent>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableAgentAutoUpdate"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableAgentAutoUpdate" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableAgentAutoUpdate" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+
+<hq:authorization permission="superuser">
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableDebugMode"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableDebugMode" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableDebugMode" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</hq:authorization>
+
+<fmt:message var="productName" key="product.shortName" />
+<c:if test="${productName eq 'RHQ'}">
+<hq:authorization permission="superuser">
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</hq:authorization>
+</c:if>
+
+</table>
13 years, 10 months
[rhq] Branch 'release-3.0.0' - modules/enterprise
by Joseph Marques
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java | 8 ++++++--
modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
New commits:
commit db911f971bb286fe600c4257b85f917bb3227004
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 15:33:19 2010 -0400
BZ-607898: fix for sending alert notifications with multiple direct email addresses
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java
index 02183f6..5a958b1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/alert/AlertSender.java
@@ -118,9 +118,13 @@ public abstract class AlertSender<T extends ServerPluginComponent> {
* where '|' delimits all elements as well as wraps
* the entire expression.
*/
- @SuppressWarnings("unchecked")
public static <T> List<T> unfence(String fencedData, Class<T> type) {
- String[] elements = fencedData.split("\\|");
+ return unfence(fencedData, type, "\\|");
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> List<T> unfence(String fencedData, Class<T> type, String delimiter) {
+ String[] elements = fencedData.split(delimiter);
List<T> results = new ArrayList<T>(elements.length);
if (Integer.class.equals(type)) {
diff --git a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java
index 773d99a..81b1383 100644
--- a/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java
+++ b/modules/enterprise/server/plugins/alert-email/src/main/java/org/rhq/enterprise/server/plugins/alertEmail/EmailSender.java
@@ -40,7 +40,7 @@ public class EmailSender extends AlertSender {
return new SenderResult(ResultState.FAILURE, "No email address given");
}
- List<String> emails = AlertSender.unfence(emailAddressString, String.class);
+ List<String> emails = AlertSender.unfence(emailAddressString, String.class, ",");
return new SenderResult(ResultState.DEFERRED_EMAIL, "Sending to addresses: " + emails, emails);
}
13 years, 10 months
[rhq] Branch 'release-3.0.0' - modules/enterprise
by Joseph Marques
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit 23886a27cb17cf2ab0f707ea37c3a2bba2778b91
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 15:12:56 2010 -0400
only display the "experiemtnal features" toggle for community distributions/builds
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 068b230..7b91970 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
@@ -101,6 +101,8 @@
</tr>
</hq:authorization>
+<fmt:message var="productName" key="product.shortName" />
+<c:if test="${productName eq 'RHQ'}">
<hq:authorization permission="superuser">
<tr>
<td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
@@ -114,5 +116,6 @@
</td>
</tr>
</hq:authorization>
+</c:if>
</table>
13 years, 10 months
[rhq] Branch 'release-3.0.0' - 2 commits - modules/core
by Heiko W. Rupp
modules/core/dbutils/pom.xml | 12 -
modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml | 10
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 110 +++++-----
3 files changed, 74 insertions(+), 58 deletions(-)
New commits:
commit ec2e38d1704d1eafd6b3349acfe66f10aff322d7
Merge: 1d53a6b... 533337f...
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 29 20:24:15 2010 +0200
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit 1d53a6b65e5d51456c57728c9d07bb36093df7b0
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Jun 29 20:23:00 2010 +0200
BZ 560803 add index on measurement_def.numeric_type
BZ 535686 add index on call time value.end_time to speed up purges
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index 92ae1d2..d536ce6 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.87</db.schema.version>
+ <db.schema.version>2.88</db.schema.version>
</properties>
<dependencies>
@@ -95,9 +95,9 @@
db = project.properties.db
if (db == 'dev') {
- database = project.properties['rhq.dev.ds.db-name']
- }
- // This is a bit of a temporary hack to work around
+ database = project.properties['rhq.dev.ds.db-name']
+ }
+ // This is a bit of a temporary hack to work around
// https://cvs.codehaus.org/browse/GMAVEN-46 which results in
// groovy scripts not being able to get the correct values of
// build properties that are overridden on the command line.
@@ -105,7 +105,7 @@
// trying to use a database named rhqupgrade.
else if (project.properties['upgrade.db']) {
database = 'rhqupgrade'
- }
+ }
else {
database = project.properties['rhq.test.ds.db-name']
}
@@ -275,7 +275,7 @@
<goal>run</goal>
</goals>
</execution>
-
+
<execution>
<!--
This execution will abort the build if the database schema is not up to date.
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
index 38c759c..8108cb9 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/measurement-schema.xml
@@ -34,6 +34,9 @@
<field ref="NAME"/>
<field ref="RAW_NUMERIC_TYPE"/>
</index>
+ <index name="RHQ_METRIC_DEF_NT_IDX">
+ <field ref="NUMERIC_TYPE"/>
+ </index>
</table>
@@ -86,7 +89,7 @@
<field ref="TIME_STAMP"/>
</primaryKey>
</constraint>
-
+
<index name="RHQ_MEAS_DATA_1H_TIME_IDX">
<field ref="TIME_STAMP"/>
</index>
@@ -108,7 +111,7 @@
<field ref="TIME_STAMP"/>
</primaryKey>
</constraint>
-
+
<index name="RHQ_MEAS_DATA_6H_TIME_IDX">
<field ref="TIME_STAMP"/>
</index>
@@ -166,6 +169,9 @@
<column name="MAXIMUM" type="DOUBLE" required="true"/>
<column name="TOTAL" type="DOUBLE" required="true"/>
<column name="COUNT" type="LONG" required="true"/>
+ <index name="RHQ_CT_DA_VA_END_TIM_IDX">
+ <field ref="END_TIME"/>
+ </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 1d3bd04..daf68f4 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -17,13 +17,13 @@
Update Version: ${target.schema.version}
</echo>
- <dbupgrade jdbcUrl="${jdbc.url}"
- jdbcUser="${jdbc.user}"
- jdbcPassword="${jdbc.password}"
+ <dbupgrade jdbcUrl="${jdbc.url}"
+ jdbcUser="${jdbc.user}"
+ jdbcPassword="${jdbc.password}"
valueColumn="PROPERTY_VALUE"
- table="RHQ_SYSTEM_CONFIG"
- keyColumn="PROPERTY_KEY"
- keyMatch="DB_SCHEMA_VERSION"
+ table="RHQ_SYSTEM_CONFIG"
+ keyColumn="PROPERTY_KEY"
+ keyMatch="DB_SCHEMA_VERSION"
targetSchemaVersion="${target.schema.version}">
<schemaSpec version="2.0">
@@ -31,7 +31,7 @@
</schemaSpec>
<schemaSpec version="2.1">
- <!-- Keep the columnType VARCHAR2, but increase size;
+ <!-- Keep the columnType VARCHAR2, but increase size;
(see note for RHQ_ALERT_CONDITION table in alert-schema.xml for more ifo) -->
<schema-alterColumn table="RHQ_ALERT_CONDITION" column="OPTION_STATUS" columnType="VARCHAR2" precision="256" />
</schemaSpec>
@@ -1805,7 +1805,7 @@
</schemaSpec>
<schemaSpec version="2.61">
- <schema-createSequence name="RHQ_DISTRIBUTION_TYPE_ID_SEQ" initial="10001" />
+ <schema-createSequence name="RHQ_DISTRIBUTION_TYPE_ID_SEQ" initial="10001" />
<schema-directSQL>
<statement>
CREATE TABLE RHQ_DISTRIBUTION_TYPE ( ID INTEGER PRIMARY KEY )
@@ -1829,12 +1829,12 @@
</schema-directSQL>
<schema-createSequence name="RHQ_DISTRIBUTION_ID_SEQ" initial="10001" />
- <schema-directSQL>
+ <schema-directSQL>
<statement desc="Creating table RHQ_DISTRIBUTION">
CREATE TABLE RHQ_DISTRIBUTION ( ID INTEGER PRIMARY KEY )
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_DISTRIBUTION" column="ID" nullable="false" />
+ <schema-alterColumn table="RHQ_DISTRIBUTION" column="ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION" column="DISTRIBUTION_TYPE_ID" columnType="INTEGER" />
<schema-alterColumn table="RHQ_DISTRIBUTION" column="DISTRIBUTION_TYPE_ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION" column="LABEL" precision="64" columnType="VARCHAR2" />
@@ -1897,7 +1897,7 @@
</schemaSpec>
<schemaSpec version="2.63">
- <schema-addColumn table="RHQ_REPO" column="IS_CANDIDATE" columnType="BOOLEAN" />
+ <schema-addColumn table="RHQ_REPO" column="IS_CANDIDATE" columnType="BOOLEAN" />
<schema-directSQL>
<statement targetDBVendor="postgresql">
@@ -1907,7 +1907,7 @@
UPDATE RHQ_REPO SET IS_CANDIDATE = 0
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_REPO" column="IS_CANDIDATE" nullable="false" />
+ <schema-alterColumn table="RHQ_REPO" column="IS_CANDIDATE" nullable="false" />
</schemaSpec>
<!-- Generic tagging support -->
@@ -1932,7 +1932,7 @@
CREATE TABLE RHQ_DISTRIBUTION_FILE (ID INTEGER PRIMARY KEY)
</statement>
</schema-directSQL>
- <schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="ID" nullable="false" />
+ <schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION_FILE" column="DISTRIBUTION_ID" columnType="INTEGER" />
<schema-alterColumn table="RHQ_DISTRIBUTION_FILE" column="DISTRIBUTION_ID" nullable="false" />
<schema-addColumn table="RHQ_DISTRIBUTION_FILE" column="RELATIVE_FILENAME" precision="256" columnType="VARCHAR2" />
@@ -2358,8 +2358,8 @@
</statement>
<statement desc="Creating RHQ_BUNDLE_TYPE unique constraint">
CREATE UNIQUE INDEX RHQ_BUNDLE_TYPE_UNIQUE ON RHQ_BUNDLE_TYPE (name)
- </statement>
- </schema-directSQL>
+ </statement>
+ </schema-directSQL>
<!-- RHQ_BUNDLE -->
<schema-createSequence name="RHQ_BUNDLE_ID_SEQ" initial="10001" />
@@ -2396,12 +2396,12 @@
ADD CONSTRAINT RHQ_B_PACKAGE_TYPE_ID_FK
FOREIGN KEY (PACKAGE_TYPE_ID)
REFERENCES RHQ_PACKAGE_TYPE (ID)
- </statement>
+ </statement>
<statement desc="Creating RHQ_BUNDLE unique constraint">
CREATE UNIQUE INDEX RHQ_BUNDLE_UNIQUE ON RHQ_BUNDLE (bundle_type_id, name)
- </statement>
+ </statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_VERSION -->
<schema-createSequence name="RHQ_BUNDLE_VERSION_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2439,7 +2439,7 @@
CREATE UNIQUE INDEX RHQ_BUNDLE_VERSION_UNIQUE ON RHQ_BUNDLE_VERSION (bundle_id, name, version)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_VERSION_REPO -->
<schema-directSQL>
<statement desc="Creating table RHQ_BUNDLE_VERSION_REPO">
@@ -2466,7 +2466,7 @@
REFERENCES RHQ_REPO (ID)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_FILE -->
<schema-createSequence name="RHQ_BUNDLE_FILE_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2479,7 +2479,7 @@
<schema-alterColumn table="RHQ_BUNDLE_FILE" column="BUNDLE_VERSION_ID" nullable="FALSE" />
<schema-addColumn table="RHQ_BUNDLE_FILE" column="PACKAGE_VERSION_ID" columnType="INTEGER" />
<schema-alterColumn table="RHQ_BUNDLE_FILE" column="PACKAGE_VERSION_ID" nullable="FALSE" />
-
+
<schema-directSQL>
<statement desc="Creating RHQ_BUNDLE_FILE foreign key relation to RHQ_BUNDLE_VERSION">
ALTER TABLE RHQ_BUNDLE_FILE
@@ -2494,7 +2494,7 @@
REFERENCES RHQ_PACKAGE_VERSION (ID)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_DESTINATION -->
<schema-createSequence name="RHQ_BUNDLE_DESTINATION_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2513,9 +2513,9 @@
<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-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-alterColumn table="RHQ_BUNDLE_DESTINATION" column="DEPLOY_DIR" nullable="FALSE" />
<schema-directSQL>
<statement desc="Creating RHQ_BUNDLE_DESTINATION foreign key relation to RHQ_BUNDLE">
@@ -2535,7 +2535,7 @@
ON RHQ_BUNDLE_DESTINATION (bundle_id, group_id, deploy_dir)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_DEPLOYMENT -->
<schema-createSequence name="RHQ_BUNDLE_DEPLOYMENT_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2561,8 +2561,8 @@
<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-addColumn table="RHQ_BUNDLE_DEPLOYMENT" column="REPLACED_BUNDLE_DEPLOYMENT_ID" columnType="INTEGER" />
+ <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">
@@ -2576,7 +2576,7 @@
ADD CONSTRAINT RHQ_BD_B_DESTINATION_ID_FK
FOREIGN KEY (BUNDLE_DESTINATION_ID)
REFERENCES RHQ_BUNDLE_DESTINATION (ID)
- </statement>
+ </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
@@ -2588,9 +2588,9 @@
ADD CONSTRAINT RHQ_BD_B_DEPLOYMENT_ID_FK
FOREIGN KEY (REPLACED_BUNDLE_DEPLOYMENT_ID)
REFERENCES RHQ_BUNDLE_DEPLOYMENT (ID)
- </statement>
- </schema-directSQL>
-
+ </statement>
+ </schema-directSQL>
+
<!-- RHQ_BUNDLE_RES_DEPLOY -->
<schema-createSequence name="RHQ_BUNDLE_RES_DEPLOY_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2622,11 +2622,11 @@
REFERENCES RHQ_RESOURCE (ID)
</statement>
<statement desc="Creating RHQ_BUNDLE_RES_DEPLOY unique constraint on def-resource mapping">
- CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX
+ CREATE UNIQUE INDEX RHQ_BUNDLE_RES_DEPLOY_MAP_IX
ON RHQ_BUNDLE_RES_DEPLOY (BUNDLE_DEPLOYMENT_ID, RESOURCE_ID)
</statement>
</schema-directSQL>
-
+
<!-- RHQ_BUNDLE_RES_DEP_HIST -->
<schema-createSequence name="RHQ_BUNDLE_RES_DEP_HIST_ID_SEQ" initial="10001" />
<schema-directSQL>
@@ -2644,7 +2644,7 @@
<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-addColumn table="RHQ_BUNDLE_RES_DEP_HIST" column="CATEGORY" columnType="VARCHAR2" precision="32" />
<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" />
@@ -2656,7 +2656,7 @@
FOREIGN KEY (BUNDLE_RES_DEPLOY_ID)
REFERENCES RHQ_BUNDLE_RES_DEPLOY (ID)
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
<schemaSpec version="2.79">
@@ -2683,11 +2683,11 @@
ALTER TABLE RHQ_PACKAGE_BITS DROP COLUMN BITS
</statement>
<statement desc="Change bytea column to oid in postgres.">
- ALTER TABLE RHQ_PACKAGE_BITS RENAME COLUMN NEWOID TO BITS
+ ALTER TABLE RHQ_PACKAGE_BITS RENAME COLUMN NEWOID TO BITS
</statement>
</schema-directSQL>
</schemaSpec>
-
+
<schemaSpec version="2.82">
<schema-directSQL>
<statement desc="Creating table RHQ_SAVED_SEARCH">
@@ -2744,8 +2744,8 @@
CREATE TABLE RHQ_SUBJECT_ROLE_LDAP_MAP ( SUBJECT_ID INTEGER, ROLE_ID INTEGER )
</statement>
<statement desc="Creating composite PK for RHQ_SUBJECT_ROLE_LDAP_MAP">
- ALTER TABLE RHQ_SUBJECT_ROLE_LDAP_MAP
- ADD CONSTRAINT RHQ_SUBJECT_ROLE_LDAP_MAP_PK
+ ALTER TABLE RHQ_SUBJECT_ROLE_LDAP_MAP
+ ADD CONSTRAINT RHQ_SUBJECT_ROLE_LDAP_MAP_PK
PRIMARY KEY ( SUBJECT_ID, ROLE_ID )
</statement>
<statement desc="Creating FK relation to RHQ_SUBJECT table for SUBJECT_ID column">
@@ -2763,7 +2763,7 @@
</schema-directSQL>
<schema-alterColumn table="RHQ_SUBJECT_ROLE_LDAP_MAP" column="SUBJECT_ID" nullable="FALSE" />
<schema-alterColumn table="RHQ_SUBJECT_ROLE_LDAP_MAP" column="ROLE_ID" nullable="FALSE" />
-
+
<!-- Fixing ldap group authz by adding remaining mapping elements left out(RHQ_ROLE_LDAP_GROUP) -->
<!-- RHQ_ROLE_LDAP_GROUP -->
<schema-createSequence name="RHQ_ROLE_LDAP_GROUP_ID_SEQ" initial="10001" />
@@ -2771,11 +2771,11 @@
<statement desc="Creating table RHQ_ROLE_LDAP_GROUP">
CREATE TABLE RHQ_ROLE_LDAP_GROUP ( ID INTEGER PRIMARY KEY, ROLE_ID INTEGER )
</statement>
- </schema-directSQL>
+ </schema-directSQL>
<schema-alterColumn table="RHQ_ROLE_LDAP_GROUP" column="ID" nullable="FALSE" />
<schema-alterColumn table="RHQ_ROLE_LDAP_GROUP" column="ROLE_ID" nullable="FALSE" />
<schema-addColumn table="RHQ_ROLE_LDAP_GROUP" column="LDAP_GROUP_NAME" columnType="VARCHAR2" precision="128" />
-
+
<schema-directSQL>
<statement>
ALTER TABLE RHQ_ROLE_LDAP_GROUP
@@ -2787,7 +2787,7 @@
CREATE UNIQUE INDEX RHQ_ROLE_LDAP_GROUP_IDX
ON RHQ_ROLE_LDAP_GROUP ( LDAP_GROUP_NAME, ROLE_ID )
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
<!-- Remove the old tagging system -->
@@ -2949,7 +2949,7 @@
REFERENCES RHQ_TAGGING ( ID )
</statement>
</schema-directSQL>
-
+
<schema-directSQL>
<statement>
CREATE TABLE RHQ_TAGGING_BUNDLE_DEST_MAP ( BUNDLE_DESTINATION_ID INTEGER )
@@ -2976,9 +2976,9 @@
FOREIGN KEY ( TAG_ID )
REFERENCES RHQ_TAGGING ( ID )
</statement>
- </schema-directSQL>
+ </schema-directSQL>
</schemaSpec>
-
+
<schemaSpec version="2.86">
<schema-directSQL>
<statement desc="Adding MANAGE_BUNDLE permission to overlord">
@@ -2989,18 +2989,28 @@
</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">
+ </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.88">
+ <schema-directSQL>
+ <statement desc="Add end time index on call time data to speed up purges">
+ CREATE INDEX RHQ_CT_DA_VA_END_TIM_IDX ON RHQ_CALLTIME_DATA_VALUE (end_time)
+ </statement>
+ <statement desc="Add index on measurement definition numeric type">
+ CREATE INDEX RHQ_METRIC_DEF_NT_IDX ON RHQ_MEASUREMENT_DEF (numeric_type)
+ </statement>
+ </schema-directSQL>
+ </schemaSpec>
</dbupgrade>
</target>
</project>
13 years, 10 months
[rhq] Branch 'release-3.0.0' - 2 commits - modules/enterprise
by ips
modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml | 2 +-
modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 533337f5538f8fea1d09cf2abf4c458106c306c3
Merge: b2bd54e... 344be2f...
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jun 29 13:57:58 2010 -0400
Merge branch 'release-3.0.0' of ssh://git.fedorahosted.org/git/rhq/rhq into release-3.0.0
commit b2bd54e4a6ac3475cc66a65ae3e4088d7ee28be3
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Tue Jun 29 13:55:12 2010 -0400
fix so vertical scrolling works correctly for content within RichFaces tabPanels on Resource Configuration > Current tab and Admin > Plugins pages when on IE 6/7 (https://bugzilla.redhat.com/show_bug.cgi?id=601744)
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
index aa9f90d..7629fd7 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/entity/layout/main.xhtml
@@ -49,7 +49,7 @@ id - the id of the Resource being accessed
</div>
</div>
<div id="centerContent" class="column" style="width: #{100 - UserPreferencesUIBean.leftResourceNavState}%;">
- <div id="centerContentWrapper" class="content-right">
+ <div id="centerContentWrapper" class="content-right" style="position: relative">
<div style="left: 0; right: 0; height: 100%;">
<ui:insert name="summary"><p>Default Entity Summary</p></ui:insert>
<ui:insert name="tabBar"><p>Default Entity TabBar</p></ui:insert>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
index 00666c1..5031f75 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/layout/main.xhtml
@@ -15,7 +15,7 @@
<ui:composition template="/rhq/layout/main-layout.xhtml">
<ui:define name="body-area">
- <div id="content-full" style="width: 100%; height: 100%; overflow: auto;">
+ <div id="content-full" style="width: 100%; height: 100%; overflow: auto; position: relative">
<h:panelGroup id="Breadcrumb" layout="block" rendered="#{empty disableBreadcrumbs}">
<ui:insert name="breadcrumbs">Default Full Screen Breadcrumbs</ui:insert>
</h:panelGroup>
13 years, 10 months
[rhq] Branch 'release-3.0.0' - 2 commits - modules/enterprise
by Joseph Marques
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java | 23 ++++++++++
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java | 9 +++
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java | 21 ++++++---
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java | 3 -
modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties | 1
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp | 14 ++++++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml | 4 +
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml | 4 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java | 6 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java | 23 ++++++++--
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java | 4 +
11 files changed, 96 insertions(+), 16 deletions(-)
New commits:
commit 344be2ff459e13af30832c48d201ac7714fe229b
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 13:47:21 2010 -0400
BZ-609158: hide "alerting on call-time data" and "group-wise call-time data view" behind the "experimental feature" conditional rendering feature
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java
index ccf46dd..81648a2 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/alerts/config/DefinitionFormPrepareAction.java
@@ -131,7 +131,8 @@ public abstract class DefinitionFormPrepareAction extends TilesAction {
if (defForm.getTraits().size() > 0 && triggerNotSet)
defForm.getCondition(0).setTrigger("onTrait");
- request.setAttribute("showCalltimeMetrics", defForm.getCalltimeMetrics().size() > 0);
+ boolean isExperimental = LookupUtil.getSystemManager().isExperimentalFeaturesEnabled();
+ request.setAttribute("showCalltimeMetrics", isExperimental && defForm.getCalltimeMetrics().size() > 0);
if (defForm.getCalltimeMetrics().size() > 0 && triggerNotSet)
defForm.getCondition(0).setTrigger("onCallTime");
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
index 5a01f31..13d1786 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/autogroup/layout/main.xhtml
@@ -81,7 +81,9 @@ THIS TEXT WILL BE REMOVED AS WELL.
<onc:subtab name="Graphs" url="/rhq/autogroup/monitor/graphs.xhtml" />
<onc:subtab name="Tables" url="/rhq/autogroup/monitor/tables.xhtml" />
<onc:subtab name="Schedules" url="/rhq/autogroup/monitor/schedules.xhtml" />
- <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" />
+ <c:if test="#{GlobalPermissionsUIBean.experimental}">
+ <onc:subtab name="Response" url="/rhq/autogroup/monitor/response.xhtml" />
+ </c:if>
</onc:tab>
<onc:tab name="Events" image="/images/icons/Events_grey_16.png">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
index ac806e8..08b9d77 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
@@ -58,7 +58,9 @@ THIS TEXT WILL BE REMOVED AS WELL.
<onc:subtab name="Graphs" url="/rhq/group/monitor/graphs.xhtml"/>
<onc:subtab name="Tables" url="/rhq/group/monitor/tables.xhtml"/>
<onc:subtab name="Schedules" url="/rhq/group/monitor/schedules.xhtml"/>
- <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/>
+ <c:if test="#{GlobalPermissionsUIBean.experimental}">
+ <onc:subtab name="Response" url="/rhq/group/monitor/response.xhtml"/>
+ </c:if>
</onc:tab>
<onc:tab name="Inventory" image="/images/icons/Inventory_grey_16.png">
commit 332fe9ad8a96d058eee69285cd7960f119b9d6d5
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 13:45:07 2010 -0400
support a GLOBAL bit for toggling on/off experimental features in the product
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java
index 237858d..48694d8 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/admin/config/SystemConfigForm.java
@@ -37,6 +37,7 @@ public class SystemConfigForm extends BaseValidatorForm {
private String agentMaxQuietTimeAllowedVal = "0";
private boolean enableAgentAutoUpdate = false;
private boolean enableDebugMode = false;
+ private boolean enableExperimentalFeatures = false;
private String helpUserId = "";
private String helpPassword = "";
private String maintIntervalVal = "0";
@@ -75,6 +76,7 @@ public class SystemConfigForm extends BaseValidatorForm {
buf.append(" agentMaxQuietTimeAllowed=").append(agentMaxQuietTimeAllowed);
buf.append(" enableAgentAutoUpdate=").append(enableAgentAutoUpdate);
buf.append(" enableDebugMode=").append(enableDebugMode);
+ buf.append(" enableExperimentalFeatures=").append(enableExperimentalFeatures);
buf.append(" helpUserId=").append(helpUserId);
buf.append(" helpPassword=").append(helpPassword);
buf.append(" ldapEnabled=").append(ldapEnabled);
@@ -103,6 +105,7 @@ public class SystemConfigForm extends BaseValidatorForm {
agentMaxQuietTimeAllowedVal = null;
enableAgentAutoUpdate = true;
enableDebugMode = false;
+ enableExperimentalFeatures = false;
helpUserId = "";
helpPassword = "";
maintInterval = "";
@@ -165,6 +168,16 @@ public class SystemConfigForm extends BaseValidatorForm {
}
enableDebugMode = Boolean.valueOf(enableDebugModeStr).booleanValue();
+ String enableExperimentalFeaturesStr = prop.getProperty(RHQConstants.EnableExperimentalFeatures);
+ if (enableExperimentalFeaturesStr == null) {
+ enableExperimentalFeaturesStr = Boolean.FALSE.toString();
+ } else if (enableExperimentalFeaturesStr.equals("0")) {
+ enableExperimentalFeaturesStr = Boolean.FALSE.toString();
+ } else if (enableExperimentalFeaturesStr.equals("1")) {
+ enableExperimentalFeaturesStr = Boolean.TRUE.toString();
+ }
+ enableExperimentalFeatures = Boolean.valueOf(enableExperimentalFeaturesStr).booleanValue();
+
String maintIntervalValStr = prop.getProperty(RHQConstants.DataMaintenance);
Long maintIntervalLong = new Long(maintIntervalValStr);
maintInterval = findTimeUnit(maintIntervalLong.longValue());
@@ -292,6 +305,8 @@ public class SystemConfigForm extends BaseValidatorForm {
prop.setProperty(RHQConstants.EnableDebugMode, String.valueOf(enableDebugMode));
+ prop.setProperty(RHQConstants.EnableExperimentalFeatures, String.valueOf(enableExperimentalFeatures));
+
long maintIntervalLong = convertToMillisecond(Integer.parseInt(maintIntervalVal), maintInterval);
prop.setProperty(RHQConstants.DataMaintenance, String.valueOf(maintIntervalLong));
@@ -383,6 +398,14 @@ public class SystemConfigForm extends BaseValidatorForm {
this.enableDebugMode = b;
}
+ public boolean getEnableExperimentalFeatures() {
+ return this.enableExperimentalFeatures;
+ }
+
+ public void setEnableExperimentalFeatures(boolean b) {
+ this.enableExperimentalFeatures = b;
+ }
+
public String getMaintIntervalVal() {
return maintIntervalVal;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
index 9cf263f..9f6ffd0 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authorization/GlobalPermissionsUIBean.java
@@ -23,7 +23,6 @@ import java.util.Set;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
-import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -34,6 +33,7 @@ public class GlobalPermissionsUIBean {
private boolean settings;
private boolean isSuperuser;
private boolean isDebugMode;
+ private boolean isExperimental;
public GlobalPermissionsUIBean() {
Subject user = EnterpriseFacesContextUtility.getSubject();
@@ -48,7 +48,8 @@ public class GlobalPermissionsUIBean {
}
SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- isDebugMode = Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode));
+ isDebugMode = systemManager.isDebugModeEnabled();
+ isExperimental = systemManager.isExperimentalFeaturesEnabled();
}
public boolean isSuperuser() {
@@ -59,6 +60,10 @@ public class GlobalPermissionsUIBean {
return isDebugMode;
}
+ public boolean isExperimental() {
+ return isExperimental;
+ }
+
public boolean isSecurity() {
return security;
}
diff --git a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java
index 2c9104d..efe3dba 100644
--- a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java
+++ b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/common/framework/ServerInfoUIBean.java
@@ -18,19 +18,23 @@
*/
package org.rhq.enterprise.gui.common.framework;
+import java.util.TimeZone;
+
+import javax.faces.component.UIComponent;
+
import com.sun.facelets.Facelet;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+
import org.jboss.seam.Component;
+
import org.rhq.core.util.maven.MavenArtifactNotFoundException;
import org.rhq.core.util.maven.MavenArtifactProperties;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
-import javax.faces.component.UIComponent;
-import java.util.TimeZone;
-
/**
* A JSF managed bean that exposes various general server information - RHQ version, timezone, etc.
*
@@ -50,6 +54,12 @@ public class ServerInfoUIBean {
return Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode));
}
+ public boolean isExperimentalFeaturesEnabled() {
+ SystemManagerLocal systemManager = LookupUtil.getSystemManager();
+ return Boolean.valueOf(systemManager.getSystemConfiguration().getProperty(
+ RHQConstants.EnableExperimentalFeatures));
+ }
+
public String getFacesVersion() {
return getManifestVersion(UIComponent.class);
}
@@ -81,11 +91,10 @@ public class ServerInfoUIBean {
if (pkg != null) {
version = pkg.getImplementationVersion();
if (version == null) {
- version = pkg.getSpecificationVersion();
+ version = pkg.getSpecificationVersion();
}
}
- }
- catch (Exception e) {
+ } catch (Exception e) {
log.error("Error while looking up manifest version for " + clazz + ".", e);
}
return version;
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 2d93e15..2510400 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
@@ -591,6 +591,7 @@ admin.settings.BaseURL=GUI Console URL:
admin.settings.AgentMaxQuietTimeAllowed=Agent Max Quiet Time Allowed:
admin.settings.EnableAgentAutoUpdate=Enable Agent Auto-Updates:
admin.settings.EnableDebugMode=Enable Debug Mode:
+admin.settings.EnableExperimentalFeatures=Enable Experimental Features:
admin.settings.HttpProxyUrl=HTTP Proxy URL:
admin.settings.HttpProxyPort=HTTP Proxy Port:
admin.settings.SenderEmailAddressLabel=From Email Address:
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
index 30df9ef..068b230 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/GeneralPropertiesConfigForm.jsp
@@ -101,4 +101,18 @@
</tr>
</hq:authorization>
+<hq:authorization permission="superuser">
+ <tr>
+ <td class="BlockLabel"><fmt:message key="admin.settings.EnableExperimentalFeatures"/></td>
+ <td class="BlockContent">
+ <table cellpadding="0" cellspacing="4" border="0">
+ <tr>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="true"/><fmt:message key="yesno.true"/></td>
+ <td align="left"><html:radio property="enableExperimentalFeatures" value="false"/><fmt:message key="yesno.false"/></td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</hq:authorization>
+
</table>
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
index 7bb1d72..6712b3d 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/RHQConstants.java
@@ -63,10 +63,12 @@ public class RHQConstants {
// Are we allowing automatic AgentUpdate binary download
public static final String EnableAgentAutoUpdate = "ENABLE_AGENT_AUTO_UPDATE";
-
- // Are we rendering a special "debug" menu for administrators?
+ // Are we rendering a special "debug" menu for administrators?
public static final String EnableDebugMode = "ENABLE_DEBUG_MODE";
+ // Are we rendering features which are marked as experimental for this installation?
+ public static final String EnableExperimentalFeatures = "ENABLE_EXPERIMENTAL_FEATURES";
+
// How long do we keep data compressed in hourly intervals?
public static final String DataPurge1Hour = "CAM_DATA_PURGE_1H";
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index edb5059..4dc713b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -267,7 +267,7 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
// to support Oracle (whose booleans may be 1 or 0) transform the boolean settings properly
String propName = prop.getPropertyKey();
if (RHQConstants.EnableAgentAutoUpdate.equals(propName) || RHQConstants.EnableDebugMode.equals(propName)
- || RHQConstants.DataReindex.equals(propName)) {
+ || RHQConstants.DataReindex.equals(propName) || RHQConstants.EnableExperimentalFeatures.equals(propName)) {
String booleanValue = prop.getPropertyValue();
if ("0".equals(booleanValue)) {
prop.setPropertyValue(Boolean.FALSE.toString());
@@ -473,8 +473,8 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
// we need to undeploy it first - on windows the files are locked and can't be renamed until undeployed
ObjectName name = ObjectNameFactory.create("jboss.system:service=MainDeployer");
MBeanServerConnection mbs = MBeanServerLocator.locateJBoss();
- MainDeployerMBean mbean = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance(mbs, name,
- MainDeployerMBean.class, false);
+ MainDeployerMBean mbean = (MainDeployerMBean) MBeanServerInvocationHandler.newProxyInstance(mbs,
+ name, MainDeployerMBean.class, false);
URL url = deployedInstallWar.toURI().toURL();
String urlString = url.toString().replace("%20", " "); // bug in undeployer doesn't like %20 - it wants a real space
((MainDeployerMBean) mbean).undeploy(urlString);
@@ -542,6 +542,23 @@ public class SystemManagerBean implements SystemManagerLocal, SystemManagerRemot
}
}
+ public boolean isDebugModeEnabled() {
+ try {
+ return Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode, "false"));
+ } catch (Throwable t) {
+ return false; // paranoid catch-all
+ }
+ }
+
+ public boolean isExperimentalFeaturesEnabled() {
+ try {
+ return Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableExperimentalFeatures,
+ "false"));
+ } catch (Throwable t) {
+ return false; // paranoid catch-all
+ }
+ }
+
/**
* Retrieves the currently active license. Returns null if there is no active license. Otherwise it needs to
* propogate the appropriate error back up to the caller, otherwise the error will be masked, and from a UI
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
index 18bb904..e339c8b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
@@ -150,6 +150,10 @@ public interface SystemManagerLocal {
*/
void loadSystemConfigurationCache();
+ boolean isDebugModeEnabled();
+
+ boolean isExperimentalFeaturesEnabled();
+
//////////////////////////////////
// license specific methods follow
13 years, 10 months
[rhq] Branch 'release-3.0.0' - 5 commits - modules/core modules/enterprise
by Joseph Marques
modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java | 2
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java | 8 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java | 5 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java | 34 ++++++----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java | 8 ++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java | 10 ++
6 files changed, 45 insertions(+), 22 deletions(-)
New commits:
commit e0d9d1a44ecd4d42fc681eb0be0302578eb9191a
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:46:16 2010 -0400
do not update the resource type when importing/creating resources.
the group category used to be based off of the explicit membership,
but that assumption was changed for 1.2.0 release so we could support
a compatible left-nav tree with recursive access to descendant for
easy authorization. this method only modifies the implicit resource
membership, not the explicit, so setResourceType would be a no-op.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
index 5e7707d..8e33ca1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java
@@ -765,8 +765,13 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso
* created, but which initially creates one or more resource groups of size 1; if this happens, the
* group will be created as a compatible group, if resources are later added via an inventory sync, and
* if this compatible group's membership changes, we need to recalculate the group category
+ *
+ * NOTE: this is no longer true. the group category used to be based off of the explicit membership,
+ * but that assumption was changed for 1.2.0 release so we could support a compatible left-nav
+ * tree with recursive access to descendant for easy authorization. this method only modifies
+ * the implicit resource membership, not the explicit, so setResourceType would be a no-op.
*/
- setResourceType(implicitRecursiveGroupId);
+ //setResourceType(implicitRecursiveGroupId);
}
} catch (Exception e) {
throw new ResourceGroupUpdateException("Could not add resource[id=" + resource.getId()
@@ -923,6 +928,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso
}
@SuppressWarnings("unchecked")
+ @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void setResourceType(int resourceGroupId) throws ResourceGroupDeleteException {
Query query = entityManager.createNamedQuery(ResourceType.QUERY_GET_EXPLICIT_RESOURCE_TYPE_COUNTS_BY_GROUP);
query.setParameter("groupId", resourceGroupId);
commit 0beacaaa68b779b9677851568ed2e718b5c18d0d
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:44:44 2010 -0400
BZ-608898: prevent deadlock during dynagroup recalculation
* first add/remove resources to the recalculated group, commit that work
* then reset the ResourceType on the group as necessary, based off of new membership
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
index 9a11216..5570738 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/definition/GroupDefinitionManagerBean.java
@@ -303,6 +303,14 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal {
groupDefinitionId, result);
/*
+ * as a result of recalculation, the membership may have changed such that a group which was previously
+ * marked as compatible now becomes a mixed group. if that happens, then the GroupCategory needs to be
+ * updated and any compatible group constructs need to be removed from this group. the following method
+ * will achieve both of those goals
+ */
+ resourceGroupManager.setResourceType(nextResourceGroupId);
+
+ /*
* remove all ids returned from the helper. by the time we're done looping over all
* ExpressionEvaluator.Result objects, the remaining objects in managedResourceGroupIds should represent
* groups that no longer managed by this definition (either due to an inventory or expression change), and
@@ -374,8 +382,6 @@ public class GroupDefinitionManagerBean implements GroupDefinitionManagerLocal {
resourceGroupManager.removeResourcesFromGroup(overlord, resourceGroupId, ArrayUtils
.unwrapCollection(idsToRemove));
- resourceGroupManager.setResourceType(resourceGroupId);
-
long endTime = System.currentTimeMillis();
log.debug("calculateGroupMembership_helper took " + (endTime - startTime) + " millis");
commit eaf523492da7127850506e4f5919b4b9ce253e24
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:43:15 2010 -0400
BZ-608898: when setting the ResourceGroup on an AlertDefinition, do not load existing AlertDefinitions
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
index a64de62..94ae2fe 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/AlertDefinition.java
@@ -518,9 +518,11 @@ public class AlertDefinition implements Serializable {
public void setResourceGroup(ResourceGroup resourceGroup) {
this.resourceGroup = resourceGroup;
+ /*
if (this.resourceGroup != null) {
this.resourceGroup.getAlertDefinitions().add(this);
}
+ */
}
public ResourceType getResourceType() {
commit 9679c7a712fbeb644d4b01a52e347bba634195b7
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:42:21 2010 -0400
BZ-608898: when deleting/purging group alert definitions, only load ids
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
index e553ca8..8eb7efd 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/AlertDefinitionCriteria.java
@@ -50,6 +50,7 @@ public class AlertDefinitionCriteria extends Criteria {
private Integer filterAlertTemplateResourceTypeId; // requires overrides
private String filterAlertTemplateResourceTypeName; // requires overrides
private List<Integer> filterResourceIds; // requires overrides
+ private List<Integer> filterResourceGroupIds; // requires overrides
private Boolean filterEnabled;
private String filterOperationName; // requires overrides
private Boolean filterDeleted;
@@ -66,11 +67,12 @@ public class AlertDefinitionCriteria extends Criteria {
filterOverrides.put("alertTemplateResourceTypeId", "resourceType.id = ?");
filterOverrides.put("alertTemplateResourceTypeName", "resourceType.name like ?");
filterOverrides.put("resourceIds", "resource.id IN ( ? )");
+ filterOverrides.put("resourceGroupIds", "resourceGroup.id IN ( ? )");
filterOverrides.put("operationName", "operationDefinition.name like ?");
}
@Override
- public Class getPersistentClass() {
+ public Class<?> getPersistentClass() {
return AlertDefinition.class;
}
@@ -106,6 +108,10 @@ public class AlertDefinitionCriteria extends Criteria {
this.filterResourceIds = Arrays.asList(filterResourceIds);
}
+ public void addFilterResourceGroupIds(Integer... filterResourceGroupIds) {
+ this.filterResourceGroupIds = Arrays.asList(filterResourceGroupIds);
+ }
+
public void addFilterEnabled(Boolean filterEnabled) {
this.filterEnabled = filterEnabled;
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java
index 57701ce..a2eb45e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/GroupAlertDefinitionManagerBean.java
@@ -36,6 +36,7 @@ import org.jboss.annotation.IgnoreDependency;
import org.rhq.core.domain.alert.AlertDefinition;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.criteria.AlertDefinitionCriteria;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.core.domain.util.PageControl;
@@ -45,6 +46,7 @@ import org.rhq.core.server.PersistenceUtility;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
+import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
/**
* @author Joseph Marques
@@ -330,16 +332,23 @@ public class GroupAlertDefinitionManagerBean implements GroupAlertDefinitionMana
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
public void purgeAllGroupAlertDefinitions(Subject subject, int resourceGroupId) {
- List<AlertDefinition> groupAlertDefinitions = findGroupAlertDefinitions(subject, resourceGroupId, PageControl
- .getUnlimitedInstance());
-
- int i = 0;
- Integer[] groupAlertDefinitionIds = new Integer[groupAlertDefinitions.size()];
- for (AlertDefinition groupAlertDefinition : groupAlertDefinitions) {
- groupAlertDefinitionIds[i++] = groupAlertDefinition.getId();
- }
+ Integer[] groupAlertDefinitionIdsForResourceGroup = findGroupAlertDefinitionIds(resourceGroupId);
+ removeGroupAlertDefinitions(subject, groupAlertDefinitionIdsForResourceGroup);
+ }
- removeGroupAlertDefinitions(subject, groupAlertDefinitionIds);
+ @SuppressWarnings("unchecked")
+ private Integer[] findGroupAlertDefinitionIds(int resourceGroupId) {
+ AlertDefinitionCriteria criteria = new AlertDefinitionCriteria();
+ criteria.addFilterResourceGroupIds(resourceGroupId);
+ criteria.setPageControl(PageControl.getUnlimitedInstance());
+
+ CriteriaQueryGenerator generator = new CriteriaQueryGenerator(criteria);
+ generator.alterProjection("alertdefinition.id");
+ Query query = generator.getQuery(entityManager);
+ List<Integer> groupAlertDefinitionIds = query.getResultList();
+
+ Integer[] results = groupAlertDefinitionIds.toArray(new Integer[groupAlertDefinitionIds.size()]);
+ return results;
}
public void removeGroupAlertDefinitions(Subject subject, int resourceGroupId, int[] resourceIdsToRemove) {
@@ -347,13 +356,12 @@ public class GroupAlertDefinitionManagerBean implements GroupAlertDefinitionMana
return;
}
- List<AlertDefinition> groupAlertDefinitions = findGroupAlertDefinitions(subject, resourceGroupId, PageControl
- .getUnlimitedInstance());
+ Integer[] groupAlertDefinitionIdsForResourceGroup = findGroupAlertDefinitionIds(resourceGroupId);
List<Integer> allChildrenDefinitionIds = new ArrayList<Integer>();
Subject overlord = subjectManager.getOverlord();
- for (AlertDefinition groupAlertDefinition : groupAlertDefinitions) {
- List<Integer> childDefinitions = getChildrenAlertDefinitionIds(subject, groupAlertDefinition.getId());
+ for (Integer nextGroupAlertDefinitionId : groupAlertDefinitionIdsForResourceGroup) {
+ List<Integer> childDefinitions = getChildrenAlertDefinitionIds(subject, nextGroupAlertDefinitionId);
allChildrenDefinitionIds.addAll(childDefinitions);
alertDefinitionManager.removeAlertDefinitions(overlord, childDefinitions
.toArray(new Integer[childDefinitions.size()]));
commit 72f529c71dc2d472a225d84933108a9c836d2da8
Author: Joseph Marques <joseph(a)redhat.com>
Date: Tue Jun 29 12:34:24 2010 -0400
remove unused dependency
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
index 991eb57..a48cd85 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerBean.java
@@ -32,8 +32,6 @@ import javax.persistence.Query;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.jboss.annotation.IgnoreDependency;
-
import org.rhq.core.domain.alert.AlertCondition;
import org.rhq.core.domain.alert.AlertConditionCategory;
import org.rhq.core.domain.alert.AlertConditionLog;
@@ -76,9 +74,6 @@ public class AlertDefinitionManagerBean implements AlertDefinitionManagerLocal,
private AuthorizationManagerLocal authorizationManager;
@EJB
private AlertDefinitionManagerLocal alertDefinitionManager;
- @EJB
- @IgnoreDependency
- private AlertNotificationManagerLocal alertNotificationManager;
@EJB
private StatusManagerLocal agentStatusManager;
13 years, 10 months
[rhq] Branch 'release-3.0.0' - modules/enterprise
by lkrejci
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp | 2 ++
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 636aaf2c1b4b75e02c905416294384de6660b8dc
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Jun 28 12:19:55 2010 +0200
BZ 602176 - the timeline is auto-scrollable, so that it displays in full even if it doesn't fit the screen.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
index 85f8696..e964274 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/events/EventsView.jsp
@@ -33,6 +33,8 @@
.timeline-band-layer-inner { font-size: smaller; }
.table-start-label { font-size: smaller; }
</style>
+ <link rel="stylesheet" type="text/css" media="screen" href="/css/win.css"/>
+ <link rel="stylesheet" type="text/css" media="screen" href="/css/form-style.css"/>
</head>
<%
int eventId = WebUtility.getOptionalIntRequestParameter(request, "eventId", -1);
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml
index 1dd2c5c..0fe7d0f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/summary/timeline.xhtml
@@ -31,7 +31,7 @@
<h:panelGrid columns="1" width="97%">
<iframe src ="/resource/common/monitor/events/EventsView.jsp?id=#{param.id}"
- width="100%" height="550" scrolling="no" frameborder="0" />
+ width="100%" height="550" scrolling="auto" frameborder="0" style="min-width: 635px"/>
</h:panelGrid>
</rich:panel>
13 years, 10 months