com.trackstudio.app.adapter.email
Class BaseFilterNotifyAdapter

java.lang.Object
  extended by com.trackstudio.app.adapter.email.BaseFilterNotifyAdapter
All Implemented Interfaces:
Adapter, FilterNotifyAdapter

public class BaseFilterNotifyAdapter
extends java.lang.Object
implements FilterNotifyAdapter

Base Notification adapter class. Sends subscription and notifications.


Constructor Summary
BaseFilterNotifyAdapter()
           
 
Method Summary
 java.util.Map getDataMapImpl(SessionContext sc, SecuredTaskBean task, java.lang.String sourceTaskName, java.lang.String sourceFilterName, java.lang.String sourceNotificationName, java.lang.String filterId, java.util.ArrayList items, java.lang.String reason)
          Returns a Map with data to be sent
 java.lang.String getDescription()
          Adapter's description
 boolean init()
          Initialize adapter.
 boolean processSubscriptionImpl(java.lang.String subId, java.lang.String taskId)
          Send subscription for the task
 boolean sendMsgImpl(java.lang.String sourceTaskName, java.lang.String sourceFilterName, java.lang.String sourceNotificationName, java.lang.String templateId, java.lang.String fi, java.lang.String fromUser, java.lang.String toUser, java.lang.String taskId, boolean sendForEmptyTaskList, java.lang.String reason)
          Send message for task
 boolean sendNotifyForTaskImpl(java.lang.String messageId, java.lang.String taskId, java.lang.String userId, java.lang.String mstatusId, java.lang.String singleNotificationId, java.lang.String notificationType)
          Send notification for the task
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseFilterNotifyAdapter

public BaseFilterNotifyAdapter()
Method Detail

init

public boolean init()
Description copied from interface: Adapter
Initialize adapter. TrackStudio calls this method during startup.

Specified by:
init in interface Adapter
Returns:
true when adapter initialized, false otherwise.

getDescription

public java.lang.String getDescription()
Adapter's description

Specified by:
getDescription in interface Adapter
Returns:
adapter's description

sendMsgImpl

public boolean sendMsgImpl(java.lang.String sourceTaskName,
                           java.lang.String sourceFilterName,
                           java.lang.String sourceNotificationName,
                           java.lang.String templateId,
                           java.lang.String fi,
                           java.lang.String fromUser,
                           java.lang.String toUser,
                           java.lang.String taskId,
                           boolean sendForEmptyTaskList,
                           java.lang.String reason)
                    throws GranException
Send message for task

Specified by:
sendMsgImpl in interface FilterNotifyAdapter
Parameters:
sourceTaskName - name of task for which the message will be sent
sourceFilterName - name of filter which returns subtasks list
sourceNotificationName - name of notification rule
templateId - template of e-mail message's body
fi - source filter identifier
fromUser - from user's id
toUser - to user's id
taskId - task's id
sendForEmptyTaskList - if true, notification will be sent even if the filtered subtasks list is empty
reason - reason of sending
Returns:
true if succesful
Throws:
GranException

getDataMapImpl

public java.util.Map getDataMapImpl(SessionContext sc,
                                    SecuredTaskBean task,
                                    java.lang.String sourceTaskName,
                                    java.lang.String sourceFilterName,
                                    java.lang.String sourceNotificationName,
                                    java.lang.String filterId,
                                    java.util.ArrayList items,
                                    java.lang.String reason)
                             throws GranException
Returns a Map with data to be sent

Specified by:
getDataMapImpl in interface FilterNotifyAdapter
Parameters:
sc - session context
task - source task
sourceFilterName - name of filter which returns subtasks list
sourceNotificationName - name of notification rule
filterId - source filter identifier
items - list of subtasks
reason - reason of sending
Returns:
Map with data to be sent
Throws:
GranException

sendNotifyForTaskImpl

public boolean sendNotifyForTaskImpl(java.lang.String messageId,
                                     java.lang.String taskId,
                                     java.lang.String userId,
                                     java.lang.String mstatusId,
                                     java.lang.String singleNotificationId,
                                     java.lang.String notificationType)
                              throws GranException
Send notification for the task

Specified by:
sendNotifyForTaskImpl in interface FilterNotifyAdapter
Parameters:
messageId - message id which will be sent
taskId - task id
userId - user id
mstatusId - id of status. Is not equals to 0, notification will be send to all users of this status
singleNotificationId - id of single notification rule to be executed. If not null, all other rules won’t be executed
notificationType - type of notification rule to be executed. Returned by Notification.getCondition().
Returns:
true if successful
Throws:
GranException

processSubscriptionImpl

public boolean processSubscriptionImpl(java.lang.String subId,
                                       java.lang.String taskId)
                                throws GranException
Send subscription for the task

Specified by:
processSubscriptionImpl in interface FilterNotifyAdapter
Parameters:
subId - subscription id
taskId - task id
Returns:
true is successful
Throws:
GranException


Copyright © 2002-2006 TrackStudio, Ltd. All Rights Reserved.