|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.web.alarm.AlarmFactory
public class AlarmFactory
Encapsulates all querying functionality for alarms.
| Method Summary | |
|---|---|
static void |
acknowledge(Alarm[] alarms,
String user)
Acknowledge a list of alarms with the given username and the current time. |
static void |
acknowledge(Alarm[] alarms,
String user,
Date time)
Acknowledge a list of alarms with the given username and the given time. |
static void |
acknowledge(Filter[] filters,
String user)
Acknowledge with the given username and the current time all alarms that match the given filter criteria. |
static void |
acknowledge(Filter[] filters,
String user,
Date time)
Acknowledge with the given username and the given time all alarms that match the given filter criteria. |
static void |
acknowledge(int[] alarmIds,
String user)
Acknowledge a list of alarms with the given username and the current time. |
static void |
acknowledge(int[] alarmIds,
String user,
Date time)
Acknowledge a list of alarms with the given username and the given time. |
static void |
acknowledgeAll(String user)
Acknowledge all unacknowledged alarms with the given username and the given time. |
static void |
acknowledgeAll(String user,
Date time)
Acknowledge all unacknowledged alarms with the given username and the given time. |
static void |
clearAlarms(int[] alarmIds,
String user)
Clear a list of alarms, using the given username and the current time |
static void |
clearAlarms(int[] alarmIds,
String user,
Date time)
Clear a list of alarms. |
static void |
escalateAlarms(int[] alarmIds,
String user)
Escalate a list of alarms using the given username and the current time |
static void |
escalateAlarms(int[] alarmIds,
String user,
Date time)
Escalate a list of alarms. |
static int |
getAlarmCount()
Count all outstanding (unacknowledged) alarms. |
static int |
getAlarmCount(AcknowledgeType ackType,
Filter[] filters)
Count the number of alarms for a given acknowledgement type. |
static int[] |
getAlarmCountBySeverity(AcknowledgeType ackType,
Filter[] filters)
Count the number of alarms for a given acknowledgement type. |
static int |
getAlarmCountForInterface(int nodeId,
String ipAddress,
AcknowledgeType ackType)
Return the number of alarms for this node ID, IP address, and the given acknowledgement type. |
static int |
getAlarmCountForInterface(String ipAddress,
AcknowledgeType ackType)
Return the number of alarms for this IP address and the given acknowledgement type. |
static int |
getAlarmCountForNode(int nodeId,
AcknowledgeType ackType)
Return the number of alarms for this node and the given acknowledgement type. |
static int |
getAlarmCountForService(int serviceId,
AcknowledgeType ackType)
Return the number of alarms for this node ID, IP address, service ID, and the given acknowledgement type. |
static int |
getAlarmCountForService(int nodeId,
String ipAddress,
int serviceId,
AcknowledgeType ackType)
Return the number of alarms for this node ID, IP address, service ID, and the given acknowledgement type. |
static Alarm[] |
getAlarms()
Return all unacknowledged alarms sorted by time. |
static Alarm[] |
getAlarms(AcknowledgeType ackType)
Return all unacknowledged or acknowledged alarms sorted by time. |
static Alarm |
getAlarms(int alarmId)
Return a specific alarm. |
static Alarm[] |
getAlarms(SortStyle sortStyle)
Return all unacknowledged alarms sorted by the given sort style. |
static Alarm[] |
getAlarms(SortStyle sortStyle,
AcknowledgeType ackType)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm[] |
getAlarms(SortStyle sortStyle,
AcknowledgeType ackType,
Filter[] filters)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm[] |
getAlarms(SortStyle sortStyle,
AcknowledgeType ackType,
Filter[] filters,
int limit,
int offset)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm[] |
getAlarms(SortStyle sortStyle,
boolean includeAcknowledged)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm[] |
getAlarmsForInterface(int nodeId,
String ipAddress)
Return all unacknowledged alarms sorted by event ID for the given interface. |
static Alarm[] |
getAlarmsForInterface(int nodeId,
String ipAddress,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
Return some maximum number of alarms or less (optionally only unacknowledged alarms) sorted by the given sort style for the given node and IP address. |
static Alarm[] |
getAlarmsForInterface(String ipAddress)
Return all unacknowledged alarms sorted by time for that have the given IP address, regardless of what node they belong to. |
static Alarm[] |
getAlarmsForInterface(String ipAddress,
boolean includeAcknowledged)
Deprecated. Replaced by " #getEventsForInterface(String,SortStyle,AcknowledgeType) getEventsForInterface( String, SortStyle, AcknowledgeType )" |
static Alarm[] |
getAlarmsForInterface(String ipAddress,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
Return some maximum number of alarms or less (optionally only unacknowledged alarms) sorted by the given sort style for the given IP address. |
static Alarm[] |
getAlarmsForNode(int nodeId)
Return all unacknowledged alarms sorted by alarm ID for the given node. |
static Alarm[] |
getAlarmsForNode(int nodeId,
SortStyle sortStyle,
AcknowledgeType ackType)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style for the given node. |
static Alarm[] |
getAlarmsForNode(int nodeId,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
Return some maximum number of alarms or less (optionally only unacknowledged alarms) sorted by the given sort style for the given node. |
static Alarm[] |
getAlarmsForPoller(String poller)
Return all unacknowledged alarms sorted by time for that have the given distributed poller. |
static Alarm[] |
getAlarmsForPoller(String poller,
boolean includeAcknowledged)
Return all alarms (optionally only unacknowledged alarms) sorted by time that have the given distributed poller. |
static Alarm[] |
getAlarmsForService(int serviceId)
Return all unacknowledged alarms sorted by time for the given service type, regardless of what node or interface they belong to. |
static Alarm[] |
getAlarmsForService(int serviceId,
boolean includeAcknowledged)
Return all alarms (optionally only unacknowledged alarms) sorted by time for the given service type, regardless of what node or interface they belong to. |
static Alarm[] |
getAlarmsForService(int serviceId,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
Return some maximum number of alarms or less (optionally only unacknowledged alarms) sorted by the given sort style for the given service ID. |
static Alarm[] |
getAlarmsForService(int nodeId,
String ipAddress,
int serviceId)
Return all unacknowledged alarms sorted by time for the given service. |
static Alarm[] |
getAlarmsForService(int nodeId,
String ipAddress,
int serviceId,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
Return some maximum number of alarms or less (optionally only unacknowledged alarms) sorted by the given sort style for the given node, IP address, and service ID. |
static Alarm[] |
getAlarmsForSeverity(int severity)
Return all unacknowledged alarms sorted by time for the given severity. |
static Alarm[] |
getAlarmsForSeverity(int severity,
SortStyle sortStyle,
AcknowledgeType ackType)
|
protected static Alarm[] |
rs2Alarms(ResultSet rs)
Convenience method for translating a java.sql.ResultSet
containing event information into an array of Alarm
objects. |
static void |
unacknowledge(Alarm[] alarms)
Unacknowledge a list of alarms. |
static void |
unacknowledge(Filter[] filters)
Unacknowledge alarms that match the given filter criteria. |
static void |
unacknowledge(int[] alarmIds)
Unacknowledge a list of alarms. |
static void |
unacknowledgeAll()
Unacknowledge all acknowledged alarms. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static int getAlarmCount()
throws SQLException
SQLException
public static int getAlarmCount(AcknowledgeType ackType,
Filter[] filters)
throws SQLException
SQLException
public static int[] getAlarmCountBySeverity(AcknowledgeType ackType,
Filter[] filters)
throws SQLException
SQLException
public static Alarm getAlarms(int alarmId)
throws SQLException
SQLException
public static Alarm[] getAlarms()
throws SQLException
SQLException
public static Alarm[] getAlarms(AcknowledgeType ackType)
throws SQLException
SQLException
public static Alarm[] getAlarms(SortStyle sortStyle)
throws SQLException
SQLException
public static Alarm[] getAlarms(SortStyle sortStyle,
boolean includeAcknowledged)
throws SQLException
SQLException
public static Alarm[] getAlarms(SortStyle sortStyle,
AcknowledgeType ackType)
throws SQLException
SQLException
public static Alarm[] getAlarms(SortStyle sortStyle,
AcknowledgeType ackType,
Filter[] filters)
throws SQLException
SQLException
public static Alarm[] getAlarms(SortStyle sortStyle,
AcknowledgeType ackType,
Filter[] filters,
int limit,
int offset)
throws SQLException
Note: This limit/offset code is Postgres specific! Per Shane , this is okay for now until we can come up with an Oracle alternative too.
limit - if -1 or zero, no limit or offset is usedoffset - if -1, no limit or offset if used
SQLException
public static Alarm[] getAlarmsForNode(int nodeId)
throws SQLException
SQLException
public static Alarm[] getAlarmsForNode(int nodeId,
SortStyle sortStyle,
AcknowledgeType ackType)
throws SQLException
SQLException
public static Alarm[] getAlarmsForNode(int nodeId,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
throws SQLException
throttle - a value less than one means no throttling
SQLException
public static int getAlarmCountForNode(int nodeId,
AcknowledgeType ackType)
throws SQLException
SQLException
public static Alarm[] getAlarmsForInterface(int nodeId,
String ipAddress)
throws SQLException
SQLException
public static Alarm[] getAlarmsForInterface(int nodeId,
String ipAddress,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
throws SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
SQLException
public static Alarm[] getAlarmsForInterface(String ipAddress)
throws SQLException
SQLException
public static Alarm[] getAlarmsForInterface(String ipAddress,
boolean includeAcknowledged)
throws SQLException
SQLException
public static Alarm[] getAlarmsForInterface(String ipAddress,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
throws SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
SQLException
public static int getAlarmCountForInterface(int nodeId,
String ipAddress,
AcknowledgeType ackType)
throws SQLException
SQLException
public static int getAlarmCountForInterface(String ipAddress,
AcknowledgeType ackType)
throws SQLException
SQLException
public static Alarm[] getAlarmsForService(int nodeId,
String ipAddress,
int serviceId)
throws SQLException
SQLException
public static Alarm[] getAlarmsForService(int nodeId,
String ipAddress,
int serviceId,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
throws SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
SQLException
public static Alarm[] getAlarmsForService(int serviceId)
throws SQLException
SQLException
public static Alarm[] getAlarmsForService(int serviceId,
boolean includeAcknowledged)
throws SQLException
SQLException
public static Alarm[] getAlarmsForService(int serviceId,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset)
throws SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
SQLException
public static int getAlarmCountForService(int nodeId,
String ipAddress,
int serviceId,
AcknowledgeType ackType)
throws SQLException
SQLException
public static int getAlarmCountForService(int serviceId,
AcknowledgeType ackType)
throws SQLException
SQLException
public static Alarm[] getAlarmsForSeverity(int severity)
throws SQLException
SQLException
public static Alarm[] getAlarmsForSeverity(int severity,
SortStyle sortStyle,
AcknowledgeType ackType)
throws SQLException
SQLException
public static Alarm[] getAlarmsForPoller(String poller)
throws SQLException
SQLException
public static Alarm[] getAlarmsForPoller(String poller,
boolean includeAcknowledged)
throws SQLException
SQLException
public static void acknowledge(Alarm[] alarms,
String user)
throws SQLException
SQLException
public static void acknowledge(Alarm[] alarms,
String user,
Date time)
throws SQLException
SQLException
public static void acknowledge(int[] alarmIds,
String user)
throws SQLException
SQLException
public static void acknowledge(int[] alarmIds,
String user,
Date time)
throws SQLException
SQLException
public static void acknowledge(Filter[] filters,
String user)
throws SQLException
SQLException
public static void acknowledge(Filter[] filters,
String user,
Date time)
throws SQLException
SQLException
public static void acknowledgeAll(String user)
throws SQLException
SQLException
public static void acknowledgeAll(String user,
Date time)
throws SQLException
SQLException
public static void unacknowledge(Alarm[] alarms)
throws SQLException
SQLException
public static void unacknowledge(int[] alarmIds)
throws SQLException
SQLException
public static void unacknowledge(Filter[] filters)
throws SQLException
SQLException
public static void unacknowledgeAll()
throws SQLException
SQLException
protected static Alarm[] rs2Alarms(ResultSet rs)
throws SQLException
java.sql.ResultSet
containing event information into an array of Alarm
objects.
SQLException
public static void escalateAlarms(int[] alarmIds,
String user)
throws SQLException
SQLException
public static void escalateAlarms(int[] alarmIds,
String user,
Date time)
throws SQLException
SQLException
public static void clearAlarms(int[] alarmIds,
String user)
throws SQLException
SQLException
public static void clearAlarms(int[] alarmIds,
String user,
Date time)
throws SQLException
SQLException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||