com.arsdigita.notification
Class BaseSubscription

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.notification.BaseSubscription

public abstract class BaseSubscription
extends ACSObject

The abstract BaseSubscription class provides the ability for Users to sign up for email notifications. Subclasses will specify the object to which the notifications apply and messages that should be sent along with the notifications. The default implementation provides instant notifications. Subclasses should override sendNotification() to alter this behavior. This is abstracted out from Subscription to allow for greated reusability (that is, it no longer assumes it's dealing with a Post).

Author:
Kevin Scaldeferri

Field Summary
protected static String ALERT_BLURB
           
protected static String REPLY_BLURB
           
protected static String SEPARATOR
          A separator to use between the body and signature of an alert.
 
Fields inherited from class com.arsdigita.kernel.ACSObject
BASE_DATA_OBJECT_TYPE, CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE, versionId
 
Constructor Summary
BaseSubscription(DataObject dataObj)
           
BaseSubscription(OID oid)
           
BaseSubscription(String objectType)
          Constructor.
 
Method Summary
 Group getGroup()
          returns the Group of people who are subscribed
abstract  String getHeader(ThreadedMessage post)
          Returns a header for forum alerts with the following standard information:
 String getSignature(ThreadedMessage post)
          Returns the signature to be appended to the alert.
 boolean isSubscribed(Party party)
           
 void sendNotification(ThreadedMessage post)
          This method will send immediate notifications to subscribed users with the header and signature specified by getHeader() and getSignature.
protected  void setGroup(Group group)
           
 void setGroupName(String name)
           
protected  void setupSubscriptionGroup()
           
 void subscribe(Party party)
           
 void unsubscribe(Party party)
           
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getBaseDataObjectType, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

protected static final String SEPARATOR
A separator to use between the body and signature of an alert.


ALERT_BLURB

protected static final String ALERT_BLURB
See Also:
Constant Field Values

REPLY_BLURB

protected static final String REPLY_BLURB
See Also:
Constant Field Values
Constructor Detail

BaseSubscription

public BaseSubscription(String objectType)
Constructor.


BaseSubscription

public BaseSubscription(DataObject dataObj)

BaseSubscription

public BaseSubscription(OID oid)
                 throws DataObjectNotFoundException
Method Detail

setupSubscriptionGroup

protected void setupSubscriptionGroup()

getGroup

public Group getGroup()
returns the Group of people who are subscribed


setGroup

protected void setGroup(Group group)

setGroupName

public void setGroupName(String name)

subscribe

public final void subscribe(Party party)

unsubscribe

public final void unsubscribe(Party party)

isSubscribed

public final boolean isSubscribed(Party party)

sendNotification

public void sendNotification(ThreadedMessage post)
This method will send immediate notifications to subscribed users with the header and signature specified by getHeader() and getSignature. Subclasses which desire different behavior should override one or more of these methods.


getHeader

public abstract String getHeader(ThreadedMessage post)
Returns a header for forum alerts with the following standard information:

Returns:
a header to insert at the top of the alert.

getSignature

public String getSignature(ThreadedMessage post)
Returns the signature to be appended to the alert. The default implementation returns a separator and a generic messages.



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC