001/**
002 * Copyright 2005-2016 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 */
016package org.kuali.rice.ken.deliverer;
017
018import org.kuali.rice.ken.bo.NotificationMessageDelivery;
019import org.kuali.rice.ken.exception.NotificationAutoRemoveException;
020import org.kuali.rice.ken.exception.NotificationMessageDeliveryException;
021import org.kuali.rice.ken.exception.NotificationMessageDismissalException;
022
023/**
024 * This class represents the different types of Notification Delivery Types that the system can handle.  
025 * For example, an instance of delivery type could be "ActionList" or "Email" or "SMS".  Any deliverer implementation 
026 * adhering to this interface can be plugged into the system and will be automatically available for use.
027 * @author Kuali Rice Team (rice.collab@kuali.org)
028 */
029public interface NotificationMessageDeliverer {
030    /**
031     * This method is responsible for delivering the passed in messageDelivery record.
032     * @param messageDelivery The messageDelivery to process
033     * @throws NotificationMessageDeliveryException
034     */
035    public void deliverMessage(NotificationMessageDelivery messageDelivery) throws NotificationMessageDeliveryException;
036    
037    /**
038     * This method handles auto removing a message delivery from a person's list of notifications.
039     * @param messageDelivery The messageDelivery to auto remove
040     * @throws NotificationAutoRemoveException
041     */
042    public void autoRemoveMessageDelivery(NotificationMessageDelivery messageDelivery) throws NotificationAutoRemoveException;
043    
044    /**
045     * This method dismisses/removes the NotificationMessageDelivery so that it is no longer being presented to the user
046     * via this deliverer.  Note, whether this action is meaningful is dependent on the deliverer implementation.  If the
047     * deliverer cannot control the presentation of the message, then this method need not do anything. 
048     * @param messageDelivery the messageDelivery to dismiss
049     * @param the user that caused the dismissal; in the case of end-user actions, this will most likely be the user to
050     *        which the message was delivered (user recipient in the NotificationMessageDelivery object)
051     * @param cause the reason the message was dismissed
052     */
053    public void dismissMessageDelivery(NotificationMessageDelivery messageDelivery, String user, String cause) throws NotificationMessageDismissalException;
054}