Interface Notifications2Api
- All Known Implementing Classes:
Notifications2ApiImpl
public interface Notifications2Api
Simplified API for Notifications 2.0 that hides most of the complexity and allows easy usage of these features.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(Subscription.ID subscriptionId) Used to clean up platform resources created for given subscription.void
disconnect
(Subscription.ID subscriptionId, boolean unsubscribe) Closes server connection and stops given subscription
If connection is not existing or not active, nothing will happen.getRawWebSocket
(Subscription.ID subscriptionId) Finds and returns low-level web socket object if one was created for subscriptionvoid
subscribe
(Subscription subscription, NotificationListener listener) Makes new subscription based on requested definition.
-
Method Details
-
subscribe
Makes new subscription based on requested definition.
If connection is already existing and active,Notifications2SubscriptionAlreadyEstablishedException
will be thrown- Parameters:
subscription
- subscription definitionlistener
- notification listener
-
disconnect
Closes server connection and stops given subscription
If connection is not existing or not active, nothing will happen.- Parameters:
subscriptionId
- subscription identifier to unsubscribeunsubscribe
- true if token should be unsubscribed (only taken into account for persistent targets)
-
delete
Used to clean up platform resources created for given subscription.
WARNING! Please be aware that deleting subscription will close all of its connections - even from other applications (i.e. instances of the same microservice).- Parameters:
subscriptionId
- subscription identifier to delete
-
getRawWebSocket
Finds and returns low-level web socket object if one was created for subscription- Parameters:
subscriptionId
- subscription identifier
-