001/*
002 * (C) Copyright 2007 Nuxeo SAS (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Nuxeo - initial API and implementation
016 *
017 * $Id$
018 */
019
020package org.nuxeo.ecm.platform.notification.api;
021
022import java.io.Serializable;
023import java.util.List;
024import java.util.Set;
025
026/**
027 * This class holds data about the notifications.
028 *
029 * @author <a href="mailto:npaslaru@nuxeo.com">Narcis Paslaru</a>
030 */
031public interface NotificationRegistry extends Serializable {
032
033    void clear();
034
035    void registerNotification(Notification notif, List<String> events);
036
037    @Deprecated
038    /**
039     * Deperecated since 5.7.2. Prefer to use unregisterNotification(Notification notif)
040     */
041    void unregisterNotification(Notification notif, List<String> events);
042
043    /**
044     * Gets the list of event names used by notifications.
045     *
046     * @since 5.4.2
047     */
048    Set<String> getNotificationEventNames();
049
050    List<Notification> getNotificationsForEvent(String eventId);
051
052    List<Notification> getNotifications();
053
054    List<Notification> getNotificationsForSubscriptions(String parentType);
055
056    /**
057     * Unregister notification contribution and remove reference in event registry
058     *
059     * @since 5.6
060     */
061    void unregisterNotification(Notification notif);
062
063}