org.ow2.jasmine.monitoring.eventswitch.beans.impl
Class JasmineEventNotificationSLBImpl

java.lang.Object
  extended by org.ow2.jasmine.monitoring.eventswitch.beans.impl.JasmineEventNotificationSLBImpl
All Implemented Interfaces:
org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote

public class JasmineEventNotificationSLBImpl
extends java.lang.Object
implements org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote

Implementation of the JasmineEventNotification stateless bean.

Author:
HAN Tianyi

Constructor Summary
JasmineEventNotificationSLBImpl()
           
 
Method Summary
 java.util.List<org.ow2.jasmine.event.beans.JasmineEventNotification> getAllNotifications()
          Gets all the notification events from the DataBase.
 org.ow2.jasmine.event.beans.JasmineEventNotification getEventNotification(java.lang.String id)
          Looks for the given bean in the data base.
 java.util.List<org.ow2.jasmine.event.beans.JasmineEventNotification> getEventNotifications(java.util.Date dateFrom, java.util.Date dateTo)
          Gets the event notification between two dates.
 java.util.List<org.ow2.jasmine.event.beans.JasmineEventNotification> getEventNotifications(int keepDisplayed, java.lang.String acknowledgeButtonName, java.lang.String... rules)
          Implementation of inherited method: Gets the event notifications for a given rule, a "synchronized" flag and a keepDisplayed value.
 org.ow2.jasmine.event.beans.JasmineEventNotification[] getEventNotifications(java.lang.String id, java.util.Date date, java.lang.String level, java.lang.String message, java.lang.Boolean status, java.lang.String rule, java.lang.String orderBy, java.lang.Integer limit)
          Implementation of inherited method: looks for the beans searched for, converts the search into an array of JasmineEventNotificationEB objects and returns.
 void saveEvent(org.ow2.jasmine.event.beans.JasmineEventNotification n)
          Implementation of inherited method: creates the JasmineEventNotification entity bean corresponding to given datum and saves an event on the database.
 void saveExecutedAction(java.lang.String id, org.ow2.jasmine.event.beans.JasmineEventNotificationExecutedAction action)
          Saves the action executed by a user in the DataBase.
 void updateNotificationStatus(java.lang.String id, boolean status)
          Updates the status of the notification : acknowledge or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasmineEventNotificationSLBImpl

public JasmineEventNotificationSLBImpl()
Method Detail

saveExecutedAction

public void saveExecutedAction(java.lang.String id,
                               org.ow2.jasmine.event.beans.JasmineEventNotificationExecutedAction action)
Saves the action executed by a user in the DataBase.

Specified by:
saveExecutedAction in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Parameters:
id - the Id of the notification to update.
action - the action to save.
See Also:
JasmineEventNotificationSLBRemote.saveExecutedAction(String, JasmineEventNotificationExecutedAction)

updateNotificationStatus

public void updateNotificationStatus(java.lang.String id,
                                     boolean status)
Updates the status of the notification : acknowledge or not.

Specified by:
updateNotificationStatus in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Parameters:
id - the id of the notification to update.
status - the new status to save.

saveEvent

public void saveEvent(org.ow2.jasmine.event.beans.JasmineEventNotification n)
Implementation of inherited method: creates the JasmineEventNotification entity bean corresponding to given datum and saves an event on the database.

Specified by:
saveEvent in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Parameters:
n - Notification to save.
See Also:
JasmineEventNotificationSLBRemote#saveEvent(JasmineEventNotificationEB)

getEventNotifications

public java.util.List<org.ow2.jasmine.event.beans.JasmineEventNotification> getEventNotifications(int keepDisplayed,
                                                                                                  java.lang.String acknowledgeButtonName,
                                                                                                  java.lang.String... rules)
Implementation of inherited method: Gets the event notifications for a given rule, a "synchronized" flag and a keepDisplayed value.

IMPORTANT: the details and actions will not be retrieved. Call

Specified by:
getEventNotifications in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Parameters:
keepDisplayed - the keepDisplayed option, expressed in hours:
  • If "synchronized" is false, only notifications with a date inferior to now minus keepDisplayed hours will be returned.
  • If "synchronized" is true, a merge of two types of notifications is returned:
    1. Notifications with status false (i.e., not acknowledged yet)
    2. Notifications with status true AND at least one action of type ACKNOWLEDGE with a date to now minus keepDisplayed hours
acknowledgeButtonName - the name of the ACKNOWLEDGE button. if null, "synchronized" is considered to be false; otherwise it is considered to be true.
rules - rule names. might contain an * character at the end, meaning "rule starts with".
Returns:
a list of JasmineEventNotification

getEventNotifications

public java.util.List<org.ow2.jasmine.event.beans.JasmineEventNotification> getEventNotifications(java.util.Date dateFrom,
                                                                                                  java.util.Date dateTo)
Gets the event notification between two dates.

IMPORTANT: the details and actions will not be retrieved. Call

Specified by:
getEventNotifications in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Parameters:
dateFrom - the date from
dateTo - the date to
Returns:
a list of JasmineEventNotification

getEventNotifications

public org.ow2.jasmine.event.beans.JasmineEventNotification[] getEventNotifications(java.lang.String id,
                                                                                    java.util.Date date,
                                                                                    java.lang.String level,
                                                                                    java.lang.String message,
                                                                                    java.lang.Boolean status,
                                                                                    java.lang.String rule,
                                                                                    java.lang.String orderBy,
                                                                                    java.lang.Integer limit)
Implementation of inherited method: looks for the beans searched for, converts the search into an array of JasmineEventNotificationEB objects and returns.

Specified by:
getEventNotifications in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Parameters:
id - Notification id, ignored if null.
date - Notification date, ignored if null.
level - Notification level, ignored if null.
message - Associated message, ignored if null.
status - Notification status, ignored if null.
rule - The rule id that caused the notification, ignored if null.
orderBy - Order using column, ignored if null..
limit - Maximal number of results to get, ignored if null.
Returns:
EventNotifications corresponding to the given search, null if none found.

getAllNotifications

public java.util.List<org.ow2.jasmine.event.beans.JasmineEventNotification> getAllNotifications()
Gets all the notification events from the DataBase.

Specified by:
getAllNotifications in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Returns:
A list that contains all the JasmineEventNotification stored in the DataBase.

getEventNotification

public org.ow2.jasmine.event.beans.JasmineEventNotification getEventNotification(java.lang.String id)
Looks for the given bean in the data base. It returns the associated JasmineEventNotification.

Specified by:
getEventNotification in interface org.ow2.jasmine.monitoring.eventswitch.beans.JasmineEventNotificationSLBRemote
Parameters:
id - Id of the notification to retrieve.
Returns:
the retrieved notification.


Copyright © 2010 OW2 Consortium. All Rights Reserved.