modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
| 21 +++++++++-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
| 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
| 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
| 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
| 3 +
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
| 3 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
| 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
| 17 ++++++++
8 files changed, 53 insertions(+), 2 deletions(-)
New commits:
commit fbc77d447c2e27923a8eac3c275121cb3ecd0598
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Sep 1 18:00:30 2011 -0400
[BZ 735230] provide better messages in ui
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
index c25855c..72a6966 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/AlertFormatUtility.java
@@ -188,7 +188,26 @@ public class AlertFormatUtility {
break;
}
case DRIFT: {
- str.append(MSG.view_alert_common_tab_conditions_type_drift());
+ String configNameRegex = condition.getName();
+ String pathNameRegex = condition.getOption();
+ if (configNameRegex == null || configNameRegex.length() == 0) {
+ if (pathNameRegex == null || pathNameRegex.length() == 0) {
+ // neither a config name regex nor path regex was specified
+ str.append(MSG.view_alert_common_tab_conditions_type_drift());
+ } else {
+ // a path name regex was specified, but not a config name regex
+
str.append(MSG.view_alert_common_tab_conditions_type_drift_onlypaths(pathNameRegex));
+ }
+ } else {
+ if (pathNameRegex == null || pathNameRegex.length() == 0) {
+ // a config name regex was specified, but not a path name regex
+
str.append(MSG.view_alert_common_tab_conditions_type_drift_onlyconfig(configNameRegex));
+ } else {
+ // both a config name regex and a path regex was specified
+
str.append(MSG.view_alert_common_tab_conditions_type_drift_configpaths(pathNameRegex,
+ configNameRegex));
+ }
+ }
break;
}
default: {
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index 8b978c8..494d691 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -613,6 +613,9 @@ view_alert_common_tab_conditions_type_availability = Availability
Change
view_alert_common_tab_conditions_type_availability_down = Went down
view_alert_common_tab_conditions_type_availability_up = Came up
view_alert_common_tab_conditions_type_drift = Drift Detection
+view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files that
match "{0}" and for drift configuration [{1}]
+view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift
configuration [{0}]
+view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that
match "{0}"
view_alert_common_tab_conditions_type_event = Event Detection
view_alert_common_tab_conditions_type_event_matching = with event source matching
view_alert_common_tab_conditions_type_metric_baseline = Metric Value Baseline
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 1e1b853..2e546b6 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -490,6 +490,9 @@ view_alert_common_tab_conditions_type_availability = Änderung der
Verfügbarkei
view_alert_common_tab_conditions_type_availability_down = Wurde unverfügbar
view_alert_common_tab_conditions_type_availability_up = Wurde wieder verfügbar
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files
that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift
configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that
match "{0}"
##view_alert_common_tab_conditions_type_event = Event Detection
view_alert_common_tab_conditions_type_event_matching = with event source matching~
view_alert_common_tab_conditions_type_metric_baseline = Metrik überschreitet
Referenzband
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 150c06a..74f8fbd 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -608,6 +608,9 @@ view_alert_common_tab_conditions_type_availability = アベイラビリティの
view_alert_common_tab_conditions_type_availability_down = 下降
view_alert_common_tab_conditions_type_availability_up = 上昇
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files
that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift
configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that
match "{0}"
view_alert_common_tab_conditions_type_event = イベントの検出
view_alert_common_tab_conditions_type_event_matching = イベントソースが一致
view_alert_common_tab_conditions_type_metric_baseline = メトリック値のベースライン
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 53c9dfd..3dc1b04 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -624,6 +624,9 @@ view_alert_common_tab_conditions_type_availability = Mudan\u00E7a na
Disponibili
view_alert_common_tab_conditions_type_availability_down = Indispon\u00EDvel
view_alert_common_tab_conditions_type_availability_up = Dispon\u00EDvel
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files
that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift
configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that
match "{0}"
view_alert_common_tab_conditions_type_event = Detec\u00E7\u00E3o de Envento
view_alert_common_tab_conditions_type_event_matching = combinando com o evento de origem
view_alert_common_tab_conditions_type_metric_baseline = Valor da m\u00E9trica excede a
linha de base (baseline)
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 428b402..086bb1b 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -607,6 +607,9 @@ view_alert_common_tab_conditions_type_availability =
\u53ef\u7528\u6027\u6539\u5
view_alert_common_tab_conditions_type_availability_down = Went down
view_alert_common_tab_conditions_type_availability_up = Came up
##view_alert_common_tab_conditions_type_drift = Drift Detection
+##view_alert_common_tab_conditions_type_drift_configpaths = Drift Detection for files
that match "{0}" and for drift configuration [{1}]
+##view_alert_common_tab_conditions_type_drift_onlyconfig = Drift Detection for drift
configuration [{0}]
+##view_alert_common_tab_conditions_type_drift_onlypaths = Drift Detection for files that
match "{0}"
view_alert_common_tab_conditions_type_event = \u4e8b\u4ef6\u68c0\u6d4b
view_alert_common_tab_conditions_type_event_matching = with event source matching
view_alert_common_tab_conditions_type_metric_baseline = \u6307\u6807\u57fa\u51c6
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
index d7c68cf..7527fdc 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/engine/model/DriftCacheElement.java
@@ -25,7 +25,7 @@ import org.rhq.enterprise.server.plugin.pc.drift.DriftChangeSetSummary;
public class DriftCacheElement extends AbstractCacheElement<Object> {
- public static final Object UNUSED_CONDITION_VALUE = "unused";
+ public static final Object UNUSED_CONDITION_VALUE = "Drift Detected";
private final Pattern driftConfigNameRegex;
private final Pattern driftPathNameRegex;
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
index 8148690..535faf9 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/drift/DriftChangeSetSummary.java
@@ -20,6 +20,7 @@
package org.rhq.enterprise.server.plugin.pc.drift;
import java.util.ArrayList;
+import java.util.Date;
import java.util.List;
import org.rhq.core.domain.drift.DriftChangeSetCategory;
@@ -40,6 +41,22 @@ public class DriftChangeSetSummary {
private String driftConfigurationName;
private List<String> driftPathnames;
+ /**
+ * Because this summary object is used within the alert subsystem, this toString is
used to display
+ * a message in the alert description if/when alerts are fired.
+ */
+ @Override
+ public String toString() {
+ if (category == DriftChangeSetCategory.COVERAGE) {
+ return "[" + new Date(createdTime) + "] Initial drift coverage
includes ["
+ + obtainDriftPathnamesList().size() + "] files using drift
configuration [" + driftConfigurationName
+ + "]";
+ } else {
+ return "[" + new Date(createdTime) + "] Drift detected in
[" + obtainDriftPathnamesList().size()
+ + "] files using drift configuration [" +
driftConfigurationName + "]";
+ }
+ }
+
public long getCreatedTime() {
return createdTime;
}
Show replies by date