Package org.cyclos.impl.utils
Interface PushNotificationHandler
-
- All Known Subinterfaces:
PushNotificationHandlerImplementor
public interface PushNotificationHandlerHandler for using push notifications
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> voidpublish(PushNotificationEventContext<T> context, Long networkId, Supplier<T> dataSupplier)Publishes aPushNotificationEventto matching subscriptions, only calling the data supplier if some subscription is found.<T> voidpublish(PushNotificationEventContext<T> context, T data)Publishes aPushNotificationEventto matching subscriptions, with a pre-calculated data.
-
-
-
Method Detail
-
publish
<T> void publish(PushNotificationEventContext<T> context, Long networkId, Supplier<T> dataSupplier)
Publishes aPushNotificationEventto matching subscriptions, only calling the data supplier if some subscription is found. ATTENTION: The dataSupplier runs in another transaction, not the same as the caller. As such, it can't use any entities previously loaded, but find them again inside the supplier.- Parameters:
networkId- The network in which the transaction of the dataSupplier will run. When the dataSupplier is null or supplies a constant value, usepublish(PushNotificationEventContext, Object)instead, so an unnecessary transaction won't be opened.
-
publish
<T> void publish(PushNotificationEventContext<T> context, T data)
Publishes aPushNotificationEventto matching subscriptions, with a pre-calculated data.
-
-