View Javadoc
1   package com.reallifedeveloper.common.application.notification;
2   
3   import java.io.IOException;
4   import java.util.List;
5   
6   /**
7    * A publisher of notifications.
8    * <p>
9    * An implementation of this interface normally uses a messaging system to publish messages containing information about the notifications.
10   * In this case, the <i>publicationChannel</i> that is used by the {@link #publish(List, String)} method would correspond to an exchange
11   * name.
12   *
13   * @author RealLifeDeveloper
14   */
15  @FunctionalInterface
16  public interface NotificationPublisher {
17  
18      /**
19       * Publishes a number of notifications to the given publication channel.
20       *
21       * @param notifications      a list of {@code Notifications} to publish
22       * @param publicationChannel the name of the publication channel
23       *
24       * @throws IOException if publishing failed
25       */
26      void publish(List<Notification> notifications, String publicationChannel) throws IOException;
27  
28  }