Interface AutomationNotificationService

All Known Implementing Classes:
NoopAutomationNotificationService

public interface AutomationNotificationService
Lightweight messaging service to publish rule updates to many clients via websockets or similar technologies.
  • Method Details

    • getTopic

      String getTopic(String clientKey, NotificationEntityType type, String id)
      The topic that clients can subscribe to and updates will be published to.
      Parameters:
      clientKey - The tenant to which the update should be published
      type - the type of entity that was updated
      id - the id of the entity that was updated
      Returns:
      a topic that can be subscribed or published to
    • getWebSocketUrl

      String getWebSocketUrl(Environment env)
      Returns a websocket url that clients can use to subscribe to a topic. This should include signing parameters for security if necessary
      Parameters:
      env - the environment for which to get the url
      Returns:
      a websocket url starting with wss://
    • publishUpdates

      void publishUpdates(TenantContext dbContext, Long itemId, NotificationEntityType type, Set<String> updatedIds)
      Publishes an update (itemId is a unique identifier for the update) to all provided entity ids.
      Parameters:
      dbContext - The tenant to publish the update to
      itemId - a unique identifier for the update
      type - the entity type that was updated
      updatedIds - all entity ids that were updated