Class NexusClientImpl

java.lang.Object
io.temporal.client.NexusClientImpl
All Implemented Interfaces:
NexusClient

@Experimental public class NexusClientImpl extends Object implements NexusClient
  • Method Details

    • newInstance

      public static NexusClient newInstance(io.temporal.serviceclient.WorkflowServiceStubs service, NexusClientOptions options)
    • getWorkflowServiceStubs

      public io.temporal.serviceclient.WorkflowServiceStubs getWorkflowServiceStubs()
      Description copied from interface: NexusClient
      Returns the underlying gRPC stubs this client routes RPCs through.
      Specified by:
      getWorkflowServiceStubs in interface NexusClient
    • getHandle

      public UntypedNexusOperationHandle getHandle(String operationId, @Nullable String runId)
      Description copied from interface: NexusClient
      Returns an untyped handle to an existing operation execution, optionally pinned to a specific run.
      Specified by:
      getHandle in interface NexusClient
      Parameters:
      operationId - the user-assigned operation ID
      runId - the server-assigned run ID, or null to target the latest run
      Returns:
      an untyped handle
    • getHandle

      public <R> NexusOperationHandle<R> getHandle(String operationId, @Nullable String runId, Class<R> resultClass)
      Description copied from interface: NexusClient
      Returns a typed handle to an existing operation execution, bound to resultClass.
      Specified by:
      getHandle in interface NexusClient
      Type Parameters:
      R - result type
      Parameters:
      operationId - the user-assigned operation ID
      runId - the server-assigned run ID, or null to target the latest run
      resultClass - expected result type
    • getHandle

      public <R> NexusOperationHandle<R> getHandle(String operationId, @Nullable String runId, Class<R> resultClass, @Nullable Type resultType)
      Description copied from interface: NexusClient
      Returns a typed handle to an existing operation execution, bound to resultClass/ resultType. Use the resultType variant when the result is a generic type whose parameters cannot be captured by Class alone (e.g. List<String>).
      Specified by:
      getHandle in interface NexusClient
      Type Parameters:
      R - result type
      Parameters:
      operationId - the user-assigned operation ID
      runId - the server-assigned run ID, or null to target the latest run
      resultClass - expected result class
      resultType - generic type for deserialization; may be null
    • newNexusServiceClient

      public <T> NexusServiceClient<T> newNexusServiceClient(Class<T> service, String endpoint)
      Description copied from interface: NexusClient
      Builds a typed service-bound client targeting the given endpoint, dispatching operations by method reference on the @ServiceInterface-annotated service. Reuses this client's stubs, options, and interceptor chain.
      Specified by:
      newNexusServiceClient in interface NexusClient
      Type Parameters:
      T - the service interface type
      Parameters:
      service - the @ServiceInterface-annotated service type
      endpoint - Nexus endpoint name registered on the Temporal Service
    • newUntypedNexusServiceClient

      public UntypedNexusServiceClient newUntypedNexusServiceClient(String endpoint, String serviceName)
      Description copied from interface: NexusClient
      Builds an untyped service-bound client targeting the given endpoint and service. Use this to dispatch operations by name string when no service interface is available.
      Specified by:
      newUntypedNexusServiceClient in interface NexusClient
      Parameters:
      endpoint - Nexus endpoint name registered on the Temporal Service
      serviceName - Nexus service name on that endpoint
    • listNexusOperationExecutions

      public Stream<NexusOperationExecutionMetadata> listNexusOperationExecutions(@Nullable String query)
      Description copied from interface: NexusClient
      Returns a stream of standalone Nexus operation executions matching the given visibility query. The stream paginates lazily over server-side results — pages are fetched on demand as the stream is consumed.
      Specified by:
      listNexusOperationExecutions in interface NexusClient
      Parameters:
      query - Temporal visibility query string, or null to return all executions in the client namespace
      Returns:
      a lazy stream of matching executions
    • countNexusOperationExecutions

      public NexusOperationExecutionCount countNexusOperationExecutions(@Nullable String query)
      Description copied from interface: NexusClient
      Returns the count of standalone Nexus operation executions matching the given visibility query, optionally with aggregation groups.
      Specified by:
      countNexusOperationExecutions in interface NexusClient
      Parameters:
      query - Temporal visibility query string, or null to count all executions in the client namespace
      Returns:
      execution count, optionally with aggregation groups when the query uses GROUP BY