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(String notificationEventUuid)
035                    throws ChannelException;
036    
037            public void flush() throws ChannelException;
038    
039            public void flush(long timestamp) throws ChannelException;
040    
041            public List<NotificationEvent> getNotificationEvents()
042                    throws ChannelException;
043    
044            public List<NotificationEvent> getNotificationEvents(boolean flush)
045                    throws ChannelException;
046    
047            public long getUserId();
048    
049            public void init() throws ChannelException;
050    
051            public void registerChannelListener(ChannelListener channelListener);
052    
053            public void removeTransientNotificationEvents(
054                    Collection<NotificationEvent> notificationEvents);
055    
056            public void removeTransientNotificationEventsByUuid(
057                    Collection<String> notificationEventUuids);
058    
059            public void sendNotificationEvent(NotificationEvent notificationEvent)
060                    throws ChannelException;
061    
062            public void sendNotificationEvents(
063                            Collection<NotificationEvent> notificationEvents)
064                    throws ChannelException;
065    
066            public void unregisterChannelListener(ChannelListener channelListener);
067    
068    }