Interface ComponentClient


@DoNotInherit public interface ComponentClient
Utility to send requests to other components by composing a call that can be executed by the runtime. To compose a call:
  1. select component type (and pass id if necessary)
  2. select component method, by using Java method reference operator (::)
  3. provide a request parameter (if required)

Example of use on a cross-component call:


 public CompletionStage<Done> addItem(String cartId, ShoppingCart.LineItem item) {
   return componentClient.forEventSourcedEntity(cartId)
     .method(ShoppingCartEntity::addItem)
     .invokeAsync(item);
 }
 
Not for user extension, implementation provided by the SDK.
  • Method Details

    • forTimedAction

      TimedActionClient forTimedAction()
      Select TimedAction as a call target component.
    • forKeyValueEntity

      KeyValueEntityClient forKeyValueEntity(String keyValueEntityId)
      Select KeyValueEntity as a call target component.
      Parameters:
      keyValueEntityId - - key value entity id used to create a call. Must not be null or empty string.
    • forEventSourcedEntity

      EventSourcedEntityClient forEventSourcedEntity(String eventSourcedEntityId)
      Select EventSourcedEntity as a call target component.
      Parameters:
      eventSourcedEntityId - - event sourced entity id used to create a call. Must not be null or empty string.
    • forWorkflow

      WorkflowClient forWorkflow(String workflowId)
      Select Workflow as a call target component.
      Parameters:
      workflowId - - workflow id used to create a call. Must not be null or empty string.
    • forView

      ViewClient forView()
      Select View as a call target component.