001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.notifications;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.model.UserNotificationEvent;
020    import com.liferay.portal.service.ServiceContext;
021    
022    import java.util.List;
023    import java.util.Map;
024    
025    /**
026     * @author Jonathan Lee
027     */
028    public interface UserNotificationManager {
029    
030            public void addUserNotificationDefinition(
031                    String portletIf,
032                    UserNotificationDefinition userNotificationDefinition);
033    
034            public void addUserNotificationHandler(
035                    UserNotificationHandler userNotificationHandler);
036    
037            public void deleteUserNotificationDefinitions(String portletId);
038    
039            public void deleteUserNotificationHandler(
040                    UserNotificationHandler userNotificationHandler);
041    
042            public UserNotificationDefinition fetchUserNotificationDefinition(
043                    String portletId, long classNameId, int notificationType);
044    
045            public Map<String, List<UserNotificationDefinition>>
046                    getUserNotificationDefinitions();
047    
048            public Map<String, Map<String, UserNotificationHandler>>
049                    getUserNotificationHandlers();
050    
051            public UserNotificationFeedEntry interpret(
052                            String selector, UserNotificationEvent userNotificationEvent,
053                            ServiceContext serviceContext)
054                    throws PortalException;
055    
056            public boolean isDeliver(
057                            long userId, String portletId, long classNameId,
058                            int notificationType, int deliveryType)
059                    throws PortalException, SystemException;
060    
061            public boolean isDeliver(
062                            long userId, String selector, String portletId, long classNameId,
063                            int notificationType, int deliveryType,
064                            ServiceContext serviceContext)
065                    throws PortalException, SystemException;
066    
067    }