package org.jboss.monitor;
import javax.management.Notification;
import javax.management.ObjectName;
import java.util.Map;
import java.util.HashMap;
public class ThresholdNotification
extends JBossMonitorNotification
{
public static final String TRIGGERED_ATTRIBUTE_VALUE="TRIGGERED_ATTRIBUTE_VALUE";
public static final String THRESHOLD = "THRESHOLD";
private final Number value;
private final Number threshold;
public ThresholdNotification(String monitorName, ObjectName monitorObjectName, ObjectName observedObject,
String attribute, Number value, Number threshold, long sequenceNumber)
{
super(monitorName, monitorObjectName, observedObject, attribute, sequenceNumber);
this.value = value;
this.threshold = threshold;
}
public Number getValue()
{
return value;
}
public Number getThreshold()
{
return threshold;
}
public Map substitutionMap()
{
Map map = super.substitutionMap();
map.put(TRIGGERED_ATTRIBUTE_VALUE, value);
map.put(THRESHOLD, threshold);
return map;
}
}