Class EventStoreDBPersistentSubscriptionsClient
-
Method Summary
Modifier and TypeMethodDescriptioncreate(EventStoreDBClientSettings settings) Creates a persistent subscription client instance.createToAll(String group) Creates a persistent subscription group on the $all stream.createToAll(String group, CreatePersistentSubscriptionToAllOptions options) Creates a persistent subscription group on the $all stream.createToStream(String stream, String group) Creates a persistent subscription group on a stream.createToStream(String stream, String group, CreatePersistentSubscriptionToStreamOptions options) Creates a persistent subscription group on a stream.deleteToAll(String group) Deletes a persistent subscription group on the $all stream.deleteToAll(String group, DeletePersistentSubscriptionOptions options) Deletes a persistent subscription group on the $all stream.deleteToStream(String stream, String group) Deletes a persistent subscription group on a stream.deleteToStream(String stream, String group, DeletePersistentSubscriptionOptions options) Deletes a persistent subscription group on a stream.from(EventStoreDBClientBase existingClient) Returns a Persistent Subscription Management client based on existing client.getInfoToAll(String groupName) Gets a specific persistent subscription info to the $all stream.getInfoToAll(String groupName, GetPersistentSubscriptionInfoOptions options) Gets a specific persistent subscription info to the $all stream.getInfoToStream(String stream, String groupName) Gets a specific persistent subscription info to a stream.getInfoToStream(String stream, String groupName, GetPersistentSubscriptionInfoOptions options) Gets a specific persistent subscription info.booleanChecks if this client instance has been shutdown.listAll()Lists all existing persistent subscriptions.Lists all existing persistent subscriptions.Lists all persistent subscriptions of a specific to the $all stream.Lists all persistent subscriptions of a specific to the $all stream.listToStream(String stream) Lists all persistent subscriptions of a specific stream.listToStream(String stream, ListPersistentSubscriptionsOptions options) Lists all persistent subscriptions of a specific stream.replayParkedMessagesToAll(String groupName) Replays a persistent subscription to the $all stream parked events.replayParkedMessagesToAll(String groupName, ReplayParkedMessagesOptions options) Replays a persistent subscription to the $all stream parked events.replayParkedMessagesToStream(String stream, String groupName) Replays a persistent subscription to a stream parked events.replayParkedMessagesToStream(String stream, String groupName, ReplayParkedMessagesOptions options) Replays a persistent subscription to a stream parked events.Restarts the server persistent subscription subsystem.Restarts the server persistent subscription subsystem.shutdown()Closes a connection and cleans all its allocated resources.subscribeToAll(String group, PersistentSubscriptionListener listener) Connects to a persistent subscription group on the $all stream.subscribeToAll(String group, SubscribePersistentSubscriptionOptions options, PersistentSubscriptionListener listener) Connects to a persistent subscription group on the $all stream.subscribeToStream(String stream, String group, PersistentSubscriptionListener listener) Connects to a persistent subscription group on a stream.subscribeToStream(String stream, String group, SubscribePersistentSubscriptionOptions options, PersistentSubscriptionListener listener) Connects to a persistent subscription group on a stream.updateToAll(String group) Updates a persistent subscription group on the $all stream.updateToAll(String group, UpdatePersistentSubscriptionToAllOptions options) Updates a persistent subscription group on the $all stream.updateToStream(String stream, String group) Updates a persistent subscription group on a stream.updateToStream(String stream, String group, UpdatePersistentSubscriptionToStreamOptions options) Updates a persistent subscription group on a stream.
-
Method Details
-
create
Creates a persistent subscription client instance. -
from
Returns a Persistent Subscription Management client based on existing client.- Parameters:
existingClient- Existing client.
-
createToStream
Creates a persistent subscription group on a stream.Persistent subscriptions are special kind of subscription where the server remembers the state of the subscription. This allows for many different modes of operations compared to a regular or catchup subscription where the client holds the subscription state. Persistent subscriptions don't guarantee ordering and unlike catchup-subscriptions, they start from the end of stream by default.
- Parameters:
stream- stream's name.group- group's name
-
createToAll
Creates a persistent subscription group on the $all stream.Persistent subscriptions are special kind of subscription where the server remembers the state of the subscription. This allows for many different modes of operations compared to a regular or catchup subscription where the client holds the subscription state. Persistent subscriptions don't guarantee ordering and unlike catchup-subscriptions, they start from the end of stream by default.
- Parameters:
group- group's name
-
createToStream
public CompletableFuture createToStream(String stream, String group, CreatePersistentSubscriptionToStreamOptions options) Creates a persistent subscription group on a stream.Persistent subscriptions are special kind of subscription where the server remembers the state of the subscription. This allows for many different modes of operations compared to a regular or catchup subscription where the client holds the subscription state. Persistent subscriptions don't guarantee ordering and unlike catchup-subscriptions, they start from the end of stream by default.
- Parameters:
stream- stream's name.group- group's nameoptions- create persistent subscription request's options.
-
createToAll
public CompletableFuture createToAll(String group, CreatePersistentSubscriptionToAllOptions options) Creates a persistent subscription group on the $all stream.Persistent subscriptions are special kind of subscription where the server remembers the state of the subscription. This allows for many different modes of operations compared to a regular or catchup subscription where the client holds the subscription state. Persistent subscriptions don't guarantee ordering and unlike catchup-subscriptions, they start from the end of stream by default.
- Parameters:
group- group's nameoptions- create persistent subscription request's options.
-
updateToStream
Updates a persistent subscription group on a stream.- Parameters:
stream- stream's name.group- group's name.
-
updateToAll
Updates a persistent subscription group on the $all stream.- Parameters:
group- group's name.
-
updateToStream
public CompletableFuture updateToStream(String stream, String group, UpdatePersistentSubscriptionToStreamOptions options) Updates a persistent subscription group on a stream.- Parameters:
stream- stream's name.group- group's name.options- update persistent subscription request's options.
-
updateToAll
public CompletableFuture updateToAll(String group, UpdatePersistentSubscriptionToAllOptions options) Updates a persistent subscription group on the $all stream.- Parameters:
group- group's name.options- update persistent subscription request's options.
-
deleteToStream
Deletes a persistent subscription group on a stream.- Parameters:
stream- stream's name.group- group's name.
-
deleteToAll
Deletes a persistent subscription group on the $all stream.- Parameters:
group- group's name.
-
deleteToStream
public CompletableFuture deleteToStream(String stream, String group, DeletePersistentSubscriptionOptions options) Deletes a persistent subscription group on a stream.- Parameters:
stream- stream's name.group- group's name.options- the delete persistent subscription request's options.
-
deleteToAll
Deletes a persistent subscription group on the $all stream.- Parameters:
group- group's name.options- the delete persistent subscription request's options.
-
subscribeToStream
public CompletableFuture<PersistentSubscription> subscribeToStream(String stream, String group, PersistentSubscriptionListener listener) Connects to a persistent subscription group on a stream.- Parameters:
stream- stream's name.group- group's name.listener- persistent subscription event listener.- Returns:
- a persistent subscription handle.
-
subscribeToAll
public CompletableFuture<PersistentSubscription> subscribeToAll(String group, PersistentSubscriptionListener listener) Connects to a persistent subscription group on the $all stream.- Parameters:
group- group's name.listener- persistent subscription event listener.- Returns:
- a persistent subscription handle.
-
subscribeToStream
public CompletableFuture<PersistentSubscription> subscribeToStream(String stream, String group, SubscribePersistentSubscriptionOptions options, PersistentSubscriptionListener listener) Connects to a persistent subscription group on a stream.- Parameters:
stream- stream's name.group- group's name.options- a persistent subscription subscribe's request.listener- persistent subscription event listener.- Returns:
- a persistent subscription handle.
-
subscribeToAll
public CompletableFuture<PersistentSubscription> subscribeToAll(String group, SubscribePersistentSubscriptionOptions options, PersistentSubscriptionListener listener) Connects to a persistent subscription group on the $all stream.- Parameters:
group- group's name.options- a persistent subscription subscribe's request.listener- persistent subscription event listener.- Returns:
- a persistent subscription handle.
-
listAll
public CompletableFuture<List<PersistentSubscriptionInfo>> listAll(ListPersistentSubscriptionsOptions options) Lists all existing persistent subscriptions.- Parameters:
options- list persistent subscriptions request's options.- See Also:
-
listAll
Lists all existing persistent subscriptions.- See Also:
-
listToStream
public CompletableFuture<List<PersistentSubscriptionToStreamInfo>> listToStream(String stream, ListPersistentSubscriptionsOptions options) Lists all persistent subscriptions of a specific stream.- Parameters:
stream- stream's name.options- list persistent subscriptions request's options.
-
listToStream
Lists all persistent subscriptions of a specific stream.- Parameters:
stream- stream's name.- See Also:
-
listToAll
Lists all persistent subscriptions of a specific to the $all stream.- See Also:
-
listToAll
public CompletableFuture<List<PersistentSubscriptionToAllInfo>> listToAll(ListPersistentSubscriptionsOptions options) Lists all persistent subscriptions of a specific to the $all stream.- Parameters:
options- list persistent subscriptions request's options.- See Also:
-
getInfoToStream
public CompletableFuture<Optional<PersistentSubscriptionToStreamInfo>> getInfoToStream(String stream, String groupName, GetPersistentSubscriptionInfoOptions options) Gets a specific persistent subscription info.- Parameters:
stream- stream's name.groupName- group's name.options- get persistent subscription info request's options.- See Also:
-
getInfoToStream
public CompletableFuture<Optional<PersistentSubscriptionToStreamInfo>> getInfoToStream(String stream, String groupName) Gets a specific persistent subscription info to a stream.- Parameters:
stream- stream's name.groupName- group's name.- See Also:
-
getInfoToAll
public CompletableFuture<Optional<PersistentSubscriptionToAllInfo>> getInfoToAll(String groupName, GetPersistentSubscriptionInfoOptions options) Gets a specific persistent subscription info to the $all stream.- Parameters:
groupName- group's name.options- get persistent subscription info request's options.- See Also:
-
getInfoToAll
Gets a specific persistent subscription info to the $all stream.- Parameters:
groupName- group's name.- See Also:
-
replayParkedMessagesToStream
public CompletableFuture replayParkedMessagesToStream(String stream, String groupName, ReplayParkedMessagesOptions options) Replays a persistent subscription to a stream parked events.- Parameters:
stream- stream's name.groupName- group's name.options- replay parked messages to stream request's options.
-
replayParkedMessagesToStream
Replays a persistent subscription to a stream parked events.- Parameters:
stream- stream's name.groupName- group's name.
-
replayParkedMessagesToAll
public CompletableFuture replayParkedMessagesToAll(String groupName, ReplayParkedMessagesOptions options) Replays a persistent subscription to the $all stream parked events.- Parameters:
groupName- group's name.options- replay parked messages to stream request's options.
-
replayParkedMessagesToAll
public CompletableFuture replayParkedMessagesToAll(String groupName) throws ExecutionException, InterruptedException Replays a persistent subscription to the $all stream parked events.- Parameters:
groupName- group's name.- Throws:
ExecutionExceptionInterruptedException
-
restartSubsystem
Restarts the server persistent subscription subsystem. -
restartSubsystem
Restarts the server persistent subscription subsystem.- Parameters:
options- restart persistent subscription subsystem request's options.
-
shutdown
Closes a connection and cleans all its allocated resources. -
isShutdown
public boolean isShutdown()Checks if this client instance has been shutdown. After shutdown a client instance can no longer process new operations and a new client instance has to be created.- Returns:
trueif client instance has been shutdown.
-