001 /*
002 * Copyright 2007 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.ken.deliverer;
017
018 import java.util.HashMap;
019 import java.util.LinkedHashMap;
020
021 import org.kuali.rice.ken.bo.NotificationMessageDelivery;
022 import org.kuali.rice.ken.exception.ErrorList;
023 import org.kuali.rice.ken.exception.NotificationAutoRemoveException;
024 import org.kuali.rice.ken.exception.NotificationMessageDeliveryException;
025 import org.kuali.rice.ken.exception.NotificationMessageDismissalException;
026
027 /**
028 * This class represents the different types of Notification Delivery Types that the system can handle.
029 * For example, an instance of delivery type could be "ActionList" or "Email" or "SMS". Any deliverer implementation
030 * adhering to this interface can be plugged into the system and will be automatically available for use.
031 * @author Kuali Rice Team (rice.collab@kuali.org)
032 */
033 public interface NotificationMessageDeliverer {
034 /**
035 * This method is responsible for delivering the passed in messageDelivery record.
036 * @param messageDelivery The messageDelivery to process
037 * @throws NotificationMessageDeliveryException
038 */
039 public void deliverMessage(NotificationMessageDelivery messageDelivery) throws NotificationMessageDeliveryException;
040
041 /**
042 * This method handles auto removing a message delivery from a person's list of notifications.
043 * @param messageDelivery The messageDelivery to auto remove
044 * @throws NotificationAutoRemoveException
045 */
046 public void autoRemoveMessageDelivery(NotificationMessageDelivery messageDelivery) throws NotificationAutoRemoveException;
047
048 /**
049 * This method dismisses/removes the NotificationMessageDelivery so that it is no longer being presented to the user
050 * via this deliverer. Note, whether this action is meaningful is dependent on the deliverer implementation. If the
051 * deliverer cannot control the presentation of the message, then this method need not do anything.
052 * @param messageDelivery the messageDelivery to dismiss
053 * @param the user that caused the dismissal; in the case of end-user actions, this will most likely be the user to
054 * which the message was delivered (user recipient in the NotificationMessageDelivery object)
055 * @param cause the reason the message was dismissed
056 */
057 public void dismissMessageDelivery(NotificationMessageDelivery messageDelivery, String user, String cause) throws NotificationMessageDismissalException;
058 }