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 Summary
Modifier and TypeMethodDescriptiongetTopic(String clientKey, NotificationEntityType type, String id) The topic that clients can subscribe to and updates will be published to.Returns a websocket url that clients can use to subscribe to a topic.voidpublishUpdates(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.
-
Method Details
-
getTopic
The topic that clients can subscribe to and updates will be published to.- Parameters:
clientKey- The tenant to which the update should be publishedtype- the type of entity that was updatedid- the id of the entity that was updated- Returns:
- a topic that can be subscribed or published to
-
getWebSocketUrl
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 toitemId- a unique identifier for the updatetype- the entity type that was updatedupdatedIds- all entity ids that were updated
-