View Javadoc

1   /**
2    * Copyright 2005-2006 the original author or authors.
3    *
4    * Licensed under the Gnu General Pubic License, Version 2.0 (the
5    * "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    *
8    *      http://www.opensource.org/licenses/gpl-license.php
9    *
10   * This program is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13   * See the Gnu General Public License for more details.
14   */
15  package org.figure8.join.services.notification;
16  
17  import org.figure8.join.services.remoting.beans.RemoteSubscriber;
18  /**
19   * This is an extension of Notifier interface. Implementations should define
20   * how to extract notifier recipients from the {@link RemoteSubscriber} objects.
21   * <br/>
22   * The method <code>extractRecipients(RemoteSubscriber[])</code> would be typically
23   * used before calling <code>notify()</code>. Implementations may also provide the helper
24   * <code>notify()</code> method using RemoteSubscribers as argument.
25   *
26   * @author <a href="mailto:laurent.broudoux@free.fr">Laurent Broudoux</a>
27   * @version $Revision: 1.1 $
28   */
29  public interface SubscribersNotifier extends Notifier{
30  
31     // Public -------------------------------------------------------------------
32  
33     /**
34      * Defines how to extract Notifier recipients from RemoteSubscriber objects
35      * @param subscribers The subscribers to get recipients for
36      * @return The list of corresponding recipients.
37      */
38     public abstract String[] extractRecipients(RemoteSubscriber[] subscribers);
39  
40     /**
41      * Notify subscribers of mailing list defined into Join application
42      * @param subscribers The subscriber of mailing list to notify
43      * @param title The title of notification message to send
44      * @param content The content of notification message to send
45      * @throws NotificationException if an exception occurs during the notification operation
46      * (usually they are network related exceptions)
47      */
48     public abstract void notify(RemoteSubscriber[] subscribers, String title, String content)
49             throws NotificationException;
50  }