Interface EventSink
-
- All Implemented Interfaces:
public interface EventSinkInterface to manage WS-Eventing subscriptions.
-
-
Method Summary
Modifier and Type Method Description abstract ListenableFuture<SubscribeResult>subscribe(String filterDialect, List<Object> filters, @Nullable() Duration expires, NotificationSink notificationSink)Sends a Subscribe request. abstract ListenableFuture<Duration>renew(String subscriptionId, Duration expires)Renews a subscription. abstract ListenableFuture<Duration>getStatus(String subscriptionId)Gets the status of a subscription. abstract ListenableFuture<out Object>unsubscribe(String subscriptionId)Unsubscribes from a subscription. abstract voidunsubscribeAll()Synchronously unsubscribes all subscriptions. -
-
Method Detail
-
subscribe
abstract 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).notificationSink- sink where to deliver notifications.- Returns:
a future object that in case of a success includes subscription information or throws
-
renew
abstract ListenableFuture<Duration> renew(String subscriptionId, Duration expires)
Renews a subscription.
- Parameters:
subscriptionId- the subscription id obtained in the SubscribeResult of subscribe.expires- the desired new expiration duration.- Returns:
a future object that in case of a success includes a granted expires duration or throws
-
getStatus
abstract ListenableFuture<Duration> getStatus(String subscriptionId)
Gets the status of a subscription.
- Parameters:
subscriptionId- the subscription id obtained in the SubscribeResult of subscribe.- Returns:
a future object that in case of a success includes the remaining subscription time or throws
-
unsubscribe
abstract ListenableFuture<out Object> unsubscribe(String subscriptionId)
Unsubscribes from a subscription.
- Parameters:
subscriptionId- the subscription id obtained in the SubscribeResult of subscribe.- Returns:
a future object that in case of a success includes an empty Object instance or throws
-
unsubscribeAll
abstract void unsubscribeAll()
Synchronously unsubscribes all subscriptions.
Once this function returns, all running subscriptions have been tried to unsubscribe. Errors are swallowed.
-
-
-
-