|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.apps.groupspace.notification.GroupSpaceNotificationHelper
public class GroupSpaceNotificationHelper
This class is the entry point for all notification handling within the groupspace application.
Constructor Summary | |
---|---|
GroupSpaceNotificationHelper()
|
Method Summary | |
---|---|
static void |
clearAllNotificationsForUser(String username,
String webAppName)
This method consumes all active notifications for the specified user. |
static void |
clearSelectedNotifications(Collection<NotificationId> ids)
Convenience method to consume the provided collection of NotificationIds. |
static GroupSpaceNotification |
createGroupSpaceNotification(String namespace,
String name)
Creates a brand new GroupSpaceNotification type class based on the provided namespace and name. |
static Collection<GroupSpaceNotification> |
filterGroupSpaceNotifications(Collection<Notification> notifications)
Filters (reduces) a collection of notifications down to a collection of notifications supported by GroupSpace. |
static Collection<AnnouncementNotification> |
getAnnouncementNotifications(Collection<GroupSpaceNotification> notifications)
Returns a collection of announcement notifications based on a collection of GroupSpaceNotifications. |
static Collection<CalendarNotification> |
getCalendarNotifications(Collection<GroupSpaceNotification> notifications)
Returns a collection of calendar notifications based on a collection of GroupSpaceNotifications. |
static Collection<EmailNotification> |
getEmailNotifications(Collection<GroupSpaceNotification> notifications)
Returns a collection of email notifications based on a collection of GroupSpaceNotifications. |
static Collection<GroupSpaceNotification> |
getGroupSpaceNotifications(String username,
String webAppName)
Returns notifications that are understood by groupspace. |
static Collection<InvitationNotification> |
getInvitationNotifications(Collection<GroupSpaceNotification> notifications)
Returns a collection of invitation notifications based on a collection of GroupSpaceNotifications. |
static Collection<TaskNotification> |
getTaskNotifications(Collection<GroupSpaceNotification> notifications)
Returns a collection of task notifications based on a collection of GroupSpaceNotifications. |
static void |
sendNotification(CommunityDefinitionId communityDefId,
GroupSpaceNotification notification)
Sends the notification to all active members of the provided community. |
static void |
sendNotification(CommunityDefinitionId communityDefId,
MembershipCapability msc,
GroupSpaceNotification notification)
Sends a notification to all active users of a particular membership capability. |
static void |
sendNotification(CommunityDefinitionId communityDefId,
String username,
GroupSpaceNotification notification)
Sends a notification to a specific domain username. |
static void |
sendNotification(String webAppName,
String username,
GroupSpaceNotification notification)
Sends a notification to a specific domain username. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupSpaceNotificationHelper()
Method Detail |
---|
public static Collection<GroupSpaceNotification> getGroupSpaceNotifications(String username, String webAppName) throws IllegalOperationException, Exception
This method uses the NotificationManager ejb to retrieve notifications for a user, which is not as efficient as going through the NotificationContext. If you have access to the NotificationContext, use that and filter the results using the filterGroupSpaceNotifications().
Example: NotificationContext context = NotificationContext.getNotificationContext(request); Collectionnotifications = context.getNotifications(); Collection gsNotifications = GroupSpaceNotificationHelper.filterGroupSpaceNotifications(notifications);
username
- - The currently logged in user. ** Required **webAppName
- - The webapp name to retrieve notifications for.
If null, all active notifications for all webapps are returned.
IllegalOperationException
Exception
public static Collection<GroupSpaceNotification> filterGroupSpaceNotifications(Collection<Notification> notifications) throws IllegalOperationException
This is a convenience method to reduce a collection of notifications retrieved by utilities other than the NotificationContext (i.e. INotificationManager). The NotificationContext is more efficient than going through the INotificationManager because it caches results.
Example: NotificationContext context = NotificationContext.getNotificationContext(request); Collectionnotifications = context.getNotifications(); Collection gsNotifications = GroupSpaceNotificationHelper.filterGroupSpaceNotifications(notifications);
notifications
- - The collection of notifications to reduce/transform.
IllegalOperationException
public static GroupSpaceNotification createGroupSpaceNotification(String namespace, String name) throws IllegalArgumentException, IllegalOperationException
The supportedNotificationName must be a supported type (declared in the com.bea.apps.groupspace.notification.SupportedNotifications.properties.
Example: createGroupSpaceNotification(InvitationNotification.INVITATION_NAMESPACE, InvitationNotification.INVITATION_NAME);
namespace
- The namespace of the notification.name
- The name of the notification.
IllegalArgumentException
- if the provided notification name is not supported.
IllegalOperationException
- if unable to construct the GroupSpaceNotificationpublic static Collection<AnnouncementNotification> getAnnouncementNotifications(Collection<GroupSpaceNotification> notifications)
This method is most useful for filtering out a collection of GroupSpaceNotifications
notifications
- The collection of abstract GroupSpaceNotifications
public static Collection<InvitationNotification> getInvitationNotifications(Collection<GroupSpaceNotification> notifications)
This method is most useful for filtering out a collection of GroupSpaceNotifications
notifications
- The collection of abstract GroupSpaceNotifications
public static Collection<EmailNotification> getEmailNotifications(Collection<GroupSpaceNotification> notifications)
This method is most useful for filtering out a collection of GroupSpaceNotifications
notifications
- The collection of abstract GroupSpaceNotifications
public static Collection<TaskNotification> getTaskNotifications(Collection<GroupSpaceNotification> notifications)
This method is most useful for filtering out a collection of GroupSpaceNotifications
notifications
- The collection of abstract GroupSpaceNotifications
public static Collection<CalendarNotification> getCalendarNotifications(Collection<GroupSpaceNotification> notifications)
This method is most useful for filtering out a collection of GroupSpaceNotifications
notifications
- The collection of abstract GroupSpaceNotifications
public static void sendNotification(CommunityDefinitionId communityDefId, MembershipCapability msc, GroupSpaceNotification notification) throws IllegalOperationException
communityDefId
- - The selected community definition Id.msc
- - The membership capability to send to.notification
- The groupspace notification instance to send.
IllegalOperationException
public static void clearAllNotificationsForUser(String username, String webAppName) throws IllegalOperationException
Please use caution when executing this method because all notifications will be marked for consumption.
username
- The wls domain username. *Required*webAppName
- The optional web application name.
IllegalOperationException
public static void clearSelectedNotifications(Collection<NotificationId> ids) throws Exception
ids
- The collection of NotificationIds
Exception
public static void sendNotification(CommunityDefinitionId communityDefId, GroupSpaceNotification notification) throws IllegalOperationException
communityDefId
- - The selected community definition Id.notification
- The groupspace notification instance to send.
IllegalOperationException
public static void sendNotification(CommunityDefinitionId communityDefId, String username, GroupSpaceNotification notification) throws IllegalOperationException
username
- The username to send the notification to.notification
- The groupspace notification instance to send.
IllegalOperationException
public static void sendNotification(String webAppName, String username, GroupSpaceNotification notification) throws IllegalOperationException
webAppName
- The source/target webapp name.username
- The username to send the notification to.notification
- The groupspace notification instance to send.
IllegalOperationException
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |