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