Class EventStoreDBProjectionManagementClient

java.lang.Object
com.eventstore.dbclient.EventStoreDBProjectionManagementClient

public class EventStoreDBProjectionManagementClient extends Object
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 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

      public CompletableFuture abort(String projectionName)
      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

      public CompletableFuture abort(String projectionName, AbortProjectionOptions options)
      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

      public CompletableFuture create(String projectionName, String query)
      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

      public CompletableFuture enable(String projectionName)
      Enables the projection.
      Parameters:
      projectionName - Name of the projection.
    • enable

      public CompletableFuture enable(String projectionName, EnableProjectionOptions options)
      Enables the projection.
      Parameters:
      projectionName - Name of the projection.
      options - Additional options.
    • delete

      public CompletableFuture delete(String projectionName)
      Deletes the projection.
      Parameters:
      projectionName - Name of the projection.
    • delete

      public CompletableFuture delete(String projectionName, DeleteProjectionOptions options)
      Deletes the projection.
      Parameters:
      projectionName - Name of the projection.
      options - Additional options.
    • disable

      public CompletableFuture disable(String projectionName)
      Disables the projection.
      Parameters:
      projectionName - Name of the projection.
    • disable

      public CompletableFuture disable(String projectionName, DisableProjectionOptions options)
      Disables the projection.
      Parameters:
      projectionName - Name of the projection.
      options - Additional options.
    • getResult

      public <TResult> CompletableFuture<TResult> getResult(String projectionName, Class<TResult> type)
      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

      public <TResult> CompletableFuture<TResult> getState(String projectionName, Class<TResult> type)
      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

      public CompletableFuture<ProjectionDetails> getStatistics(String projectionName)
      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

      public CompletableFuture<ProjectionDetails> getStatus(String projectionName)
      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

      public CompletableFuture reset(String projectionName)
      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

      public CompletableFuture reset(String projectionName, ResetProjectionOptions options)
      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

      public CompletableFuture restartSubsystem()
      Restarts the projection subsystem. This can be used to recover from certain kinds of errors.
    • restartSubsystem

      public CompletableFuture restartSubsystem(RestartProjectionSubsystemOptions options)
      Restarts the projection subsystem. This can be used to recover from certain kinds of errors.
      Parameters:
      options - Additional options.
    • update

      public CompletableFuture update(String projectionName, String query)
      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

      public CompletableFuture<Void> 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:
      true if client instance has been shutdown.