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 Channel {
024    
025            public void cleanUp() throws ChannelException;
026    
027            public Channel clone(long companyId, long userId);
028    
029            public void close() throws ChannelException;
030    
031            public void confirmDelivery(Collection<String> notificationEventUuids)
032                    throws ChannelException;
033    
034            public void confirmDelivery(
035                            Collection<String> notificationEventUuids, boolean archive)
036                    throws ChannelException;
037    
038            public void confirmDelivery(String notificationEventUuid)
039                    throws ChannelException;
040    
041            public void confirmDelivery(String notificationEventUuid, boolean archive)
042                    throws ChannelException;
043    
044            public void deleteUserNotificiationEvent(String notificationEventUuid)
045                    throws ChannelException;
046    
047            public void deleteUserNotificiationEvents(
048                            Collection<String> notificationEventUuids)
049                    throws ChannelException;
050    
051            public void flush() throws ChannelException;
052    
053            public void flush(long timestamp) throws ChannelException;
054    
055            public List<NotificationEvent> getNotificationEvents()
056                    throws ChannelException;
057    
058            public List<NotificationEvent> getNotificationEvents(boolean flush)
059                    throws ChannelException;
060    
061            public long getUserId();
062    
063            public void init() throws ChannelException;
064    
065            public void registerChannelListener(ChannelListener channelListener);
066    
067            public void removeTransientNotificationEvents(
068                    Collection<NotificationEvent> notificationEvents);
069    
070            public void removeTransientNotificationEventsByUuid(
071                    Collection<String> notificationEventUuids);
072    
073            public void sendNotificationEvent(NotificationEvent notificationEvent)
074                    throws ChannelException;
075    
076            public void sendNotificationEvents(
077                            Collection<NotificationEvent> notificationEvents)
078                    throws ChannelException;
079    
080            public void storeNotificationEvent(
081                            NotificationEvent notificationEvent, long currentTime)
082                    throws ChannelException;
083    
084            public void unregisterChannelListener(ChannelListener channelListener);
085    
086    }