wt.notify
Interface NotificationManager

All Known Implementing Classes:
NotificationManagerFwd, StandardNotificationManager

public interface NotificationManager

NotificationManager provides client invokable methods to notification services. These methods are executed on the server side. The methods support manipulation and execution of the notification rules and lists.

Supported API: true

Extendable: false


Method Summary
 NotificationRule addNotificationRule(Selector selector, NotificationSet set)
          Deprecated.  
 void createNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Hashtable attribute_value_map, Vector principal_refs)
          Creates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.
 void createNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Vector principal_refs)
          Creates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.
 void deleteNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key)
          Deletes a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.
 void deleteNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Hashtable attribute_value_map)
          Deletes a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.
 void deleteNotificationRules(AdminDomainRef domain_ref)
          Deletes all notification rules within a domain.
 String getMessage(WTUser user, String template, Object ctxt)
          Returns the notification message given its name.
 NotificationList getNotificationList(Selector selector)
          Returns the notification list for a given selector.
 NotificationRule getNotificationRule(Selector selector)
          Returns notification rule given the selector.
 Enumeration getNotificationRules(AdminDomainRef domain_ref)
          Returns all the notification policy rules for the specified domain in the form of an enumeration.
 WTStringSet getRelevantEvents(Object target)
          Returns all events that are relevant for a specific object.
 Enumeration getSubscriptions(Object subscriber, Notifiable target, String event_key)
          Returns all subscriptions for a given subscriber, target and event key.
 ArrayList getUserSubscriptions(WTUser user, Notifiable target)
          Returns the subscriptions for a specific object, for which the subscriber is a principal.
 void send(Notification notification)
          Sends an email message to the recipients specified by the notification's distribution list.
 void subscribeToObject(Vector subscribers, ObjectSubscription subscription)
          Subscribes to object event.
 void unsubscribeToObject(Vector subscriptions)
          Deletes all object subscriptions passed as argument.
 void updateNotificationLists(Selector selector)
          Deprecated.  
 void updateNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Hashtable attribute_value_map, Vector principal_refs)
          Updates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.
 void updateNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Vector principal_refs)
          Updates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.
 

Method Detail

createNotificationRule

public void createNotificationRule(AdminDomainRef domain_ref,
                                   String type_id,
                                   String event_key,
                                   Vector principal_refs)
                            throws WTException
Creates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.

Supported API: true

Parameters:
domain_ref - reference to the domain the rule is for
type_id - logical or persisted type identifier
event_key - event key (defined in the wt.admin.adminEventResource resource bundle)
principal_refs - principal references for notification recipients (Vector of WTPrincipalReference)
Throws:
WTException

createNotificationRule

public void createNotificationRule(AdminDomainRef domain_ref,
                                   String type_id,
                                   String event_key,
                                   Hashtable attribute_value_map,
                                   Vector principal_refs)
                            throws WTException
Creates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.

Supported API: false

Parameters:
domain_ref - reference to the domain the rule is for
type_id - logical or persisted type identifier
event_key - event key (defined in the wt.admin.adminEventResource resource bundle)
attribute_value_map - attribute name, value pairs to select an object (name is Hashtable key); may be null
principal_refs - principal references for notification recipients (Vector of WTPrincipalReference)
Throws:
WTException

deleteNotificationRule

public void deleteNotificationRule(AdminDomainRef domain_ref,
                                   String type_id,
                                   String event_key)
                            throws WTException
Deletes a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.

Supported API: true

Parameters:
domain_ref - reference to the domain the rule is for
type_id - logical or persisted type identifier
event_key - event key (defined in the wt.admin.adminEventResource resource bundle)
Throws:
WTException

deleteNotificationRule

public void deleteNotificationRule(AdminDomainRef domain_ref,
                                   String type_id,
                                   String event_key,
                                   Hashtable attribute_value_map)
                            throws WTException
Deletes a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.

Supported API: false

Parameters:
domain_ref - reference to the domain the rule is for
type_id - logical or persisted type identifier
event_key - event key (defined in the wt.admin.adminEventResource resource bundle)
attribute_value_map - attribute name, value pairs to select an object (name is Hashtable key); may be null
Throws:
WTException

deleteNotificationRules

public void deleteNotificationRules(AdminDomainRef domain_ref)
                             throws WTException
Deletes all notification rules within a domain.

This method is intended for testing purposes only, to support automated tests that need to reinitialize the testing environment.

Supported API: false

Parameters:
domain_ref - reference to the domain the rule is for
Throws:
WTException

updateNotificationRule

public void updateNotificationRule(AdminDomainRef domain_ref,
                                   String type_id,
                                   String event_key,
                                   Vector principal_refs)
                            throws WTException
Updates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.

Supported API: true

Parameters:
domain_ref - reference to the domain the rule is for
type_id - logical or persisted type identifier
event_key - event key (defined in the wt.admin.adminEventResource resource bundle)
principal_refs - principal references for notification recipients (Vector of WTPrincipalReference)
Throws:
WTException

updateNotificationRule

public void updateNotificationRule(AdminDomainRef domain_ref,
                                   String type_id,
                                   String event_key,
                                   Hashtable attribute_value_map,
                                   Vector principal_refs)
                            throws WTException
Updates a notification rule defining which users and groups should be notified when a specified event occurs for an object of a specified type, within a domain.

Supported API: false

Parameters:
domain_ref - reference to the domain the rule is for
type_id - logical or persisted type identifier
event_key - event key (defined in the wt.admin.adminEventResource resource bundle)
attribute_value_map - attribute name, value pairs to select an object (name is Hashtable key); may be null
principal_refs - principal references for notification recipients (Vector of WTPrincipalReference)
Throws:
WTException

getNotificationList

public NotificationList getNotificationList(Selector selector)
                                     throws WTException
Returns the notification list for a given selector.

Supported API: false

Parameters:
selector -
Returns:
NotificationList
Throws:
WTException

updateNotificationLists

public void updateNotificationLists(Selector selector)
                             throws WTException
Deprecated.  

Update the list of the selector and all lists associated with selectors that are more specific than the given one.

This method is no longer needed. The createNotificationRule, deleteNotificationRule, and updateNotificationRule methods update the lists.

Supported API: true

Parameters:
selector -
Throws:
WTException
See Also:
createNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Vector principal_refs), deleteNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key), updateNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Vector principal_refs)

addNotificationRule

public NotificationRule addNotificationRule(Selector selector,
                                            NotificationSet set)
                                     throws WTException
Deprecated.  

Adds a notification rule given the selector and notification set. If there is a rule for the same selector the rule is replaced. Returns the persisted rule.

Supported API: true

Parameters:
selector -
set -
Returns:
NotificationRule
Throws:
WTException
See Also:
createNotificationRule(AdminDomainRef domain_ref, String type_id, String event_key, Vector principal_refs)

getNotificationRule

public NotificationRule getNotificationRule(Selector selector)
                                     throws WTException
Returns notification rule given the selector. If rule for the given selector doesn't exist it returns null.

Supported API: false

Parameters:
selector -
Returns:
NotificationRule
Throws:
WTException

getNotificationRules

public Enumeration getNotificationRules(AdminDomainRef domain_ref)
                                 throws WTException
Returns all the notification policy rules for the specified domain in the form of an enumeration.

Supported API: false

Parameters:
domain_ref -
Returns:
Enumeration
Throws:
WTException

getMessage

public String getMessage(WTUser user,
                         String template,
                         Object ctxt)
                  throws WTException
Returns the notification message given its name.

Supported API: false

Parameters:
user -
template -
ctxt -
Returns:
String
Throws:
WTException

send

public void send(Notification notification)
          throws NotificationException,
                 WTException
Sends an email message to the recipients specified by the notification's distribution list.

The message is not sent right away but queued into the notification queue for asynchronous processing.

Supported API: false

Parameters:
notification -
Throws:
NotificationException
WTException

subscribeToObject

public void subscribeToObject(Vector subscribers,
                              ObjectSubscription subscription)
                       throws WTException
Subscribes to object event. Subscribers is a vector of principals (users and groups), teams and subscriber objects (or references to them). ObjectSubscription contains the subscription information. If the ObjectSubscription object is persistent then the key of the newly created subscriptions will be the same; otherwise a new key is generated. This latter feature allows the user of this method to "add" subscriptions to a user action. A side effect of this method is that the target object's event set may be updated (if a subscription for an event not already in the event set is added).

Supported API: true

Parameters:
subscribers -
subscription -
Throws:
WTException

unsubscribeToObject

public void unsubscribeToObject(Vector subscriptions)
                         throws WTException
Deletes all object subscriptions passed as argument.

Supported API: true

Parameters:
subscriptions -
Throws:
WTException

getSubscriptions

public Enumeration getSubscriptions(Object subscriber,
                                    Notifiable target,
                                    String event_key)
                             throws WTException
Returns all subscriptions for a given subscriber, target and event key. Any argument can be null, in which case all subscriptions that match the arguments that are not null are retrieved. If no subscription is found returns an empty enumeration. For example,

getSubscription (subs, null, null)

returns all subscriptions for the given subscriber, for all targets and events. In particular, getSubscriptions (null, null, null) returns all existing subscriptions.

The subscriber must be a user, a reference to a user, a subscriber object or a reference to a subscriber object.

Supported API: false

Parameters:
subscriber -
target -
event_key -
Returns:
Enumeration
Throws:
WTException

getRelevantEvents

public WTStringSet getRelevantEvents(Object target)
                              throws WTException
Returns all events that are relevant for a specific object. These events depend on which interfaces are implemented by the object. A list of the relevant events for each interface is customizable through the wt.properties file. If the object is a reference object, that is it implements WTReference, then the object is retrieved and used rather than the reference itself.

Supported API: false

Parameters:
target -
Returns:
WTStringSet
Throws:
WTException

getUserSubscriptions

public ArrayList getUserSubscriptions(WTUser user,
                                      Notifiable target)
                               throws WTException
Returns the subscriptions for a specific object, for which the subscriber is a principal. An ArrayList is returned where the first element is a Vector of modifiable subscriptions (those either created by the user passed as argument or for which the user is a subscriber) and the second element is a Vector of read only subscriptions (the remaining ones).

Supported API: false

Parameters:
user -
target -
Returns:
ArrayList
Throws:
WTException