Class StandardNotification

java.lang.Object
dev.getelements.elements.service.notification.StandardNotification
All Implemented Interfaces:
Notification

public class StandardNotification extends Object implements Notification
  • Constructor Details

  • Method Details

    • send

      public int send(Consumer<NotificationEvent> success, Consumer<Exception> failure)
      Description copied from interface: Notification
      Enqueues this Notification to be sent. This call may block, but should return as reasonably quickly as possible. This does not guarantee delivery, and may drop the message without reporting an error if necessary but should make all reasonable efforts to ensure the message has been sent. For example, this may ensure that the message was received by the underlying message service but will not provide a guarantee that it was delivered when it returns. Not that either lambda may be called multiple times, or never called.
      Specified by:
      send in interface Notification
      Parameters:
      success - called when a message was successfully sent, note this may be called multiple times
      failure - called when a message failed
      Returns:
      the number of destinations that recieved the Notification
    • getNotificationParameters

      public NotificationParameters getNotificationParameters()
    • getNotificationDestinationFactory

      public Function<NotificationParameters,Stream<NotificationDestination>> getNotificationDestinationFactory()
    • setNotificationDestinationFactory

      @Inject public void setNotificationDestinationFactory(NotificationDestinationFactory notificationDestinationFactory)