|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.web.notification.NoticeFactory
Encapsulates all querying functionality for notices
Nested Class Summary | |
static class |
NoticeFactory.AcknowledgeType
Convenience class to determine what sort of notices to include in a query. |
static interface |
NoticeFactory.Filter
Convenience class to determine what sort of notices to include in a query. |
static class |
NoticeFactory.InterfaceFilter
Encapsulates all interface filtering functionality. |
static class |
NoticeFactory.NodeFilter
Encapsulates all node filtering functionality. |
static class |
NoticeFactory.ResponderFilter
Encapsulates all responder filtering functionality. |
static class |
NoticeFactory.ServiceFilter
Encapsulates all service filtering functionality. |
static class |
NoticeFactory.SortStyle
Convenience class to determine sort style of a query. |
static class |
NoticeFactory.UserFilter
Encapsulates all user filtering functionality. |
Constructor Summary | |
private |
NoticeFactory()
Private constructor so this class cannot be instantiated. |
Method Summary | |
static void |
acknowledge(int[] noticeIds,
java.lang.String user)
Acknowledge a list of notices with the given username and the current time. |
static void |
acknowledge(int[] noticeIds,
java.lang.String user,
java.util.Date time)
Acknowledge a list of notices with the given username and the given time. |
static void |
acknowledge(Notification[] notices,
java.lang.String user)
Acknowledge a list of notices with the given username |
static void |
acknowledge(Notification[] notices,
java.lang.String user,
java.util.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 |
protected static java.lang.String |
getAcknowledgeTypeClause(NoticeFactory.AcknowledgeType ackType)
Convenience method for getting the SQL ORDER BY clause related to a given sort style. |
static Notification |
getNotice(int noticeId)
Return a specific notice. |
static int |
getNoticeCount(NoticeFactory.AcknowledgeType ackType,
NoticeFactory.Filter[] filters)
Count the number of notices for a given acknowledgement type. |
static Notification[] |
getNotices()
Return all unacknowledged notices sorted by id. |
static Notification[] |
getNotices(NoticeFactory.AcknowledgeType ackType)
Return all unacknowledged or acknowledged notices sorted by id. |
static Notification[] |
getNotices(NoticeFactory.SortStyle sortStyle)
Return all unacknowledged notices sorted by the given sort style. |
static Notification[] |
getNotices(NoticeFactory.SortStyle sortStyle,
boolean includeAcknowledged)
Deprecated. Replaced by " #getNotices(SortStyle,AcknowledgeType) getNotices( SortStyle, AcknowledgeType )" |
static Notification[] |
getNotices(NoticeFactory.SortStyle sortStyle,
NoticeFactory.AcknowledgeType ackType)
Return all notices (optionally only unacknowledged notices) sorted by the given sort style. |
static Notification[] |
getNotices(NoticeFactory.SortStyle sortStyle,
NoticeFactory.AcknowledgeType ackType,
NoticeFactory.Filter[] filters)
Return all notices (optionally only unacknowledged notices) sorted by the given sort style. |
static Notification[] |
getNotices(NoticeFactory.SortStyle sortStyle,
NoticeFactory.AcknowledgeType ackType,
NoticeFactory.Filter[] filters,
int limit,
int offset)
Return all notices (optionally only unacknowledged notices) sorted by the given sort style. |
static Notification[] |
getNoticesForInterface(int nodeId,
java.lang.String ipAddress)
Return all unacknowledged notices for the given interface. |
static Notification[] |
getNoticesForInterface(int nodeId,
java.lang.String ipAddress,
boolean includeAcknowledged)
Return all notices (optionally only unacknowledged notices) sorted by id for the given interface. |
static Notification[] |
getNoticesForInterface(java.lang.String ipAddress)
Return all unacknowledged notices sorted by time for that have the given IP address, regardless of what node they belong to. |
static Notification[] |
getNoticesForInterface(java.lang.String ipAddress,
boolean includeAcknowledged)
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[] |
getNoticesForNode(int nodeId)
Return all unacknowledged notices sorted by time for the given node. |
static Notification[] |
getNoticesForNode(int nodeId,
boolean includeAcknowledged)
Deprecated. Replaced by " #getNoticesForNode(int,SortStyle,AcknowledgeType) getNoticesForNode( int, SortStyle, AcknowledgeType )" |
static Notification[] |
getNoticesForNode(int nodeId,
NoticeFactory.SortStyle sortStyle,
NoticeFactory.AcknowledgeType ackType)
Return all notices (optionally only unacknowledged notices) sorted by given sort style for the given node. |
static Notification[] |
getNoticesForService(int serviceId)
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 serviceId,
boolean includeAcknowledged)
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,
java.lang.String ipAddress,
int serviceId)
Return all unacknowledged notices sorted by time for the given service. |
static Notification[] |
getNoticesForService(int nodeId,
java.lang.String ipAddress,
int serviceId,
boolean includeAcknowledged)
Return all notices (optionally only unacknowledged notices) sorted by time for the given service. |
protected static java.lang.String |
getOrderByClause(NoticeFactory.SortStyle sortStyle)
Convenience method for getting the SQL ORDER BY clause related to a given sort style. |
protected static Notification[] |
rs2Notices(java.sql.ResultSet rs)
Convenience method for translating a java.sql.ResultSet
containing notice information into an array of Notification
objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
private NoticeFactory()
Method Detail |
public static int getNoticeCount(NoticeFactory.AcknowledgeType ackType, NoticeFactory.Filter[] filters) throws java.sql.SQLException
java.sql.SQLException
public static Notification getNotice(int noticeId) throws java.sql.SQLException
java.sql.SQLException
public static boolean canDisplayEvent(int eventId)
eventId
- the unique id of the event from the notice
public static Notification[] getNotices() throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNotices(NoticeFactory.AcknowledgeType ackType) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNotices(NoticeFactory.SortStyle sortStyle) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNotices(NoticeFactory.SortStyle sortStyle, boolean includeAcknowledged) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNotices(NoticeFactory.SortStyle sortStyle, NoticeFactory.AcknowledgeType ackType) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNotices(NoticeFactory.SortStyle sortStyle, NoticeFactory.AcknowledgeType ackType, NoticeFactory.Filter[] filters) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNotices(NoticeFactory.SortStyle sortStyle, NoticeFactory.AcknowledgeType ackType, NoticeFactory.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 Notification[] getNoticesForNode(int nodeId) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForNode(int nodeId, boolean includeAcknowledged) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForNode(int nodeId, NoticeFactory.SortStyle sortStyle, NoticeFactory.AcknowledgeType ackType) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForInterface(int nodeId, java.lang.String ipAddress) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForInterface(int nodeId, java.lang.String ipAddress, boolean includeAcknowledged) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForInterface(java.lang.String ipAddress) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForInterface(java.lang.String ipAddress, boolean includeAcknowledged) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForService(int nodeId, java.lang.String ipAddress, int serviceId) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForService(int nodeId, java.lang.String ipAddress, int serviceId, boolean includeAcknowledged) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForService(int serviceId) throws java.sql.SQLException
java.sql.SQLException
public static Notification[] getNoticesForService(int serviceId, boolean includeAcknowledged) throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(Notification[] notices, java.lang.String user) throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(Notification[] notices, java.lang.String user, java.util.Date time) throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(int[] noticeIds, java.lang.String user) throws java.sql.SQLException
java.sql.SQLException
public static void acknowledge(int[] noticeIds, java.lang.String user, java.util.Date time) throws java.sql.SQLException
java.sql.SQLException
protected static Notification[] rs2Notices(java.sql.ResultSet rs) throws java.sql.SQLException
java.sql.ResultSet
containing notice information into an array of Notification
objects.
java.sql.SQLException
protected static java.lang.String getOrderByClause(NoticeFactory.SortStyle sortStyle)
protected static java.lang.String getAcknowledgeTypeClause(NoticeFactory.AcknowledgeType ackType)
ackType
- the acknowledge type to map to a clause
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |