View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.ken.deliverer;
17  
18  import org.kuali.rice.ken.bo.NotificationMessageDelivery;
19  import org.kuali.rice.ken.exception.NotificationAutoRemoveException;
20  import org.kuali.rice.ken.exception.NotificationMessageDeliveryException;
21  import org.kuali.rice.ken.exception.NotificationMessageDismissalException;
22  
23  /**
24   * This class represents the different types of Notification Delivery Types that the system can handle.  
25   * For example, an instance of delivery type could be "ActionList" or "Email" or "SMS".  Any deliverer implementation 
26   * adhering to this interface can be plugged into the system and will be automatically available for use.
27   * @author Kuali Rice Team (rice.collab@kuali.org)
28   */
29  public interface NotificationMessageDeliverer {
30      /**
31       * This method is responsible for delivering the passed in messageDelivery record.
32       * @param messageDelivery The messageDelivery to process
33       * @throws NotificationMessageDeliveryException
34       */
35      public void deliverMessage(NotificationMessageDelivery messageDelivery) throws NotificationMessageDeliveryException;
36      
37      /**
38       * This method handles auto removing a message delivery from a person's list of notifications.
39       * @param messageDelivery The messageDelivery to auto remove
40       * @throws NotificationAutoRemoveException
41       */
42      public void autoRemoveMessageDelivery(NotificationMessageDelivery messageDelivery) throws NotificationAutoRemoveException;
43      
44      /**
45       * This method dismisses/removes the NotificationMessageDelivery so that it is no longer being presented to the user
46       * via this deliverer.  Note, whether this action is meaningful is dependent on the deliverer implementation.  If the
47       * deliverer cannot control the presentation of the message, then this method need not do anything. 
48       * @param messageDelivery the messageDelivery to dismiss
49       * @param the user that caused the dismissal; in the case of end-user actions, this will most likely be the user to
50       *        which the message was delivered (user recipient in the NotificationMessageDelivery object)
51       * @param cause the reason the message was dismissed
52       */
53      public void dismissMessageDelivery(NotificationMessageDelivery messageDelivery, String user, String cause) throws NotificationMessageDismissalException;
54  }