wt.notify
Class NotificationSet

java.lang.Object
  extended bywt.notify.NotificationSet
All Implemented Interfaces:
Evolvable, Externalizable, Serializable

public class NotificationSet
extends Object
implements Serializable, Externalizable, Evolvable

A notification set associates a message with a list of recipients. This class is the "workhorse" of the policy based notification functionality. Message recipients can be users or groups (principals). Groups are resolved to users at the time the event occurs.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
private  String messageBody
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String PROXY_CLASSNAME_PREFIX
           
private  WTStringSet recipientSet
           
private static String RESOURCE
           
private  ReferenceFactory rf
           
(package private) static long serialVersionUID
           
private  String subject
           
private static String TEMPLATE_RESOURCE
           
private  String templateName
           
private static boolean VERBOSE
           
private static boolean VERBOSE_EXECUTION
           
private static boolean VERBOSE_POLICY
           
protected static long VERSION_30_UID
           
protected static long VERSION_40_UID
           
private static String WT_CLASSNAME_PREFIX
           
 
Constructor Summary
NotificationSet()
           
 
Method Summary
 void addRecipient(Object recipient)
          Adds a recipient to the notification set.
protected  Enumeration getListeners()
          Returns an enumeration containing object references for the listeners of the notification set.
 String getMessageBody()
          Gets the value of the attribute: messageBody; Body of notification message.
private  WTUser getProxyUser(String user_name)
           
 EnumeratorVector getRecipients()
          Returns an enumeration consisting of references to the recipients.
protected  WTStringSet getRecipientSet()
          Gets the value of the attribute: recipientSet.
 String getSubject()
          Gets the value of the attribute: subject; Notification message subject.
 String getTemplateName()
          Gets the value of the attribute: templateName; Name of the template used to create notification.
protected  void initialize()
          

Supported API: false
protected  boolean isEquivalent(NotificationSet set)
          Determines if two notification sets are equivalent, that is result in the same message being sent.
protected  void merge(NotificationSet set)
          Adds the recipients of the second notification set to the first.
private  void messageBodyValidate(String a_MessageBody)
           
static NotificationSet newNotificationSet()
          No-arg constructor.
private  void read40Version(ObjectInput input)
          Reads 4.0 version, when a NotificationSet was composed of two Hashtables, one mapping template names to users and another mapping template names to roles.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(NotificationSet thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private  void recipientSetValidate(WTStringSet a_RecipientSet)
           
 void removeAllRecipients()
          Removes all recipients from the notification set.
 void removeRecipient(Object recipient)
          Removes a recipient from the notification set.
private  void replaceProxyReferences()
           
 void setMessageBody(String a_MessageBody)
          Sets the value of the attribute: messageBody; Body of notification message.
protected  void setRecipientSet(WTStringSet a_RecipientSet)
          Sets the value of the attribute: recipientSet.
 void setSubject(String a_Subject)
          Sets the value of the attribute: subject; Notification message subject.
 void setTemplateName(String a_TemplateName)
          Sets the value of the attribute: templateName; Name of the template used to create notification.
private  void subjectValidate(String a_Subject)
           
private  void templateNameValidate(String a_TemplateName)
           
 String toString()
          Returns a string representation of the object.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

templateName

private String templateName

subject

private String subject

messageBody

private String messageBody

recipientSet

private WTStringSet recipientSet

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

VERSION_40_UID

protected static final long VERSION_40_UID
See Also:
Constant Field Values

VERSION_30_UID

protected static final long VERSION_30_UID
See Also:
Constant Field Values

PROXY_CLASSNAME_PREFIX

private static final String PROXY_CLASSNAME_PREFIX
See Also:
Constant Field Values

WT_CLASSNAME_PREFIX

private static final String WT_CLASSNAME_PREFIX
See Also:
Constant Field Values

TEMPLATE_RESOURCE

private static final String TEMPLATE_RESOURCE

VERBOSE_POLICY

private static boolean VERBOSE_POLICY

VERBOSE_EXECUTION

private static boolean VERBOSE_EXECUTION

VERBOSE

private static boolean VERBOSE

rf

private ReferenceFactory rf
Constructor Detail

NotificationSet

public NotificationSet()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(NotificationSet thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getTemplateName

public String getTemplateName()
Gets the value of the attribute: templateName; Name of the template used to create notification.

Supported API: true

Returns:
String

setTemplateName

public void setTemplateName(String a_TemplateName)
                     throws WTPropertyVetoException
Sets the value of the attribute: templateName; Name of the template used to create notification.

Supported API: true

Parameters:
a_TemplateName -
Throws:
WTPropertyVetoException

templateNameValidate

private void templateNameValidate(String a_TemplateName)
                           throws WTPropertyVetoException
Parameters:
a_TemplateName -
Throws:
WTPropertyVetoException

getSubject

public String getSubject()
Gets the value of the attribute: subject; Notification message subject.

Supported API: true

Returns:
String

setSubject

public void setSubject(String a_Subject)
                throws WTPropertyVetoException
Sets the value of the attribute: subject; Notification message subject.

Supported API: true

Parameters:
a_Subject -
Throws:
WTPropertyVetoException

subjectValidate

private void subjectValidate(String a_Subject)
                      throws WTPropertyVetoException
Parameters:
a_Subject -
Throws:
WTPropertyVetoException

getMessageBody

public String getMessageBody()
Gets the value of the attribute: messageBody; Body of notification message. The body is to be inserted in message template, if it exists.

Supported API: true

Returns:
String

setMessageBody

public void setMessageBody(String a_MessageBody)
                    throws WTPropertyVetoException
Sets the value of the attribute: messageBody; Body of notification message. The body is to be inserted in message template, if it exists.

Supported API: true

Parameters:
a_MessageBody -
Throws:
WTPropertyVetoException

messageBodyValidate

private void messageBodyValidate(String a_MessageBody)
                          throws WTPropertyVetoException
Parameters:
a_MessageBody -
Throws:
WTPropertyVetoException

getRecipientSet

protected WTStringSet getRecipientSet()
Gets the value of the attribute: recipientSet.

Supported API: false

Returns:
WTStringSet

setRecipientSet

protected void setRecipientSet(WTStringSet a_RecipientSet)
                        throws WTPropertyVetoException
Sets the value of the attribute: recipientSet.

Supported API: false

Parameters:
a_RecipientSet -
Throws:
WTPropertyVetoException

recipientSetValidate

private void recipientSetValidate(WTStringSet a_RecipientSet)
                           throws WTPropertyVetoException
Parameters:
a_RecipientSet -
Throws:
WTPropertyVetoException

newNotificationSet

public static NotificationSet newNotificationSet()
                                          throws WTException
No-arg constructor.

Supported API: true

Returns:
NotificationSet
Throws:
WTException

initialize

protected void initialize()


Supported API: false


merge

protected void merge(NotificationSet set)
Adds the recipients of the second notification set to the first.

Supported API: false

Parameters:
set -

toString

public String toString()
Returns a string representation of the object.

Supported API: true

Returns:
String

addRecipient

public void addRecipient(Object recipient)
                  throws WTException
Adds a recipient to the notification set. A recipient can be a user or a group (principal). The parameter can be either the object or a reference to the object.

Supported API: true

Parameters:
recipient -
Throws:
WTException

removeRecipient

public void removeRecipient(Object recipient)
                     throws WTException
Removes a recipient from the notification set. A recipient can be a user or a group (principal). The parameter can be either the object or a reference to the object.

Supported API: true

Parameters:
recipient -
Throws:
WTException

removeAllRecipients

public void removeAllRecipients()
                         throws WTException
Removes all recipients from the notification set.

Supported API: true

Throws:
WTException

getRecipients

public EnumeratorVector getRecipients()
                               throws WTException
Returns an enumeration consisting of references to the recipients.

Supported API: true

Returns:
EnumeratorVector
Throws:
WTException

isEquivalent

protected boolean isEquivalent(NotificationSet set)
Determines if two notification sets are equivalent, that is result in the same message being sent. Returns 'true' if this is the case and 'false' otherwise.

Supported API: false

Parameters:
set -
Returns:
boolean

getListeners

protected Enumeration getListeners()
                            throws WTException
Returns an enumeration containing object references for the listeners of the notification set.

Recipients that are listeners (objects that implement the ObjectSubscriptionListener interface) are not currently supported. Listeners in notification sets are to facilitate customization of the actions to be performed when an event happens. However, currently the Policy Administrator client does not support recipients other than principals. Additional enhancements are required to support listeners.

Supported API: false

Returns:
Enumeration
Throws:
WTException

read40Version

private void read40Version(ObjectInput input)
                    throws IOException,
                           ClassNotFoundException
Reads 4.0 version, when a NotificationSet was composed of two Hashtables, one mapping template names to users and another mapping template names to roles.

Throws:
IOException
ClassNotFoundException

getProxyUser

private WTUser getProxyUser(String user_name)
                     throws WTException
Throws:
WTException

replaceProxyReferences

private void replaceProxyReferences()