Package org.opennms.web.event
Class EventFactory
- java.lang.Object
-
- org.opennms.web.event.EventFactory
-
public class EventFactory extends java.lang.ObjectDeprecated.Use an injectedEventDaoimplementation insteadEncapsulates all querying functionality for events.- Author:
- Lawrence Karnowski
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidacknowledge(int[] eventIds, java.lang.String user)Deprecated.Acknowledge a list of events with the given username and the current time.static voidacknowledge(int[] eventIds, java.lang.String user, java.util.Date time)Deprecated.Acknowledge a list of events with the given username and the given time.static voidacknowledge(Event[] events, java.lang.String user)Deprecated.Acknowledge a list of events with the given username and the current time.static voidacknowledge(Event[] events, java.lang.String user, java.util.Date time)Deprecated.Acknowledge a list of events with the given username and the given time.static voidacknowledge(Filter[] filters, java.lang.String user)Deprecated.Acknowledge with the given username and the current time all events that match the given filter criteria.static voidacknowledge(Filter[] filters, java.lang.String user, java.util.Date time)Deprecated.Acknowledge with the given username and the given time all events that match the given filter criteria.static voidacknowledgeAll(java.lang.String user)Deprecated.Acknowledge all unacknowledged events with the given username and the given time.static voidacknowledgeAll(java.lang.String user, java.util.Date time)Deprecated.Acknowledge all unacknowledged events with the given username and the given time.protected static java.lang.StringgetAcknowledgeTypeClause(AcknowledgeType ackType)Deprecated.Convenience method for getting the SQL ORDER BY clause related to a given sort style.static EventgetEvent(int eventId)Deprecated.Return a specific event.static intgetEventCount()Deprecated.Count all outstanding (unacknowledged) events.static intgetEventCount(AcknowledgeType ackType, Filter[] filters)Deprecated.Count the number of events for a given acknowledgement type.static int[]getEventCountBySeverity(AcknowledgeType ackType, Filter[] filters)Deprecated.Count the number of events for a given acknowledgement type.static intgetEventCountForInterface(int nodeId, java.lang.String ipAddress, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)Deprecated.Return the number of events for this node ID, IP address, and the given acknowledgment type.static intgetEventCountForInterface(java.lang.String ipAddress, AcknowledgeType ackType)Deprecated.Return the number of events for this IP address and the given acknowledgment type.static intgetEventCountForNode(int nodeId, AcknowledgeType ackType)Deprecated.Return the number of events for this node and the given acknowledgment type.static intgetEventCountForService(int nodeId, java.lang.String ipAddress, int serviceId, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)Deprecated.Return the number of events for this node ID, IP address, service ID, and the given acknowledgement type.static intgetEventCountForService(int serviceId, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)Deprecated.Return the number of events for this node ID, IP address, service ID, and the given acknowledgement type.static Event[]getEvents()Deprecated.Return all unacknowledged events sorted by time.static Event[]getEvents(AcknowledgeType ackType)Deprecated.Return all unacknowledged or acknowledged events sorted by time.static Event[]getEvents(SortStyle sortStyle)Deprecated.Return all unacknowledged events sorted by the given sort style.static Event[]getEvents(SortStyle sortStyle, boolean includeAcknowledged)Deprecated.Replaced by {@link " #getEvents(SortStyle,AcknowledgeType) getEvents(SortStyle, AcknowledgeType)"}static Event[]getEvents(SortStyle sortStyle, AcknowledgeType ackType)Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style.static Event[]getEvents(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters)Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style.static Event[]getEvents(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, int limit, int offset)Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style.static Event[]getEventsForInterface(int nodeId, int ifIndex, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext)Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node and IP address.static Event[]getEventsForInterface(int nodeId, java.lang.String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)Deprecated.Replaced by {@link " #getEventsForInterface(int,String,SortStyle,AcknowledgeType) getEventsForInterface( int, String, SortStyle, AcknowledgeType )"}static Event[]getEventsForInterface(int nodeId, java.lang.String ipAddress, javax.servlet.ServletContext servletContext)Deprecated.Return all unacknowledged events sorted by event ID for the given interface.static Event[]getEventsForInterface(int nodeId, java.lang.String ipAddress, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext)Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node and IP address.static Event[]getEventsForInterface(java.lang.String ipAddress)Deprecated.Return all unacknowledged events sorted by time for that have the given IP address, regardless of what node they belong to.static Event[]getEventsForInterface(java.lang.String ipAddress, boolean includeAcknowledged)Deprecated.Replaced by {@link " #getEventsForInterface(String,SortStyle,AcknowledgeType) getEventsForInterface( String, SortStyle, AcknowledgeType )"}static Event[]getEventsForInterface(java.lang.String ipAddress, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset)Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given IP address.static Event[]getEventsForNode(int nodeId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)Deprecated.Replaced by {@link " #getEventsForNode(int,SortStyle,AcknowledgeType) getEventsForNode( int, SortStyle, AcknowledgeType )"}static Event[]getEventsForNode(int nodeId, javax.servlet.ServletContext servletContext)Deprecated.Return all unacknowledged events sorted by event ID for the given node.static Event[]getEventsForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext)Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node.static Event[]getEventsForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style for the given node.static Event[]getEventsForPoller(java.lang.String poller)Deprecated.Return all unacknowledged events sorted by time for that have the given distributed poller.static Event[]getEventsForPoller(java.lang.String poller, boolean includeAcknowledged)Deprecated.Return all events (optionally only unacknowledged events) sorted by time that have the given distributed poller.static Event[]getEventsForService(int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)Deprecated.Return all events (optionally only unacknowledged events) sorted by time for the given service type, regardless of what node or interface they belong to.static Event[]getEventsForService(int nodeId, java.lang.String ipAddress, int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)Deprecated.Replaced by {@link " #getEventsForService(int,String,int,SortStyle,AcknowledgeType,int,int) getEventsForService( int, String, int, SortStyle, AcknowledgeType, int, int )"}static Event[]getEventsForService(int nodeId, java.lang.String ipAddress, int serviceId, javax.servlet.ServletContext servletContext)Deprecated.Return all unacknowledged events sorted by time for the given service.static Event[]getEventsForService(int nodeId, java.lang.String ipAddress, int serviceId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext)Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node, IP address, and service ID.static Event[]getEventsForService(int serviceId, javax.servlet.ServletContext servletContext)Deprecated.Return all unacknowledged events sorted by time for the given service type, regardless of what node or interface they belong to.static Event[]getEventsForService(int serviceId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext)Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given service ID.static Event[]getEventsForSeverity(int severity)Deprecated.Return all unacknowledged events sorted by time for the given severity.static Event[]getEventsForSeverity(int severity, boolean includeAcknowledged)Deprecated.Replaced by {@link " #getEventsForSeverity(int,SortStyle,AcknowledgeType) getEventsForSeverity( int, SortStyle, AcknowledgeType )"}static Event[]getEventsForSeverity(int severity, SortStyle sortStyle, AcknowledgeType ackType)Deprecated.getEventsForSeverityprotected static java.lang.StringgetOrderByClause(SortStyle sortStyle)Deprecated.Convenience method for getting the SQL ORDER BY clause related to a given sort style.static java.util.Map<java.lang.String,java.lang.String>getParmsForEventId(int eventId)Deprecated.protected static Event[]rs2Events(java.sql.ResultSet rs)Deprecated.Convenience method for translating ajava.sql.ResultSetcontaining event information into an array ofEventobjects.static voidunacknowledge(int[] eventIds)Deprecated.Unacknowledge a list of events.static voidunacknowledge(Event[] events)Deprecated.Unacknowledge a list of events.static voidunacknowledge(Filter[] filters)Deprecated.Unacknowledge events that match the given filter criteria.static voidunacknowledgeAll()Deprecated.Unacknowledge all acknowledged events.
-
-
-
Method Detail
-
getEventCount
public static int getEventCount() throws java.sql.SQLExceptionDeprecated.Count all outstanding (unacknowledged) events.- Returns:
- a int.
- Throws:
java.sql.SQLException- if any.
-
getEventCount
public static int getEventCount(AcknowledgeType ackType, Filter[] filters) throws java.sql.SQLException
Deprecated.Count the number of events for a given acknowledgement type.- Parameters:
ackType- aAcknowledgeTypeobject.filters- an array of org$opennms$web$filter$Filter objects.- Returns:
- a int.
- Throws:
java.sql.SQLException- if any.
-
getEventCountBySeverity
public static int[] getEventCountBySeverity(AcknowledgeType ackType, Filter[] filters) throws java.sql.SQLException
Deprecated.Count the number of events for a given acknowledgement type.- Parameters:
ackType- aAcknowledgeTypeobject.filters- an array of org$opennms$web$filter$Filter objects.- Returns:
- An array of event counts. Each index of the array corresponds to the event severity for the counts (indeterminate is 1, critical is 7, etc).
- Throws:
java.sql.SQLException- if any.
-
getEvent
public static Event getEvent(int eventId) throws java.sql.SQLException
Deprecated.Return a specific event.- Parameters:
eventId- a int.- Returns:
- a
Eventobject. - Throws:
java.sql.SQLException- if any.
-
getParmsForEventId
public static java.util.Map<java.lang.String,java.lang.String> getParmsForEventId(int eventId) throws java.sql.SQLExceptionDeprecated.- Throws:
java.sql.SQLException
-
getEvents
public static Event[] getEvents() throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by time.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEvents
public static Event[] getEvents(AcknowledgeType ackType) throws java.sql.SQLException
Deprecated.Return all unacknowledged or acknowledged events sorted by time.- Parameters:
ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEvents
public static Event[] getEvents(SortStyle sortStyle) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by the given sort style.
-
getEvents
public static Event[] getEvents(SortStyle sortStyle, boolean includeAcknowledged) throws java.sql.SQLException
Deprecated.Replaced by {@link " #getEvents(SortStyle,AcknowledgeType) getEvents(SortStyle, AcknowledgeType)"}Return all events (optionally only unacknowledged events) sorted by the given sort style.
-
getEvents
public static Event[] getEvents(SortStyle sortStyle, AcknowledgeType ackType) throws java.sql.SQLException
Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style.- Parameters:
sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEvents
public static Event[] getEvents(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters) throws java.sql.SQLException
Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style.- Parameters:
sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.filters- an array of org$opennms$web$filter$Filter objects.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEvents
public static Event[] getEvents(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, int limit, int offset) throws java.sql.SQLException
Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style.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.
- Parameters:
limit- if -1 or zero, no limit or offset is usedoffset- if -1, no limit or offset if usedsortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.filters- an array of org$opennms$web$filter$Filter objects.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForNode
public static Event[] getEventsForNode(int nodeId, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by event ID for the given node.- Parameters:
nodeId- a int.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForNode
public static Event[] getEventsForNode(int nodeId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Replaced by {@link " #getEventsForNode(int,SortStyle,AcknowledgeType) getEventsForNode( int, SortStyle, AcknowledgeType )"}Return all events (optionally only unacknowledged events) sorted by event ID for the given node.- Parameters:
nodeId- a int.includeAcknowledged- a boolean.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForNode
public static Event[] getEventsForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return all events (optionally only unacknowledged events) sorted by the given sort style for the given node.- Parameters:
nodeId- a int.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForNode
public static Event[] getEventsForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node.- Parameters:
throttle- a value less than one means no throttlingnodeId- a int.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.offset- a int.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventCountForNode
public static int getEventCountForNode(int nodeId, AcknowledgeType ackType) throws java.sql.SQLExceptionDeprecated.Return the number of events for this node and the given acknowledgment type.- Parameters:
nodeId- a int.ackType- aAcknowledgeTypeobject.- Returns:
- a int.
- Throws:
java.sql.SQLException- if any.
-
getEventsForInterface
public static Event[] getEventsForInterface(int nodeId, java.lang.String ipAddress, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by event ID for the given interface.- Parameters:
nodeId- a int.ipAddress- aStringobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForInterface
public static Event[] getEventsForInterface(int nodeId, java.lang.String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Replaced by {@link " #getEventsForInterface(int,String,SortStyle,AcknowledgeType) getEventsForInterface( int, String, SortStyle, AcknowledgeType )"}Return all events (optionally only unacknowledged events) sorted by time for the given interface.- Parameters:
nodeId- a int.ipAddress- aStringobject.includeAcknowledged- a boolean.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForInterface
public static Event[] getEventsForInterface(int nodeId, java.lang.String ipAddress, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node and IP address.- Parameters:
throttle- a value less than one means no throttlingoffset- which row to start on in the result listnodeId- a int.ipAddress- aStringobject.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForInterface
public static Event[] getEventsForInterface(int nodeId, int ifIndex, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node and IP address.- Parameters:
throttle- a value less than one means no throttlingoffset- which row to start on in the result listnodeId- a int.ifIndex- a int.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForInterface
public static Event[] getEventsForInterface(java.lang.String ipAddress) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by time for that have the given IP address, regardless of what node they belong to.- Parameters:
ipAddress- aStringobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForInterface
public static Event[] getEventsForInterface(java.lang.String ipAddress, boolean includeAcknowledged) throws java.sql.SQLException
Deprecated.Replaced by {@link " #getEventsForInterface(String,SortStyle,AcknowledgeType) getEventsForInterface( String, SortStyle, AcknowledgeType )"}Return all events (optionally only unacknowledged events) sorted by time that have the given IP address, regardless of what node they belong to.- Parameters:
ipAddress- aStringobject.includeAcknowledged- a boolean.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForInterface
public static Event[] getEventsForInterface(java.lang.String ipAddress, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset) throws java.sql.SQLException
Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given IP address.- Parameters:
throttle- a value less than one means no throttlingoffset- which row to start on in the result listipAddress- aStringobject.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventCountForInterface
public static int getEventCountForInterface(int nodeId, java.lang.String ipAddress, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws java.sql.SQLExceptionDeprecated.Return the number of events for this node ID, IP address, and the given acknowledgment type.- Parameters:
nodeId- a int.ipAddress- aStringobject.ackType- aAcknowledgeTypeobject.- Returns:
- a int.
- Throws:
java.sql.SQLException- if any.
-
getEventCountForInterface
public static int getEventCountForInterface(java.lang.String ipAddress, AcknowledgeType ackType) throws java.sql.SQLExceptionDeprecated.Return the number of events for this IP address and the given acknowledgment type.- Parameters:
ipAddress- aStringobject.ackType- aAcknowledgeTypeobject.- Returns:
- a int.
- Throws:
java.sql.SQLException- if any.
-
getEventsForService
public static Event[] getEventsForService(int nodeId, java.lang.String ipAddress, int serviceId, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by time for the given service.- Parameters:
nodeId- a int.ipAddress- aStringobject.serviceId- a int.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForService
public static Event[] getEventsForService(int nodeId, java.lang.String ipAddress, int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Replaced by {@link " #getEventsForService(int,String,int,SortStyle,AcknowledgeType,int,int) getEventsForService( int, String, int, SortStyle, AcknowledgeType, int, int )"}Return all events (optionally only unacknowledged events) sorted by time for the given service.- Parameters:
nodeId- a int.ipAddress- aStringobject.serviceId- a int.includeAcknowledged- a boolean.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForService
public static Event[] getEventsForService(int nodeId, java.lang.String ipAddress, int serviceId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given node, IP address, and service ID.- Parameters:
throttle- a value less than one means no throttlingoffset- which row to start on in the result listnodeId- a int.ipAddress- aStringobject.serviceId- a int.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForService
public static Event[] getEventsForService(int serviceId, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by time for the given service type, regardless of what node or interface they belong to.- Parameters:
serviceId- a int.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForService
public static Event[] getEventsForService(int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return all events (optionally only unacknowledged events) sorted by time for the given service type, regardless of what node or interface they belong to.- Parameters:
serviceId- a int.includeAcknowledged- a boolean.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForService
public static Event[] getEventsForService(int serviceId, SortStyle sortStyle, AcknowledgeType ackType, int throttle, int offset, javax.servlet.ServletContext servletContext) throws java.sql.SQLException
Deprecated.Return some maximum number of events or less (optionally only unacknowledged events) sorted by the given sort style for the given service ID.- Parameters:
throttle- a value less than one means no throttlingoffset- which row to start on in the result listserviceId- a int.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventCountForService
public static int getEventCountForService(int nodeId, java.lang.String ipAddress, int serviceId, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws java.sql.SQLExceptionDeprecated.Return the number of events for this node ID, IP address, service ID, and the given acknowledgement type.- Parameters:
nodeId- a int.ipAddress- aStringobject.serviceId- a int.ackType- aAcknowledgeTypeobject.- Returns:
- a int.
- Throws:
java.sql.SQLException- if any.
-
getEventCountForService
public static int getEventCountForService(int serviceId, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws java.sql.SQLExceptionDeprecated.Return the number of events for this node ID, IP address, service ID, and the given acknowledgement type.- Parameters:
serviceId- a int.ackType- aAcknowledgeTypeobject.- Returns:
- a int.
- Throws:
java.sql.SQLException- if any.
-
getEventsForSeverity
public static Event[] getEventsForSeverity(int severity) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by time for the given severity.- Parameters:
severity- a int.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForSeverity
public static Event[] getEventsForSeverity(int severity, boolean includeAcknowledged) throws java.sql.SQLException
Deprecated.Replaced by {@link " #getEventsForSeverity(int,SortStyle,AcknowledgeType) getEventsForSeverity( int, SortStyle, AcknowledgeType )"}Return all events (optionally only unacknowledged events) sorted by time for the given severity.- Parameters:
severity- a int.includeAcknowledged- a boolean.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForSeverity
public static Event[] getEventsForSeverity(int severity, SortStyle sortStyle, AcknowledgeType ackType) throws java.sql.SQLException
Deprecated.getEventsForSeverity
- Parameters:
severity- a int.sortStyle- aSortStyleobject.ackType- aAcknowledgeTypeobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForPoller
public static Event[] getEventsForPoller(java.lang.String poller) throws java.sql.SQLException
Deprecated.Return all unacknowledged events sorted by time for that have the given distributed poller.- Parameters:
poller- aStringobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getEventsForPoller
public static Event[] getEventsForPoller(java.lang.String poller, boolean includeAcknowledged) throws java.sql.SQLException
Deprecated.Return all events (optionally only unacknowledged events) sorted by time that have the given distributed poller.- Parameters:
poller- aStringobject.includeAcknowledged- a boolean.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
acknowledge
public static void acknowledge(Event[] events, java.lang.String user) throws java.sql.SQLException
Deprecated.Acknowledge a list of events with the given username and the current time.- Parameters:
events- an array ofEventobjects.user- aStringobject.- Throws:
java.sql.SQLException- if any.
-
acknowledge
public static void acknowledge(Event[] events, java.lang.String user, java.util.Date time) throws java.sql.SQLException
Deprecated.Acknowledge a list of events with the given username and the given time.- Parameters:
events- an array ofEventobjects.user- aStringobject.time- a java$util$Date object.- Throws:
java.sql.SQLException- if any.
-
acknowledge
public static void acknowledge(int[] eventIds, java.lang.String user) throws java.sql.SQLExceptionDeprecated.Acknowledge a list of events with the given username and the current time.- Parameters:
eventIds- an array of int.user- aStringobject.- Throws:
java.sql.SQLException- if any.
-
acknowledge
public static void acknowledge(int[] eventIds, java.lang.String user, java.util.Date time) throws java.sql.SQLExceptionDeprecated.Acknowledge a list of events with the given username and the given time.- Parameters:
eventIds- an array of int.user- aStringobject.time- a java$util$Date object.- Throws:
java.sql.SQLException- if any.
-
acknowledge
public static void acknowledge(Filter[] filters, java.lang.String user) throws java.sql.SQLException
Deprecated.Acknowledge with the given username and the current time all events that match the given filter criteria.- Parameters:
filters- an array of org$opennms$web$filter$Filter objects.user- aStringobject.- Throws:
java.sql.SQLException- if any.
-
acknowledge
public static void acknowledge(Filter[] filters, java.lang.String user, java.util.Date time) throws java.sql.SQLException
Deprecated.Acknowledge with the given username and the given time all events that match the given filter criteria.- Parameters:
filters- an array of org$opennms$web$filter$Filter objects.user- aStringobject.time- a java$util$Date object.- Throws:
java.sql.SQLException- if any.
-
acknowledgeAll
public static void acknowledgeAll(java.lang.String user) throws java.sql.SQLExceptionDeprecated.Acknowledge all unacknowledged events with the given username and the given time.- Parameters:
user- aStringobject.- Throws:
java.sql.SQLException- if any.
-
acknowledgeAll
public static void acknowledgeAll(java.lang.String user, java.util.Date time) throws java.sql.SQLExceptionDeprecated.Acknowledge all unacknowledged events with the given username and the given time.- Parameters:
user- aStringobject.time- a java$util$Date object.- Throws:
java.sql.SQLException- if any.
-
unacknowledge
public static void unacknowledge(Event[] events) throws java.sql.SQLException
Deprecated.Unacknowledge a list of events.- Parameters:
events- an array ofEventobjects.- Throws:
java.sql.SQLException- if any.
-
unacknowledge
public static void unacknowledge(int[] eventIds) throws java.sql.SQLExceptionDeprecated.Unacknowledge a list of events.- Parameters:
eventIds- an array of int.- Throws:
java.sql.SQLException- if any.
-
unacknowledge
public static void unacknowledge(Filter[] filters) throws java.sql.SQLException
Deprecated.Unacknowledge events that match the given filter criteria.- Parameters:
filters- an array of org$opennms$web$filter$Filter objects.- Throws:
java.sql.SQLException- if any.
-
unacknowledgeAll
public static void unacknowledgeAll() throws java.sql.SQLExceptionDeprecated.Unacknowledge all acknowledged events.- Throws:
java.sql.SQLException- if any.
-
rs2Events
protected static Event[] rs2Events(java.sql.ResultSet rs) throws java.sql.SQLException
Deprecated.Convenience method for translating ajava.sql.ResultSetcontaining event information into an array ofEventobjects.- Parameters:
rs- aResultSetobject.- Returns:
- an array of
Eventobjects. - Throws:
java.sql.SQLException- if any.
-
getOrderByClause
protected static java.lang.String getOrderByClause(SortStyle sortStyle)
Deprecated.Convenience method for getting the SQL ORDER BY clause related to a given sort style.- Parameters:
sortStyle- aSortStyleobject.- Returns:
- a
Stringobject.
-
getAcknowledgeTypeClause
protected static java.lang.String getAcknowledgeTypeClause(AcknowledgeType ackType)
Deprecated.Convenience method for getting the SQL ORDER BY clause related to a given sort style.- Parameters:
ackType- the acknowledge type to map to a clause- Returns:
- a
Stringobject.
-
-