Package com.eventstore.dbclient
Class EventStoreDBProjectionManagementClient
java.lang.Object
com.eventstore.dbclient.EventStoreDBProjectionManagementClient
Represents EventStoreDB client for projections management. A client instance maintains a two-way communication to EventStoreDB.
Many threads can use the EventStoreDB client simultaneously, or a single thread can make many asynchronous requests.
-
Method Summary
Modifier and TypeMethodDescriptionStops the projection without writing a checkpoint.abort(String projectionName, AbortProjectionOptions options) Stops the projection without writing a checkpoint.create(EventStoreDBClientSettings settings) Returns the Projection Management client based on the settings.Creates a new projection in the stopped state.create(String projectionName, String query, CreateProjectionOptions options) Creates a new projection in the stopped state.Deletes the projection.delete(String projectionName, DeleteProjectionOptions options) Deletes the projection.Disables the projection.disable(String projectionName, DisableProjectionOptions options) Disables the projection.Enables the projection.enable(String projectionName, EnableProjectionOptions options) Enables the projection.from(EventStoreDBClientBase existingClient) Returns a Projection Management client based on existing client.<TResult> CompletableFuture<TResult>Gets the projection's result.<TResult> CompletableFuture<TResult>getResult(String projectionName, Class<TResult> type, GetProjectionResultOptions options) Gets the projection's result.<TResult> CompletableFuture<TResult>getResult(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction) Gets the projection's result.<TResult> CompletableFuture<TResult>getResult(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction, GetProjectionResultOptions options) Gets the projection's result.<TResult> CompletableFuture<TResult>Gets the state of the projection.<TResult> CompletableFuture<TResult>getState(String projectionName, Class<TResult> type, GetProjectionStateOptions options) Gets the state of the projection.<TResult> CompletableFuture<TResult>getState(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction) Gets the state of the projection.<TResult> CompletableFuture<TResult>getState(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction, GetProjectionStateOptions options) Gets the state of the projection.getStatistics(String projectionName) Gets the statistics for the projection.getStatistics(String projectionName, GetProjectionStatisticsOptions options) Gets the statistics for the projection.Gets the projection's current status.getStatus(String projectionName, GetProjectionStatusOptions options) Gets the projection's current status.booleanChecks if this client instance has been shutdown.list()Lists all continuous projections.list(ListProjectionsOptions options) Lists all continuous projections.Resets the projection, causing it to start again from the beginning of the stream/s it selects from.reset(String projectionName, ResetProjectionOptions options) Resets the projection, causing it to start again from the beginning of the stream/s it selects from.Restarts the projection subsystem.Restarts the projection subsystem.shutdown()Closes a connection and cleans all its allocated resources.Updates the projection's query and emit options.update(String projectionName, String query, UpdateProjectionOptions options) Updates the projection's query and emit options.
-
Method Details
-
create
Returns the Projection Management client based on the settings.- Parameters:
settings- The settings to use for constructing the client.
-
from
Returns a Projection Management client based on existing client.- Parameters:
existingClient- Existing client.
-
abort
Stops the projection without writing a checkpoint. This can be used to disable a projection that has been faulted.- Parameters:
projectionName- Name of the projection.
-
abort
Stops the projection without writing a checkpoint. This can be used to disable a projection that has been faulted.- Parameters:
projectionName- Name of the projection.options- Additional options.
-
create
Creates a new projection in the stopped state. Enable needs to be called separately to start the projection.- Parameters:
projectionName- Name of the projection.query- The JavaScript projection.
-
create
public CompletableFuture create(String projectionName, String query, CreateProjectionOptions options) Creates a new projection in the stopped state. Enable needs to be called separately to start the projection.- Parameters:
projectionName- Name of the projection.query- The JavaScript projection.options- Additional options.
-
enable
Enables the projection.- Parameters:
projectionName- Name of the projection.
-
enable
Enables the projection.- Parameters:
projectionName- Name of the projection.options- Additional options.
-
delete
Deletes the projection.- Parameters:
projectionName- Name of the projection.
-
delete
Deletes the projection.- Parameters:
projectionName- Name of the projection.options- Additional options.
-
disable
Disables the projection.- Parameters:
projectionName- Name of the projection.
-
disable
Disables the projection.- Parameters:
projectionName- Name of the projection.options- Additional options.
-
getResult
Gets the projection's result.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.type- Type of the class to construct for the result.
-
getResult
public <TResult> CompletableFuture<TResult> getResult(String projectionName, Class<TResult> type, GetProjectionResultOptions options) Gets the projection's result.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.type- Type of the class to construct for the result.
-
getResult
public <TResult> CompletableFuture<TResult> getResult(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction) Gets the projection's result.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.javaTypeFunction- Factory method for constructing the return type.
-
getResult
public <TResult> CompletableFuture<TResult> getResult(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction, GetProjectionResultOptions options) Gets the projection's result.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.javaTypeFunction- Factory method for constructing the return type.
-
getState
Gets the state of the projection.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.type- Type of the class to construct for the result.
-
getState
public <TResult> CompletableFuture<TResult> getState(String projectionName, Class<TResult> type, GetProjectionStateOptions options) Gets the state of the projection.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.type- Type of the class to construct for the result.
-
getState
public <TResult> CompletableFuture<TResult> getState(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction) Gets the state of the projection.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.javaTypeFunction- Factory method for constructing the return type.
-
getState
public <TResult> CompletableFuture<TResult> getState(String projectionName, Function<com.fasterxml.jackson.databind.type.TypeFactory, com.fasterxml.jackson.databind.JavaType> javaTypeFunction, GetProjectionStateOptions options) Gets the state of the projection.- Type Parameters:
TResult- The result type to return.- Parameters:
projectionName- Name of the projection.javaTypeFunction- Factory method for constructing the return type.
-
getStatistics
Gets the statistics for the projection.- Parameters:
projectionName- Name of the projection.
-
getStatistics
public CompletableFuture<ProjectionDetails> getStatistics(String projectionName, GetProjectionStatisticsOptions options) Gets the statistics for the projection.- Parameters:
projectionName- Name of the projection.options- Additional options.
-
getStatus
Gets the projection's current status.- Parameters:
projectionName- Name of the projection.
-
getStatus
public CompletableFuture<ProjectionDetails> getStatus(String projectionName, GetProjectionStatusOptions options) Gets the projection's current status.- Parameters:
projectionName- Name of the projection.options- Additional options.
-
list
Lists all continuous projections. -
list
Lists all continuous projections.- Parameters:
options- Additional options.
-
reset
Resets the projection, causing it to start again from the beginning of the stream/s it selects from. Resetting a projection will truncate all emitted streams and re-emit all events.- Parameters:
projectionName- Name of the projection.
-
reset
Resets the projection, causing it to start again from the beginning of the stream/s it selects from. Resetting a projection will truncate all emitted streams and re-emit all events.- Parameters:
projectionName- Name of the projection.options- Additional options.
-
restartSubsystem
Restarts the projection subsystem. This can be used to recover from certain kinds of errors. -
restartSubsystem
Restarts the projection subsystem. This can be used to recover from certain kinds of errors.- Parameters:
options- Additional options.
-
update
Updates the projection's query and emit options.- Parameters:
projectionName- Name of the projection.query- The JavaScript projection.
-
update
public CompletableFuture update(String projectionName, String query, UpdateProjectionOptions options) Updates the projection's query and emit options.- Parameters:
projectionName- Name of the projection.query- The JavaScript projection.options- Additional 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.
-