« Notification Service: Testing e-mail with Dumbster - Notification Service: NotifierImplTest »

Notification Service: Notifier interface

20 November 2008

One more small piece to the puzzle today:

package org.restafarian.notify.service;

import java.util.List;

import org.restafarian.notify.beans.NoticeTemplate;

/**
 * <p>This is the Notifier interface.</p>
 */
public interface Notifier {

  /**
   * <p>Delivers the specified notification.</p>
   *
   * @param sendToAddress the "to" address of the message
   * @param templateId the id of the notice template in the form of context/name
   * @param noticeData optional data used to resolve variables in the notice
   */
  public void sendNotification(String sendToAddress, String templateId, Object noticeData);

  /**
   * <p>Delivers the specified notification.</p>
   *
   * @param sendTo the list of objects representing the notice recipients
   * @param templateId the id of the notice template in the form of context/name
   * @param noticeData optional data used to resolve variables in the notice
   */
  public void sendNotification(List sendTo, String templateId, Object noticeData);

  /**
   * <p>Delivers the specified notification.</p>
   *
   * @param sendTo the list of objects representing the notice recipients
   * @param sendToProperty the name of the property in the recipient object
   * that specifies the "to" address. If this parameter is null or blank, it
   * is assumed that the sendTo list contains simple "to" address strings
   * @param templateId the id of the notice template in the form of context/name
   * @param noticeData optional data used to resolve variables in the notice
   */
  public void sendNotification(List sendTo, String sendToProperty, String templateId,
       Object noticeData);

  /**
   * <p>Delivers the specified notification.</p>
   *
   * @param sendFrom the "from" address
   * @param sendTo the list of objects representing the notice recipients
   * @param sendToProperty the name of the property in the recipient object
   * that specifies the "to" address. If this parameter is null or blank, it
   * is assumed that the sendTo list contains simple "to" address strings
   * @param templateId the id of the notice template in the form of context/name
   * @param noticeData optional data used to resolve variables in the notice
   */
  public void sendNotification(String sendFrom, List sendTo, String sendToProperty,
       String templateId, Object noticeData);

  /**
   * <p>Delivers the specified notification.</p>
   *
   * @param sendFrom the "from" address
   * @param sendTo the list of objects representing the notice recipients
   * @param sendToProperty the name of the property in the recipient object
   * that specifies the "to" address. If this parameter is null or blank, it
   * is assumed that the sendTo list contains simple "to" address strings
   * @param noticeTemplate the notice template
   * @param noticeData optional data used to resolve variables in the notice
   */
  public void sendNotification(String sendFrom, List sendTo, String sendToProperty,
       NoticeTemplate noticeTemplate, Object noticeData);
}

I also have the implementation of the interface, but I’m not quite through with that one, so that will have to wait until next time.


http://blog.restafarian.org/2008/11/notification-service-notifier-interface/

Leave a reply

You must be logged in to post a comment.