|
|||||||||
| 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.
| Nested Class Summary | |
|---|---|
static class |
AlarmFactory.AcknowledgeType
Convenience class to determine what sort of alarms to include in a query. |
static class |
AlarmFactory.SortStyle
Convenience class to determine sort style of a query. |
| Method Summary | |
|---|---|
static void |
acknowledge(Alarm[] alarms,
java.lang.String user)
Acknowledge a list of alarms with the given username and the current time. |
static void |
acknowledge(Alarm[] alarms,
java.lang.String user,
java.util.Date time)
Acknowledge a list of alarms with the given username and the given time. |
static void |
acknowledge(Filter[] filters,
java.lang.String user)
Acknowledge with the given username and the current time all alarms that match the given filter criteria. |
static void |
acknowledge(Filter[] filters,
java.lang.String user,
java.util.Date time)
Acknowledge with the given username and the given time all alarms that match the given filter criteria. |
static void |
acknowledge(int[] alarmIds,
java.lang.String user)
Acknowledge a list of alarms with the given username and the current time. |
static void |
acknowledge(int[] alarmIds,
java.lang.String user,
java.util.Date time)
Acknowledge a list of alarms with the given username and the given time. |
static void |
acknowledgeAll(java.lang.String user)
Acknowledge all unacknowledged alarms with the given username and the given time. |
static void |
acknowledgeAll(java.lang.String user,
java.util.Date time)
Acknowledge all unacknowledged alarms with the given username and the given time. |
protected static java.lang.String |
getAcknowledgeTypeClause(AlarmFactory.AcknowledgeType ackType)
Convenience method for getting the SQL ORDER BY clause related to a given sort style. |
static int |
getAlarmCount()
Count all outstanding (unacknowledged) alarms. |
static int |
getAlarmCount(AlarmFactory.AcknowledgeType ackType,
Filter[] filters)
Count the number of alarms for a given acknowledgement type. |
static int[] |
getAlarmCountBySeverity(AlarmFactory.AcknowledgeType ackType,
Filter[] filters)
Count the number of alarms for a given acknowledgement type. |
static int |
getAlarmCountForInterface(int nodeId,
java.lang.String ipAddress,
AlarmFactory.AcknowledgeType ackType)
Return the number of alarms for this node ID, IP address, and the given acknowledgement type. |
static int |
getAlarmCountForInterface(java.lang.String ipAddress,
AlarmFactory.AcknowledgeType ackType)
Return the number of alarms for this IP address and the given acknowledgement type. |
static int |
getAlarmCountForNode(int nodeId,
AlarmFactory.AcknowledgeType ackType)
Return the number of alarms for this node and the given acknowledgement type. |
static int |
getAlarmCountForService(int serviceId,
AlarmFactory.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,
java.lang.String ipAddress,
int serviceId,
AlarmFactory.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(AlarmFactory.AcknowledgeType ackType)
Return all unacknowledged or acknowledged alarms sorted by time. |
static Alarm[] |
getAlarms(AlarmFactory.SortStyle sortStyle)
Return all unacknowledged alarms sorted by the given sort style. |
static Alarm[] |
getAlarms(AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm[] |
getAlarms(AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
Filter[] filters)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm[] |
getAlarms(AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
Filter[] filters,
int limit,
int offset)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm[] |
getAlarms(AlarmFactory.SortStyle sortStyle,
boolean includeAcknowledged)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style. |
static Alarm |
getAlarms(int alarmId)
Return a specific alarm. |
static Alarm[] |
getAlarmsForInterface(int nodeId,
java.lang.String ipAddress)
Return all unacknowledged alarms sorted by event ID for the given interface. |
static Alarm[] |
getAlarmsForInterface(int nodeId,
java.lang.String ipAddress,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.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(java.lang.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(java.lang.String ipAddress,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.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[] |
getAlarmsForInterface(java.lang.String ipAddress,
boolean includeAcknowledged)
Deprecated. Replaced by " #getEventsForInterface(String,SortStyle,AcknowledgeType) getEventsForInterface( String, SortStyle, AcknowledgeType )" |
static Alarm[] |
getAlarmsForNode(int nodeId)
Return all unacknowledged alarms sorted by alarm ID for the given node. |
static Alarm[] |
getAlarmsForNode(int nodeId,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType)
Return all alarms (optionally only unacknowledged alarms) sorted by the given sort style for the given node. |
static Alarm[] |
getAlarmsForNode(int nodeId,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.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(java.lang.String poller)
Return all unacknowledged alarms sorted by time for that have the given distributed poller. |
static Alarm[] |
getAlarmsForPoller(java.lang.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,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.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 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 nodeId,
java.lang.String ipAddress,
int serviceId)
Return all unacknowledged alarms sorted by time for the given service. |
static Alarm[] |
getAlarmsForService(int nodeId,
java.lang.String ipAddress,
int serviceId,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.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,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType)
|
protected static java.lang.String |
getOrderByClause(AlarmFactory.SortStyle sortStyle)
Convenience method for getting the SQL ORDER BY clause related to a given sort style. |
protected static Alarm[] |
rs2Alarms(java.sql.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 java.sql.SQLException
java.sql.SQLException
public static int getAlarmCount(AlarmFactory.AcknowledgeType ackType,
Filter[] filters)
throws java.sql.SQLException
java.sql.SQLException
public static int[] getAlarmCountBySeverity(AlarmFactory.AcknowledgeType ackType,
Filter[] filters)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm getAlarms(int alarmId)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarms()
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarms(AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarms(AlarmFactory.SortStyle sortStyle)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarms(AlarmFactory.SortStyle sortStyle,
boolean includeAcknowledged)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarms(AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarms(AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
Filter[] filters)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarms(AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
Filter[] filters,
int limit,
int offset)
throws java.sql.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
java.sql.SQLException
public static Alarm[] getAlarmsForNode(int nodeId)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForNode(int nodeId,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForNode(int nodeId,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
int throttle,
int offset)
throws java.sql.SQLException
throttle - a value less than one means no throttling
java.sql.SQLException
public static int getAlarmCountForNode(int nodeId,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForInterface(int nodeId,
java.lang.String ipAddress)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForInterface(int nodeId,
java.lang.String ipAddress,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
int throttle,
int offset)
throws java.sql.SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
java.sql.SQLException
public static Alarm[] getAlarmsForInterface(java.lang.String ipAddress)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForInterface(java.lang.String ipAddress,
boolean includeAcknowledged)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForInterface(java.lang.String ipAddress,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
int throttle,
int offset)
throws java.sql.SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
java.sql.SQLException
public static int getAlarmCountForInterface(int nodeId,
java.lang.String ipAddress,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static int getAlarmCountForInterface(java.lang.String ipAddress,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForService(int nodeId,
java.lang.String ipAddress,
int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForService(int nodeId,
java.lang.String ipAddress,
int serviceId,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
int throttle,
int offset)
throws java.sql.SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
java.sql.SQLException
public static Alarm[] getAlarmsForService(int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForService(int serviceId,
boolean includeAcknowledged)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForService(int serviceId,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType,
int throttle,
int offset)
throws java.sql.SQLException
throttle - a value less than one means no throttlingoffset - which row to start on in the result list
java.sql.SQLException
public static int getAlarmCountForService(int nodeId,
java.lang.String ipAddress,
int serviceId,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static int getAlarmCountForService(int serviceId,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForSeverity(int severity)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForSeverity(int severity,
AlarmFactory.SortStyle sortStyle,
AlarmFactory.AcknowledgeType ackType)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForPoller(java.lang.String poller)
throws java.sql.SQLException
java.sql.SQLException
public static Alarm[] getAlarmsForPoller(java.lang.String poller,
boolean includeAcknowledged)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(Alarm[] alarms,
java.lang.String user)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(Alarm[] alarms,
java.lang.String user,
java.util.Date time)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(int[] alarmIds,
java.lang.String user)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(int[] alarmIds,
java.lang.String user,
java.util.Date time)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(Filter[] filters,
java.lang.String user)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(Filter[] filters,
java.lang.String user,
java.util.Date time)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledgeAll(java.lang.String user)
throws java.sql.SQLException
java.sql.SQLException
public static void acknowledgeAll(java.lang.String user,
java.util.Date time)
throws java.sql.SQLException
java.sql.SQLException
public static void unacknowledge(Alarm[] alarms)
throws java.sql.SQLException
java.sql.SQLException
public static void unacknowledge(int[] alarmIds)
throws java.sql.SQLException
java.sql.SQLException
public static void unacknowledge(Filter[] filters)
throws java.sql.SQLException
java.sql.SQLException
public static void unacknowledgeAll()
throws java.sql.SQLException
java.sql.SQLException
protected static Alarm[] rs2Alarms(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.ResultSet
containing event information into an array of Alarm
objects.
java.sql.SQLExceptionprotected static java.lang.String getOrderByClause(AlarmFactory.SortStyle sortStyle)
protected static java.lang.String getAcknowledgeTypeClause(AlarmFactory.AcknowledgeType ackType)
ackType - the acknowledge type to map to a clause
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||