001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.notifications;
016    
017    import java.util.Collection;
018    import java.util.List;
019    
020    /**
021     * @author Edward Han
022     */
023    public interface ChannelHubManager {
024    
025            public void confirmDelivery(
026                            long companyId, long userId,
027                            Collection<String> notificationEventUuids)
028                    throws ChannelException;
029    
030            public void confirmDelivery(
031                            long companyId, long userId,
032                            Collection<String> notificationEventUuids, boolean archive)
033                    throws ChannelException;
034    
035            public void confirmDelivery(
036                            long companyId, long userId, String notificationEventUuid)
037                    throws ChannelException;
038    
039            public void confirmDelivery(
040                            long companyId, long userId, String notificationEventUuid,
041                            boolean archive)
042                    throws ChannelException;
043    
044            public Channel createChannel(long companyId, long userId)
045                    throws ChannelException;
046    
047            public ChannelHub createChannelHub(long companyId) throws ChannelException;
048    
049            public void deleteUserNotificiationEvent(
050                            long companyId, long userId, String notificationEventUuid)
051                    throws ChannelException;
052    
053            public void deleteUserNotificiationEvents(
054                            long companyId, long userId,
055                            Collection<String> notificationEventUuids)
056                    throws ChannelException;
057    
058            public void destroyChannel(long companyId, long userId)
059                    throws ChannelException;
060    
061            public void destroyChannelHub(long companyId) throws ChannelException;
062    
063            public ChannelHub fetchChannelHub(long companyId) throws ChannelException;
064    
065            public ChannelHub fetchChannelHub(long companyId, boolean createIfAbsent)
066                    throws ChannelException;
067    
068            public List<NotificationEvent> fetchNotificationEvents(
069                            long companyId, long userId, boolean flush)
070                    throws ChannelException;
071    
072            public void flush() throws ChannelException;
073    
074            public void flush(long companyId) throws ChannelException;
075    
076            public void flush(long companyId, long userId, long timestamp)
077                    throws ChannelException;
078    
079            public Channel getChannel(long companyId, long userId)
080                    throws ChannelException;
081    
082            public Channel getChannel(
083                            long companyId, long userId, boolean createIfAbsent)
084                    throws ChannelException;
085    
086            public ChannelHub getChannelHub(long companyId) throws ChannelException;
087    
088            public ChannelHub getChannelHub(long companyId, boolean createIfAbsent)
089                    throws ChannelException;
090    
091            public List<NotificationEvent> getNotificationEvents(
092                            long companyId, long userId)
093                    throws ChannelException;
094    
095            public List<NotificationEvent> getNotificationEvents(
096                            long companyId, long userId, boolean flush)
097                    throws ChannelException;
098    
099            public Collection<Long> getUserIds(long companyId) throws ChannelException;
100    
101            public void registerChannelListener(
102                            long companyId, long userId, ChannelListener channelListener)
103                    throws ChannelException;
104    
105            public void removeTransientNotificationEvents(
106                            long companyId, long userId,
107                            Collection<NotificationEvent> notificationEvents)
108                    throws ChannelException;
109    
110            public void removeTransientNotificationEventsByUuid(
111                            long companyId, long userId,
112                            Collection<String> notificationEventUuids)
113                    throws ChannelException;
114    
115            public void sendNotificationEvent(
116                            long companyId, long userId, NotificationEvent notificationEvent)
117                    throws ChannelException;
118    
119            public void sendNotificationEvents(
120                            long companyId, long userId,
121                            Collection<NotificationEvent> notificationEvents)
122                    throws ChannelException;
123    
124            public void storeNotificationEvent(
125                            long companyId, long userId, NotificationEvent notificationEvent)
126                    throws ChannelException;
127    
128            public void unregisterChannelListener(
129                            long companyId, long userId, ChannelListener channelListener)
130                    throws ChannelException;
131    
132    }