Package org.opennms.web.notification
Class NoticeFactory
- java.lang.Object
-
- org.opennms.web.notification.NoticeFactory
-
public class NoticeFactory extends Object
Deprecated.Use an injectedNotificationDao
implementation insteadEncapsulates all querying functionality for notices- Author:
- Lawrence Karnowski
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
acknowledge(int[] noticeIds, String user)
Deprecated.Acknowledge a list of notices with the given username and the current time.static void
acknowledge(int[] noticeIds, String user, Date time)
Deprecated.Acknowledge a list of notices with the given username and the given time.static void
acknowledge(Notification[] notices, String user)
Deprecated.Acknowledge a list of notices with the given usernamestatic void
acknowledge(Notification[] notices, String user, Date time)
Deprecated.Acknowledge a list of notices with the given username and the given time.static boolean
canDisplayEvent(int eventId)
Deprecated.This method determines the log status of an event associated with a notificationstatic Notification
getNotice(int noticeId, javax.servlet.ServletContext servletContext)
Deprecated.Return a specific notice.static int
getNoticeCount(AcknowledgeType ackType, Filter[] filters)
Deprecated.Count the number of notices for a given acknowledgement type.static Notification[]
getNotices(javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged notices sorted by id.static Notification[]
getNotices(AcknowledgeType ackType, javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged or acknowledged notices sorted by id.static Notification[]
getNotices(SortStyle sortStyle, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
Deprecated.Replaced by {@link " #getNotices(SortStyle,AcknowledgeType) getNotices( SortStyle, AcknowledgeType )"}static Notification[]
getNotices(SortStyle sortStyle, javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged notices sorted by the given sort style.static Notification[]
getNotices(SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by the given sort style.static Notification[]
getNotices(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, int limit, int offset, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by the given sort style.static Notification[]
getNotices(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by the given sort style.static Notification[]
getNoticesForInterface(int nodeId, String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by id for the given interface.static Notification[]
getNoticesForInterface(int nodeId, String ipAddress, javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged notices for the given interface.static Notification[]
getNoticesForInterface(String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by id that have the given IP address, regardless of what node they belong to.static Notification[]
getNoticesForInterface(String ipAddress, javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged notices sorted by time for that have the given IP address, regardless of what node they belong to.static Notification[]
getNoticesForNode(int nodeId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
Deprecated.Replaced by {@link " #getNoticesForNode(int,SortStyle,AcknowledgeType) getNoticesForNode( int, SortStyle, AcknowledgeType )"}static Notification[]
getNoticesForNode(int nodeId, javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged notices sorted by time for the given node.static Notification[]
getNoticesForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by given sort style for the given node.static Notification[]
getNoticesForService(int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by id for the given service type, regardless of what node or interface they belong to.static Notification[]
getNoticesForService(int nodeId, String ipAddress, int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext)
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by time for the given service.static Notification[]
getNoticesForService(int nodeId, String ipAddress, int serviceId, javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged notices sorted by time for the given service.static Notification[]
getNoticesForService(int serviceId, javax.servlet.ServletContext servletContext)
Deprecated.Return all unacknowledged notices sorted by time for the given service type, regardless of what node or interface they belong to.protected static Notification[]
rs2Notices(ResultSet rs, javax.servlet.ServletContext servletContext)
Deprecated.Convenience method for translating ajava.sql.ResultSet
containing notice information into an array ofNotification
objects.
-
-
-
Method Detail
-
getNoticeCount
public static int getNoticeCount(AcknowledgeType ackType, Filter[] filters) throws SQLException
Deprecated.Count the number of notices for a given acknowledgement type.- Parameters:
ackType
- aAcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.- Returns:
- a int.
- Throws:
SQLException
- if any.
-
getNotice
public static Notification getNotice(int noticeId, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return a specific notice.- Parameters:
noticeId
- a int.- Returns:
- a
Notification
object. - Throws:
SQLException
- if any.
-
canDisplayEvent
public static boolean canDisplayEvent(int eventId)
Deprecated.This method determines the log status of an event associated with a notification- Parameters:
eventId
- the unique id of the event from the notice- Returns:
- true if the event is display, false if log only
-
getNotices
public static Notification[] getNotices(javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged notices sorted by id.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNotices
public static Notification[] getNotices(AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged or acknowledged notices sorted by id.- Parameters:
ackType
- aAcknowledgeType
object.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNotices
public static Notification[] getNotices(SortStyle sortStyle, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged notices sorted by the given sort style.- Parameters:
sortStyle
- aSortStyle
object.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNotices
public static Notification[] getNotices(SortStyle sortStyle, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Replaced by {@link " #getNotices(SortStyle,AcknowledgeType) getNotices( SortStyle, AcknowledgeType )"}Return all notices (optionally only unacknowledged notices) sorted by the given sort style.- Parameters:
sortStyle
- aSortStyle
object.includeAcknowledged
- a boolean.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNotices
public static Notification[] getNotices(SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by the given sort style.- Parameters:
sortStyle
- aSortStyle
object.ackType
- aAcknowledgeType
object.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNotices
public static Notification[] getNotices(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by the given sort style.- Parameters:
sortStyle
- aSortStyle
object.ackType
- aAcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNotices
public static Notification[] getNotices(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, int limit, int offset, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) 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
- aSortStyle
object.ackType
- aAcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForNode
public static Notification[] getNoticesForNode(int nodeId, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged notices sorted by time for the given node.- Parameters:
nodeId
- a int.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForNode
public static Notification[] getNoticesForNode(int nodeId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Replaced by {@link " #getNoticesForNode(int,SortStyle,AcknowledgeType) getNoticesForNode( int, SortStyle, AcknowledgeType )"}Return all notices (optionally only unacknowledged notices) sorted by id for the given node.- Parameters:
nodeId
- a int.includeAcknowledged
- a boolean.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForNode
public static Notification[] getNoticesForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by given sort style for the given node.- Parameters:
nodeId
- a int.sortStyle
- aSortStyle
object.ackType
- aAcknowledgeType
object.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForInterface
public static Notification[] getNoticesForInterface(int nodeId, String ipAddress, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged notices for the given interface.- Parameters:
nodeId
- a int.ipAddress
- aString
object.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForInterface
public static Notification[] getNoticesForInterface(int nodeId, String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by id for the given interface.- Parameters:
nodeId
- a int.ipAddress
- aString
object.includeAcknowledged
- a boolean.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForInterface
public static Notification[] getNoticesForInterface(String ipAddress, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged notices sorted by time for that have the given IP address, regardless of what node they belong to.- Parameters:
ipAddress
- aString
object.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForInterface
public static Notification[] getNoticesForInterface(String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by id that have the given IP address, regardless of what node they belong to.- Parameters:
ipAddress
- aString
object.includeAcknowledged
- a boolean.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForService
public static Notification[] getNoticesForService(int nodeId, String ipAddress, int serviceId, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged notices sorted by time for the given service.- Parameters:
nodeId
- a int.ipAddress
- aString
object.serviceId
- a int.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForService
public static Notification[] getNoticesForService(int nodeId, String ipAddress, int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by time for the given service.- Parameters:
nodeId
- a int.ipAddress
- aString
object.serviceId
- a int.includeAcknowledged
- a boolean.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForService
public static Notification[] getNoticesForService(int serviceId, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all unacknowledged notices 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
Notification
objects. - Throws:
SQLException
- if any.
-
getNoticesForService
public static Notification[] getNoticesForService(int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Return all notices (optionally only unacknowledged notices) sorted by id 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
Notification
objects. - Throws:
SQLException
- if any.
-
acknowledge
public static void acknowledge(Notification[] notices, String user) throws SQLException
Deprecated.Acknowledge a list of notices with the given username- Parameters:
notices
- an array ofNotification
objects.user
- aString
object.- Throws:
SQLException
- if any.
-
acknowledge
public static void acknowledge(Notification[] notices, String user, Date time) throws SQLException
Deprecated.Acknowledge a list of notices with the given username and the given time.- Parameters:
notices
- an array ofNotification
objects.user
- aString
object.time
- a java$util$Date object.- Throws:
SQLException
- if any.
-
acknowledge
public static void acknowledge(int[] noticeIds, String user) throws SQLException
Deprecated.Acknowledge a list of notices with the given username and the current time.- Parameters:
noticeIds
- an array of int.user
- aString
object.- Throws:
SQLException
- if any.
-
acknowledge
public static void acknowledge(int[] noticeIds, String user, Date time) throws SQLException
Deprecated.Acknowledge a list of notices with the given username and the given time.- Parameters:
noticeIds
- an array of int.user
- aString
object.time
- a java$util$Date object.- Throws:
SQLException
- if any.
-
rs2Notices
protected static Notification[] rs2Notices(ResultSet rs, javax.servlet.ServletContext servletContext) throws SQLException
Deprecated.Convenience method for translating ajava.sql.ResultSet
containing notice information into an array ofNotification
objects.- Parameters:
rs
- aResultSet
object.- Returns:
- an array of
Notification
objects. - Throws:
SQLException
- if any.
-
-