com.bea.netuix.application.manager
Interface INotificationManager

All Known Subinterfaces:
NotificationManager

public interface INotificationManager

This is the primary interface for operations on notifications.

This interface is intended to be implemented only by Oracle Weblogic Portal. Oracle Systems reserves the right to add abstract methods to this interface without notice. Implementations of this interface by other parties must not be expected to compile without change in future versions of Oracle Weblogic Portal.

Method Summary
 Collection<NotificationId> consume(Collection<NotificationId> notificationIds)
          Consumes a set of notifications.
 boolean consume(NotificationId notificationId)
          Consumes a notification.
 Collection<Notification> getActiveNotifications(String username, String webApp)
          Retrieves all active notifications for the specified user and webapp.
 SortableFilterablePagedResult<NotificationPayload> getNotificationPayloads(CustomizationContext context, NotificationCriteria criteria, int pageSize)
          Retrieves a paginated set of NotificationPayload objects matching the specified criteria.
 SortableFilterablePagedResult<String> getNotificationRecipients(CustomizationContext context, NotificationCriteria criteria, int pageSize)
          Retrieves a set of usernames who received notifications matching the specified criteria.
 SortableFilterablePagedResult<Notification> getNotifications(CustomizationContext context, NotificationCriteria criteria, int pageSize)
          Retrieves a paginated set of Notification objects matching the specified criteria.
 void notifyUser(String username, NotificationPayloadInfo payload)
          Used to send a notification to a single user.
 void notifyUsers(INotificationUserEnumerator userEnumerator, NotificationPayloadInfo payload)
          Used to send a notification to multiple users in an asynchronous manner.
 void removeNotifications(NotificationCriteria criteria)
          Removes a set of notification objects matching the specified criteria; use with caution.
 void synchronousNotifyUsers(INotificationUserEnumerator userEnumerator, NotificationPayloadInfo payload)
          Used to send a notification to multiple users in a synchronous manner.
 

Method Detail

notifyUser

void notifyUser(String username,
                NotificationPayloadInfo payload)
                throws IllegalArgumentException,
                       RemoteException
Used to send a notification to a single user. If sending the same notification to multiple users, the notifyUsers() method should be used instead. This method is synchronous- it will return after sending the notification.

Parameters
username - the user to send the notification to.
payload - the payload of the notification to send.
Throws
IllegalArgumentException - if any of the fields in the NotificationPayloadInfo object are invalid.
RemoteException

notifyUsers

void notifyUsers(INotificationUserEnumerator userEnumerator,
                 NotificationPayloadInfo payload)
                 throws IllegalArgumentException,
                        RemoteException
Used to send a notification to multiple users in an asynchronous manner. This method kicks off an asynchronous mechanism for sending notifications, so it returns before the notification has actually been sent. This is beneficial and recommended if a large number of users are being targetted to receive a notification.

Parameters
userEnumerator - an object which can be used to enumerate the set of users to send the notification to. It is important that this method is never called twice with the same instance of a userEnumerator object, as there is no guarantee that the requests will not be processed in parallel and the enumeration is not thread-safe.
payload - the payload of the notification to send.
Throws
IllegalArgumentException - if any of the fields in the NotificationPayloadInfo object are invalid.
RemoteException

getActiveNotifications

Collection<Notification> getActiveNotifications(String username,
                                                String webApp)
                                                throws RemoteException
Retrieves all active notifications for the specified user and webapp. Notifications will be included if they are not expired, not consumed, and have been targeted to the specified webapp or targeted globally.

Parameters
username - the username to retrieve notifications for.
webApp - the webapp name to retrieve notifications for. If null, all active notifications for all webapps are returned.
Returns
a collection of active notifications for the user and webapp, represented as Notification objects. If no notifications are active for the user, the list returned is empty.
Throws
RemoteException

consume

boolean consume(NotificationId notificationId)
                throws RemoteException
Consumes a notification.

Parameters
notificationId - the ID of the notification to consume.
Returns
true if the notification was successfully consumed. False is returned if the notification was previously consumed (perhaps by another thread or request) or if the specified notification does not exist.
Throws
RemoteException

consume

Collection<NotificationId> consume(Collection<NotificationId> notificationIds)
                                   throws RemoteException
Consumes a set of notifications.

Parameters
notificationIds - a collection of IDs for the notifications to consume.
Returns
A collection containing all notification IDs which were successfully consumed. This will exclude the IDs of any previously consumed notifications or notifications which did not exist.
Throws
RemoteException

getNotifications

SortableFilterablePagedResult<Notification> getNotifications(CustomizationContext context,
                                                             NotificationCriteria criteria,
                                                             int pageSize)
                                                             throws RemoteException
Retrieves a paginated set of Notification objects matching the specified criteria. If the returned SortableFilterablePagedResult is re-filtered using the reFilter() method, the filter specified is used in addition to the original filter criteria specified in the NotificationCriteria object. If the filter criteria specified in the reFilter() method conflicts with a criteria specified in the original NotificationCriteria object, the newly specified filter criteria is used in place of the original NotificationCriteria for that field only; all other field criteria specified in the NotificationCriteria object will still be used as filter criteria.

If only payload criteria are set, this method will return one Notification object for each user sent a notification where the payload matches the specified criteria, which could be a lot of results. See the getNotificationPayloads() and getNotificationRecipients() methods for an alternative.

Notifications returned by the paginating result object may have expired since this original method was called. As with all paginating results, the results may change as new pages are retrieved. The returned PagedResult can be sorted by "USERNAME", "IS_CONSUMED", "NAMESPACE", "NAME", "TARGET_WEBAPP_NAME", "SOURCE_WEBAPP_NAME", "SOURCE_PORTAL_PATH", "SOURCE_DESKTOP_PATH", "SOURCE_DESKTOP_INSTANCE", "SOURCE_PORTLET_DEFINITION_LABEL", "SOURCE_PORTLET_INSTANCE_LABEL", "IS_SELF_DESTRUCTING", "IS_ACTIVE", and "EXPIRATION_DATE". The returned PagedResult can be filtered by "USERNAME","NAMESPACE", "NAME", "TARGET_WEBAPP_NAME", "SOURCE_WEBAPP_NAME", "SOURCE_PORTAL_PATH", "SOURCE_DESKTOP_PATH", "SOURCE_DESKTOP_INSTANCE", "SOURCE_PORTLET_DEFINITION_LABEL", and "SOURCE_PORTLET_INSTANCE_LABEL", using these filter method FilterMethod.EQUALS.

Parameters
context - the customization context for the request.
criteria - the criteria notifications must match to be returned.
pageSize - the number of notifications to return per result page.
Returns
A paginated collection of all notifications matching the specified criteria.
Throws
RemoteException

getNotificationPayloads

SortableFilterablePagedResult<NotificationPayload> getNotificationPayloads(CustomizationContext context,
                                                                           NotificationCriteria criteria,
                                                                           int pageSize)
                                                                           throws RemoteException
Retrieves a paginated set of NotificationPayload objects matching the specified criteria. If the returned SortableFilterablePagedResult is re-filtered using the reFilter() method, the filter specified is used in addition to the original filter criteria specified in the NotificationCriteria object. If the filter criteria specified in the reFilter() method conflicts with a criteria specified in the original NotificationCriteria object, the newly specified filter criteria is used in place of the original NotificationCriteria for that field only; all other field criteria specified in the NotificationCriteria object will still be used as filter criteria.

Notifications returned by the paginating result object may have expired since this original method was called. As with all paginating results, the results may change as new pages are retrieved. The returned PagedResult can be sorted by "NAMESPACE", "NAME", "TARGET_WEBAPP_NAME", "SOURCE_WEBAPP_NAME", "SOURCE_PORTAL_PATH", "SOURCE_DESKTOP_PATH", "SOURCE_DESKTOP_INSTANCE", "SOURCE_PORTLET_DEFINITION_LABEL", "SOURCE_PORTLET_INSTANCE_LABEL", "IS_SELF_DESTRUCTING", "IS_ACTIVE", and "EXPIRATION_DATE". The returned PagedResult can be filtered by "USERNAME","NAMESPACE", "NAME", "TARGET_WEBAPP_NAME", "SOURCE_WEBAPP_NAME", "SOURCE_PORTAL_PATH", "SOURCE_DESKTOP_PATH", "SOURCE_DESKTOP_INSTANCE", "SOURCE_PORTLET_DEFINITION_LABEL", and "SOURCE_PORTLET_INSTANCE_LABEL", using these filter method FilterMethod.EQUALS.

Parameters
context - the customization context for the request.
criteria - the criteria notification payloads must match to be returned.
pageSize - the number of notification payloads to return per result page.
Returns
A paginated collection of all notification payloads matching the specified criteria.
Throws
RemoteException

getNotificationRecipients

SortableFilterablePagedResult<String> getNotificationRecipients(CustomizationContext context,
                                                                NotificationCriteria criteria,
                                                                int pageSize)
                                                                throws RemoteException
Retrieves a set of usernames who received notifications matching the specified criteria. If the returned SortableFilterablePagedResult is re-filtered using the reFilter() method, the filter specified is used in addition to the original filter criteria specified in the NotificationCriteria object. If the filter criteria specified in the reFilter() method conflicts with a criteria specified in the original NotificationCriteria object, the newly specified filter criteria is used in place of the original NotificationCriteria for that field only; all other field criteria specified in the NotificationCriteria object will still be used as filter criteria.

Notifications returned by the paginating result object may have expired since this original method was called. As with all paginating results, the results may change as new pages are retrieved. The returned PagedResult can be sorted by "USER_NAME". The returned PagedResult can be filtered by "USERNAME","NAMESPACE", "NAME", "TARGET_WEBAPP_NAME", "SOURCE_WEBAPP_NAME", "SOURCE_PORTAL_PATH", "SOURCE_DESKTOP_PATH", "SOURCE_DESKTOP_INSTANCE", "SOURCE_PORTLET_DEFINITION_LABEL", and "SOURCE_PORTLET_INSTANCE_LABEL", using these filter method FilterMethod.EQUALS.

Parameters
context - the customization context for the request.
criteria - the criteria notification payloads must match to be returned.
pageSize - the number of notification payloads to return per result page.
Returns
A paginated collection of all usernames who received notifications matching the specified criteria.
Throws
RemoteException

removeNotifications

void removeNotifications(NotificationCriteria criteria)
                         throws RemoteException
Removes a set of notification objects matching the specified criteria; use with caution. If the specified criteria do not include username or consumed status, then payloads matching the criteria will be removed along with all notifications referencing those payloads. If the specified criteria includes username or consumed status, all notifications matching the criteria will be removed and any payloads left without notifications referencing them will subsequently be removed. This method should be used with extreme caution and a very carefully constructed criteria; a call to removeNotifications(new NotificationCriteria()) will remove ALL notifications in the database.

Parameters
criteria - the criteria notifications must match to be removed.
Throws
RemoteException

synchronousNotifyUsers

void synchronousNotifyUsers(INotificationUserEnumerator userEnumerator,
                            NotificationPayloadInfo payload)
                            throws IllegalArgumentException,
                                   RemoteException
Used to send a notification to multiple users in a synchronous manner. It is recommended that the notifyUsers() method be used when sending a notification to a large number of users, as it runs asynchronously.

Parameters
userEnumerator - an object which can be used to enumerate the set of users to send the notification to.
payload - the payload of the notification to send.
Throws
IllegalArgumentException - if any of the fields in the NotificationPayloadInfo object are invalid.
RemoteException


Copyright © 2011, Oracle. All rights reserved.