Interface EventSink
- All Known Implementing Classes:
EventSinkImpl
public interface EventSink
Interface to manage WS-Eventing subscriptions.
-
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.util.concurrent.ListenableFuture<Duration>Gets the status of a subscription.com.google.common.util.concurrent.ListenableFuture<Duration>Renews a subscription.com.google.common.util.concurrent.ListenableFuture<SubscribeResult>subscribe(String filterDialect, List<Object> filters, Duration expires, NotificationSink notificationSink) Sends a Subscribe request.com.google.common.util.concurrent.ListenableFuture<?>unsubscribe(String subscriptionId) Unsubscribes from a subscription.voidSynchronously unsubscribes all subscriptions.
-
Method Details
-
subscribe
com.google.common.util.concurrent.ListenableFuture<SubscribeResult> subscribe(String filterDialect, List<Object> filters, @Nullable Duration expires, NotificationSink notificationSink) Sends a Subscribe request.- Parameters:
filterDialect- the URI that describes the filter object.filters- the list of filter objectsexpires- desired expiration time (the hosted service may decide to grant less than this). If none is given, the hosting service will take decision.notificationSink- sink where to deliver notifications.- Returns:
- a future object that in case of a success includes subscription information or throws
-
renew
com.google.common.util.concurrent.ListenableFuture<Duration> renew(String subscriptionId, Duration expires) Renews a subscription.- Parameters:
subscriptionId- the subscription id obtained in theSubscribeResultofsubscribe(String, List, Duration, NotificationSink).expires- the desired new expiration duration.- Returns:
- a future object that in case of a success includes a granted expires duration or throws
-
getStatus
Gets the status of a subscription.- Parameters:
subscriptionId- the subscription id obtained in theSubscribeResultofsubscribe(String, List, Duration, NotificationSink).- Returns:
- a future object that in case of a success includes the remaining subscription time or throws
-
unsubscribe
Unsubscribes from a subscription.- Parameters:
subscriptionId- the subscription id obtained in theSubscribeResultofsubscribe(String, List, Duration, NotificationSink).- Returns:
- a future object that in case of a success includes an empty Object instance or throws
-
unsubscribeAll
void unsubscribeAll()Synchronously unsubscribes all subscriptions.Once this function returns, all running subscriptions have been tried to unsubscribe. Errors are swallowed.
-