public class AlarmFactory extends Object
Modifier and Type | Method and Description |
---|---|
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,
javax.servlet.ServletContext servletContext)
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,
javax.servlet.ServletContext servletContext)
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,
javax.servlet.ServletContext servletContext)
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,
javax.servlet.ServletContext servletContext)
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,
javax.servlet.ServletContext servletContext)
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,
javax.servlet.ServletContext servletContext)
Return all unacknowledged alarms sorted by alarm ID for the given node.
|
static Alarm[] |
getAlarmsForNode(int nodeId,
SortStyle sortStyle,
AcknowledgeType ackType,
int throttle,
int offset,
javax.servlet.ServletContext servletContext)
Return some maximum number of alarms or less (optionally only
unacknowledged alarms) sorted by the given sort style for the given node.
|
static Alarm[] |
getAlarmsForNode(int nodeId,
SortStyle sortStyle,
AcknowledgeType ackType,
javax.servlet.ServletContext servletContext)
Return all alarms (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,
javax.servlet.ServletContext servletContext)
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,
javax.servlet.ServletContext servletContext)
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)
getAlarmsForSeverity
|
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.
|
public static int getAlarmCount() throws SQLException
SQLException
- if any.public static int getAlarmCount(AcknowledgeType ackType, Filter[] filters) throws SQLException
ackType
- a AcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.SQLException
- if any.public static int[] getAlarmCountBySeverity(AcknowledgeType ackType, Filter[] filters) throws SQLException
ackType
- a AcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.SQLException
- if any.public static Alarm getAlarms(int alarmId) throws SQLException
alarmId
- a int.Alarm
object.SQLException
- if any.public static Alarm[] getAlarms() throws SQLException
Alarm
objects.SQLException
- if any.public static Alarm[] getAlarms(AcknowledgeType ackType) throws SQLException
ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarms(SortStyle sortStyle) throws SQLException
sortStyle
- a SortStyle
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarms(SortStyle sortStyle, boolean includeAcknowledged) throws SQLException
sortStyle
- a SortStyle
object.includeAcknowledged
- a boolean.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarms(SortStyle sortStyle, AcknowledgeType ackType) throws SQLException
sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarms(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters) throws SQLException
sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.Alarm
objects.SQLException
- if any.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 usedsortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForNode(int nodeId, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws SQLException
throttle
- a value less than one means no throttlingnodeId
- a int.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.offset
- a int.Alarm
objects.SQLException
- if any.public static int getAlarmCountForNode(int nodeId, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ackType
- a AcknowledgeType
object.SQLException
- if any.public static Alarm[] getAlarmsForInterface(int nodeId, String ipAddress, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForInterface(int nodeId, String ipAddress, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws SQLException
throttle
- a value less than one means no throttlingoffset
- which row to start on in the result listnodeId
- a int.ipAddress
- a String
object.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForInterface(String ipAddress) throws SQLException
ipAddress
- a String
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForInterface(String ipAddress, boolean includeAcknowledged) throws SQLException
ipAddress
- a String
object.includeAcknowledged
- a boolean.Alarm
objects.SQLException
- if any.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 listipAddress
- a String
object.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static int getAlarmCountForInterface(int nodeId, String ipAddress, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.ackType
- a AcknowledgeType
object.SQLException
- if any.public static int getAlarmCountForInterface(String ipAddress, AcknowledgeType ackType) throws SQLException
ipAddress
- a String
object.ackType
- a AcknowledgeType
object.SQLException
- if any.public static Alarm[] getAlarmsForService(int nodeId, String ipAddress, int serviceId, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.serviceId
- a int.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForService(int nodeId, String ipAddress, int serviceId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws SQLException
throttle
- a value less than one means no throttlingoffset
- which row to start on in the result listnodeId
- a int.ipAddress
- a String
object.serviceId
- a int.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForService(int serviceId) throws SQLException
serviceId
- a int.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForService(int serviceId, boolean includeAcknowledged) throws SQLException
serviceId
- a int.includeAcknowledged
- a boolean.Alarm
objects.SQLException
- if any.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 listserviceId
- a int.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static int getAlarmCountForService(int nodeId, String ipAddress, int serviceId, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.serviceId
- a int.ackType
- a AcknowledgeType
object.SQLException
- if any.public static int getAlarmCountForService(int serviceId, AcknowledgeType ackType) throws SQLException
serviceId
- a int.ackType
- a AcknowledgeType
object.SQLException
- if any.public static Alarm[] getAlarmsForSeverity(int severity) throws SQLException
severity
- a int.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForSeverity(int severity, SortStyle sortStyle, AcknowledgeType ackType) throws SQLException
getAlarmsForSeverity
severity
- a int.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForPoller(String poller) throws SQLException
poller
- a String
object.Alarm
objects.SQLException
- if any.public static Alarm[] getAlarmsForPoller(String poller, boolean includeAcknowledged) throws SQLException
poller
- a String
object.includeAcknowledged
- a boolean.Alarm
objects.SQLException
- if any.public static void acknowledge(Alarm[] alarms, String user) throws SQLException
alarms
- an array of Alarm
objects.user
- a String
object.SQLException
- if any.public static void acknowledge(Alarm[] alarms, String user, Date time) throws SQLException
alarms
- an array of Alarm
objects.user
- a String
object.time
- a java$util$Date object.SQLException
- if any.public static void acknowledge(int[] alarmIds, String user) throws SQLException
alarmIds
- an array of int.user
- a String
object.SQLException
- if any.public static void acknowledge(int[] alarmIds, String user, Date time) throws SQLException
alarmIds
- an array of int.user
- a String
object.time
- a java$util$Date object.SQLException
- if any.public static void acknowledge(Filter[] filters, String user) throws SQLException
filters
- an array of org$opennms$web$filter$Filter objects.user
- a String
object.SQLException
- if any.public static void acknowledge(Filter[] filters, String user, Date time) throws SQLException
filters
- an array of org$opennms$web$filter$Filter objects.user
- a String
object.time
- a java$util$Date object.SQLException
- if any.public static void acknowledgeAll(String user) throws SQLException
user
- a String
object.SQLException
- if any.public static void acknowledgeAll(String user, Date time) throws SQLException
user
- a String
object.time
- a java$util$Date object.SQLException
- if any.public static void unacknowledge(Alarm[] alarms) throws SQLException
alarms
- an array of Alarm
objects.SQLException
- if any.public static void unacknowledge(int[] alarmIds) throws SQLException
alarmIds
- an array of int.SQLException
- if any.public static void unacknowledge(Filter[] filters) throws SQLException
filters
- an array of org$opennms$web$filter$Filter objects.SQLException
- if any.public static void unacknowledgeAll() throws SQLException
SQLException
- if any.protected static Alarm[] rs2Alarms(ResultSet rs) throws SQLException
java.sql.ResultSet
containing event information into an array of Alarm
objects.rs
- a ResultSet
object.Alarm
objects.SQLException
- if any.public static void escalateAlarms(int[] alarmIds, String user) throws SQLException
alarmIds
- an array of int.user
- a String
object.SQLException
- if any.public static void escalateAlarms(int[] alarmIds, String user, Date time) throws SQLException
alarmIds
- an array of int.user
- a String
object.time
- a java$util$Date object.SQLException
- if any.public static void clearAlarms(int[] alarmIds, String user) throws SQLException
alarmIds
- an array of int.user
- a String
object.SQLException
- if any.public static void clearAlarms(int[] alarmIds, String user, Date time) throws SQLException
alarmIds
- an array of int.user
- a String
object.time
- a java$util$Date object.SQLException
- if any.Copyright © 2015. All Rights Reserved.