01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * published by the Free Software Foundation; either version 2.1 of
10: * the License, or (at your option) any later version.
11: *
12: * This software is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this software; if not, write to the Free
19: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21: */
22: package org.jboss.monitor;
23:
24: import javax.management.Notification;
25: import javax.management.ObjectName;
26: import java.util.Map;
27:
28: /**
29: * Comment
30: *
31: * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
32: * @version $Revision: 57210 $
33: *
34: **/
35: public class StringThresholdNotification extends
36: JBossMonitorNotification {
37: public static final String TRIGGERED_ATTRIBUTE_VALUE = "TRIGGERED_ATTRIBUTE_VALUE";
38: public static final String THRESHOLD = "THRESHOLD";
39:
40: private final String value;
41: private final String threshold;
42: private final boolean equality;
43:
44: public StringThresholdNotification(String monitorName,
45: ObjectName monitorObjectName, ObjectName observedObject,
46: String attribute, String value, String threshold,
47: boolean equality, long sequenceNumber) {
48: super (monitorName, monitorObjectName, observedObject,
49: attribute, sequenceNumber);
50: this .value = value;
51: this .threshold = threshold;
52: this .equality = equality;
53: }
54:
55: public String getValue() {
56: return value;
57: }
58:
59: public String getThreshold() {
60: return threshold;
61: }
62:
63: public boolean getEquality() {
64: return equality;
65: }
66:
67: /**
68: * Return a substitution map that can be used by org.jboss.util.Strings.subst
69: * to create a printable alert message.
70: *
71: * @return
72: */
73: public Map substitutionMap() {
74: Map map = super.substitutionMap();
75: map.put(TRIGGERED_ATTRIBUTE_VALUE, value);
76: map.put(THRESHOLD, threshold);
77: return map;
78: }
79: }
|