Interface PushNotificationListener<T>

Type Parameters:
T - The type of the message.
All Known Implementing Classes:
AbstractPushNotificationListener, ClientTagSubscriptionManager.ValueUpdateListener, ScriptMessageReceiver, ScriptModuleChangeListener

public interface PushNotificationListener<T>
A listener for "push notifications" (out of band events broadcast from the gateway).
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    The message type this instance should be registered to.
    The module id this instance should be registered to.
    of(String moduleId, String messageType, Consumer<U> listener)
    Creates a new PushNotificationListener that invokes the provided listener on the EDT.
    void
    receiveNotification(T notification)
    A callback to be invoked when a notification is received.
  • Method Details

    • moduleId

      String moduleId()
      The module id this instance should be registered to.
      Returns:
      The module id.
    • messageType

      String messageType()
      The message type this instance should be registered to.
      Returns:
      The message type.
    • receiveNotification

      void receiveNotification(T notification)
      A callback to be invoked when a notification is received. Will be run on a queue owned by the local scope's GatewayConnection instance.
      Parameters:
      notification - The notification.
    • of

      static <U> PushNotificationListener<U> of(String moduleId, String messageType, Consumer<U> listener)
      Creates a new PushNotificationListener that invokes the provided listener on the EDT.
      Type Parameters:
      U - The type of the message.
      Parameters:
      moduleId - The module id to listen to.
      messageType - The message type to listen to.
      listener - The listener to invoke when a notification is received.
      Returns:
      A new PushNotificationListener that will only accept notifications of the given type.
      See Also: