public class NoticeFactory extends Object
Modifier and Type | Method and Description |
---|---|
static void |
acknowledge(int[] noticeIds,
String user)
Acknowledge a list of notices with the given username and the current
time.
|
static void |
acknowledge(int[] noticeIds,
String user,
Date time)
Acknowledge a list of notices with the given username and the given time.
|
static void |
acknowledge(Notification[] notices,
String user)
Acknowledge a list of notices with the given username
|
static void |
acknowledge(Notification[] notices,
String user,
Date time)
Acknowledge a list of notices with the given username and the given time.
|
static boolean |
canDisplayEvent(int eventId)
This method determines the log status of an event associated with a
notification
|
static Notification |
getNotice(int noticeId,
javax.servlet.ServletContext servletContext)
Return a specific notice.
|
static int |
getNoticeCount(AcknowledgeType ackType,
Filter[] filters)
Count the number of notices for a given acknowledgement type.
|
static Notification[] |
getNotices(AcknowledgeType ackType,
javax.servlet.ServletContext servletContext)
Return all unacknowledged or acknowledged notices sorted by id.
|
static Notification[] |
getNotices(javax.servlet.ServletContext servletContext)
Return all unacknowledged notices sorted by id.
|
static Notification[] |
getNotices(SortStyle sortStyle,
AcknowledgeType ackType,
Filter[] filters,
int limit,
int offset,
javax.servlet.ServletContext servletContext)
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)
Return all notices (optionally only unacknowledged notices) sorted by the
given sort style.
|
static Notification[] |
getNotices(SortStyle sortStyle,
AcknowledgeType ackType,
javax.servlet.ServletContext servletContext)
Return all notices (optionally only unacknowledged notices) sorted by the
given sort style.
|
static Notification[] |
getNotices(SortStyle sortStyle,
boolean includeAcknowledged,
javax.servlet.ServletContext servletContext)
Deprecated.
Replaced by
" #getNotices(SortStyle,AcknowledgeType) getNotices( SortStyle, AcknowledgeType )"
|
static Notification[] |
getNotices(SortStyle sortStyle,
javax.servlet.ServletContext servletContext)
Return all unacknowledged notices sorted by the given sort style.
|
static Notification[] |
getNoticesForInterface(int nodeId,
String ipAddress,
boolean includeAcknowledged,
javax.servlet.ServletContext servletContext)
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)
Return all unacknowledged notices for the given interface.
|
static Notification[] |
getNoticesForInterface(String ipAddress,
boolean includeAcknowledged,
javax.servlet.ServletContext servletContext)
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)
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
" #getNoticesForNode(int,SortStyle,AcknowledgeType) getNoticesForNode( int, SortStyle, AcknowledgeType )"
|
static Notification[] |
getNoticesForNode(int nodeId,
javax.servlet.ServletContext servletContext)
Return all unacknowledged notices sorted by time for the given node.
|
static Notification[] |
getNoticesForNode(int nodeId,
SortStyle sortStyle,
AcknowledgeType ackType,
javax.servlet.ServletContext servletContext)
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)
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 serviceId,
javax.servlet.ServletContext servletContext)
Return all unacknowledged notices sorted by time 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)
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)
Return all unacknowledged notices sorted by time for the given service.
|
protected static Notification[] |
rs2Notices(ResultSet rs,
javax.servlet.ServletContext servletContext)
Convenience method for translating a
java.sql.ResultSet
containing notice information into an array of Notification
objects. |
public static int getNoticeCount(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 Notification getNotice(int noticeId, javax.servlet.ServletContext servletContext) throws SQLException
noticeId
- a int.Notification
object.SQLException
- if any.public static boolean canDisplayEvent(int eventId)
eventId
- the unique id of the event from the noticepublic static Notification[] getNotices(javax.servlet.ServletContext servletContext) throws SQLException
Notification
objects.SQLException
- if any.public static Notification[] getNotices(AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
ackType
- a AcknowledgeType
object.Notification
objects.SQLException
- if any.public static Notification[] getNotices(SortStyle sortStyle, javax.servlet.ServletContext servletContext) throws SQLException
sortStyle
- a SortStyle
object.Notification
objects.SQLException
- if any.public static Notification[] getNotices(SortStyle sortStyle, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
sortStyle
- a SortStyle
object.includeAcknowledged
- a boolean.Notification
objects.SQLException
- if any.public static Notification[] getNotices(SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Notification
objects.SQLException
- if any.public static Notification[] getNotices(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, javax.servlet.ServletContext servletContext) throws SQLException
sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.filters
- an array of org$opennms$web$filter$Filter objects.Notification
objects.SQLException
- if any.public static Notification[] getNotices(SortStyle sortStyle, AcknowledgeType ackType, Filter[] filters, int limit, int offset, javax.servlet.ServletContext servletContext) 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.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForNode(int nodeId, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForNode(int nodeId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.includeAcknowledged
- a boolean.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForNode(int nodeId, SortStyle sortStyle, AcknowledgeType ackType, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.sortStyle
- a SortStyle
object.ackType
- a AcknowledgeType
object.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForInterface(int nodeId, String ipAddress, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForInterface(int nodeId, String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.includeAcknowledged
- a boolean.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForInterface(String ipAddress, javax.servlet.ServletContext servletContext) throws SQLException
ipAddress
- a String
object.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForInterface(String ipAddress, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
ipAddress
- a String
object.includeAcknowledged
- a boolean.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForService(int nodeId, String ipAddress, int serviceId, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.serviceId
- a int.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForService(int nodeId, String ipAddress, int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
nodeId
- a int.ipAddress
- a String
object.serviceId
- a int.includeAcknowledged
- a boolean.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForService(int serviceId, javax.servlet.ServletContext servletContext) throws SQLException
serviceId
- a int.Notification
objects.SQLException
- if any.public static Notification[] getNoticesForService(int serviceId, boolean includeAcknowledged, javax.servlet.ServletContext servletContext) throws SQLException
serviceId
- a int.includeAcknowledged
- a boolean.Notification
objects.SQLException
- if any.public static void acknowledge(Notification[] notices, String user) throws SQLException
notices
- an array of Notification
objects.user
- a String
object.SQLException
- if any.public static void acknowledge(Notification[] notices, String user, Date time) throws SQLException
notices
- an array of Notification
objects.user
- a String
object.time
- a java$util$Date object.SQLException
- if any.public static void acknowledge(int[] noticeIds, String user) throws SQLException
noticeIds
- an array of int.user
- a String
object.SQLException
- if any.public static void acknowledge(int[] noticeIds, String user, Date time) throws SQLException
noticeIds
- an array of int.user
- a String
object.time
- a java$util$Date object.SQLException
- if any.protected static Notification[] rs2Notices(ResultSet rs, javax.servlet.ServletContext servletContext) throws SQLException
java.sql.ResultSet
containing notice information into an array of Notification
objects.rs
- a ResultSet
object.Notification
objects.SQLException
- if any.Copyright © 2017. All rights reserved.