001    /**
002     * Copyright (c) 2000-2011 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 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 unregisterChannelListener(ChannelListener channelListener);
081    
082    }