Class DaprClientHttp

java.lang.Object
io.dapr.client.DaprClientHttp
All Implemented Interfaces:
DaprClient, java.lang.AutoCloseable

public class DaprClientHttp
extends java.lang.Object
An adapter for the HTTP Client.
See Also:
DaprHttp, DaprClient
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected DaprObjectSerializer objectSerializer
    A utility class for serialize and deserialize the transient objects.
    protected DaprObjectSerializer stateSerializer
    A utility class for serialize and deserialize state objects.
  • Method Summary

    Modifier and Type Method Description
    void close()
    reactor.core.publisher.Mono<java.lang.Void> deleteState​(DeleteStateRequest request)
    Delete a state.
    reactor.core.publisher.Mono<java.lang.Void> deleteState​(java.lang.String storeName, java.lang.String key)
    Delete a state.
    reactor.core.publisher.Mono<java.lang.Void> deleteState​(java.lang.String storeName, java.lang.String key, java.lang.String etag, StateOptions options)
    Delete a state.
    reactor.core.publisher.Mono<java.lang.Void> executeStateTransaction​(ExecuteStateTransactionRequest request)
    Execute a transaction.
    reactor.core.publisher.Mono<java.lang.Void> executeStateTransaction​(java.lang.String storeName, java.util.List<TransactionalStateOperation<?>> operations)
    Execute a transaction.
    reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>>> getBulkSecret​(GetBulkSecretRequest request)
    Fetches all secrets from the configured vault.
    reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>>> getBulkSecret​(java.lang.String storeName)
    Fetches all secrets from the configured vault.
    reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>>> getBulkSecret​(java.lang.String storeName, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Fetches all secrets from the configured vault.
    <T> reactor.core.publisher.Mono<java.util.List<State<T>>> getBulkState​(GetBulkStateRequest request, TypeRef<T> type)
    Retrieve bulk States based on their keys.
    <T> reactor.core.publisher.Mono<java.util.List<State<T>>> getBulkState​(java.lang.String storeName, java.util.List<java.lang.String> keys, TypeRef<T> type)
    Retrieve bulk States based on their keys.
    <T> reactor.core.publisher.Mono<java.util.List<State<T>>> getBulkState​(java.lang.String storeName, java.util.List<java.lang.String> keys, java.lang.Class<T> clazz)
    Retrieve bulk States based on their keys.
    reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.lang.String>> getSecret​(GetSecretRequest request)
    Fetches a secret from the configured vault.
    reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.lang.String>> getSecret​(java.lang.String storeName, java.lang.String secretName)
    Fetches a secret from the configured vault.
    reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.lang.String>> getSecret​(java.lang.String storeName, java.lang.String key, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Fetches a secret from the configured vault.
    <T> reactor.core.publisher.Mono<State<T>> getState​(GetStateRequest request, TypeRef<T> type)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, State<T> state, TypeRef<T> type)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, State<T> state, java.lang.Class<T> clazz)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, StateOptions options, TypeRef<T> type)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, StateOptions options, java.lang.Class<T> clazz)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, TypeRef<T> type)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, java.lang.Class<T> clazz)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<T> invokeBinding​(InvokeBindingRequest request, TypeRef<T> type)
    Invokes a Binding operation.
    reactor.core.publisher.Mono<byte[]> invokeBinding​(java.lang.String bindingName, java.lang.String operation, byte[] data, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invokes a Binding operation, skipping serialization.
    reactor.core.publisher.Mono<java.lang.Void> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data)
    Invokes a Binding operation.
    <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, TypeRef<T> type)
    Invokes a Binding operation.
    <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, java.lang.Class<T> clazz)
    Invokes a Binding operation.
    <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, java.util.Map<java.lang.String,​java.lang.String> metadata, TypeRef<T> type)
    Invokes a Binding operation.
    <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
    Invokes a Binding operation.
    <T> reactor.core.publisher.Mono<T> invokeMethod​(InvokeMethodRequest invokeMethodRequest, TypeRef<T> type)
    Invoke a service method.
    reactor.core.publisher.Mono<byte[]> invokeMethod​(java.lang.String appId, java.lang.String methodName, byte[] request, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invoke a service method, without using serialization.
    reactor.core.publisher.Mono<java.lang.Void> invokeMethod​(java.lang.String appId, java.lang.String methodName, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invoke a service method, using serialization.
    <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, TypeRef<T> type)
    Invoke a service method, using serialization.
    <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
    Invoke a service method, using serialization.
    reactor.core.publisher.Mono<java.lang.Void> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension)
    Invoke a service method, using serialization.
    <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, TypeRef<T> type)
    Invoke a service method, using serialization.
    <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, java.lang.Class<T> clazz)
    Invoke a service method, using serialization.
    reactor.core.publisher.Mono<java.lang.Void> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invoke a service method, using serialization.
    <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object data, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, TypeRef<T> type)
    Invoke a service method, using serialization.
    <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
    Invoke a service method, using serialization.
    reactor.core.publisher.Mono<java.lang.Void> publishEvent​(PublishEventRequest request)
    Publish an event.
    reactor.core.publisher.Mono<java.lang.Void> publishEvent​(java.lang.String pubsubName, java.lang.String topicName, java.lang.Object data)
    Publish an event.
    reactor.core.publisher.Mono<java.lang.Void> publishEvent​(java.lang.String pubsubName, java.lang.String topicName, java.lang.Object data, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Publish an event.
    reactor.core.publisher.Mono<java.lang.Void> saveBulkState​(SaveStateRequest request)
    Save/Update a list of states.
    reactor.core.publisher.Mono<java.lang.Void> saveBulkState​(java.lang.String storeName, java.util.List<State<?>> states)
    Save/Update a list of states.
    reactor.core.publisher.Mono<java.lang.Void> saveState​(java.lang.String storeName, java.lang.String key, java.lang.Object value)
    Save/Update a state.
    reactor.core.publisher.Mono<java.lang.Void> saveState​(java.lang.String storeName, java.lang.String key, java.lang.String etag, java.lang.Object value, StateOptions options)
    Save/Update a state.
    reactor.core.publisher.Mono<java.lang.Void> shutdown()
    Gracefully shutdown the dapr runtime.
    reactor.core.publisher.Mono<java.lang.Void> waitForSidecar​(int timeoutInMilliseconds)
    Waits for the sidecar, giving up after timeout.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • objectSerializer

      protected DaprObjectSerializer objectSerializer
      A utility class for serialize and deserialize the transient objects.
    • stateSerializer

      protected DaprObjectSerializer stateSerializer
      A utility class for serialize and deserialize state objects.
  • Method Details

    • waitForSidecar

      public reactor.core.publisher.Mono<java.lang.Void> waitForSidecar​(int timeoutInMilliseconds)
      Waits for the sidecar, giving up after timeout.
      Parameters:
      timeoutInMilliseconds - Timeout in milliseconds to wait for sidecar.
      Returns:
      a Mono plan of type Void.
    • publishEvent

      public reactor.core.publisher.Mono<java.lang.Void> publishEvent​(PublishEventRequest request)
      Publish an event.
      Parameters:
      request - the request for the publish event.
      Returns:
      a Mono plan of a Dapr's void response.
    • invokeMethod

      public <T> reactor.core.publisher.Mono<T> invokeMethod​(InvokeMethodRequest invokeMethodRequest, TypeRef<T> type)
      Invoke a service method.
      Type Parameters:
      T - The Type of the return, use byte[] to skip serialization.
      Parameters:
      invokeMethodRequest - Request object.
      type - The Type needed as return for the call.
      Returns:
      A Mono Plan of type T.
    • invokeBinding

      public <T> reactor.core.publisher.Mono<T> invokeBinding​(InvokeBindingRequest request, TypeRef<T> type)
      Invokes a Binding operation.
      Type Parameters:
      T - The type of the return
      Parameters:
      request - The binding invocation request.
      type - The type being returned.
      Returns:
      a Mono plan of type T.
    • getBulkState

      public <T> reactor.core.publisher.Mono<java.util.List<State<T>>> getBulkState​(GetBulkStateRequest request, TypeRef<T> type)
      Retrieve bulk States based on their keys.
      Type Parameters:
      T - The Type of the return.
      Parameters:
      request - The request to get state.
      type - The Type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(GetStateRequest request, TypeRef<T> type)
      Retrieve a State based on their key.
      Type Parameters:
      T - The Type of the return.
      Parameters:
      request - The request to get state.
      type - The Type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • executeStateTransaction

      public reactor.core.publisher.Mono<java.lang.Void> executeStateTransaction​(ExecuteStateTransactionRequest request)
      Execute a transaction.
      Parameters:
      request - Request to execute transaction.
      Returns:
      a Mono plan of type Response Void
    • saveBulkState

      public reactor.core.publisher.Mono<java.lang.Void> saveBulkState​(SaveStateRequest request)
      Save/Update a list of states.
      Parameters:
      request - Request to save states.
      Returns:
      a Mono plan of type Void.
    • deleteState

      public reactor.core.publisher.Mono<java.lang.Void> deleteState​(DeleteStateRequest request)
      Delete a state.
      Parameters:
      request - Request to delete a state.
      Returns:
      a Mono plan of type Void.
    • getSecret

      public reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.lang.String>> getSecret​(GetSecretRequest request)
      Fetches a secret from the configured vault.
      Parameters:
      request - Request to fetch secret.
      Returns:
      Key-value pairs for the secret.
    • getBulkSecret

      public reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>>> getBulkSecret​(GetBulkSecretRequest request)
      Fetches all secrets from the configured vault.
      Parameters:
      request - Request to fetch secret.
      Returns:
      Key-value pairs for the secret.
    • close

      public void close()
    • shutdown

      public reactor.core.publisher.Mono<java.lang.Void> shutdown()
      Gracefully shutdown the dapr runtime.
      Returns:
      a Mono plan of type Void.
    • publishEvent

      public reactor.core.publisher.Mono<java.lang.Void> publishEvent​(java.lang.String pubsubName, java.lang.String topicName, java.lang.Object data)
      Publish an event.
      Specified by:
      publishEvent in interface DaprClient
      Parameters:
      pubsubName - the pubsub name we will publish the event to
      topicName - the topicName where the event will be published.
      data - the event's data to be published, use byte[] for skipping serialization.
      Returns:
      a Mono plan of type Void.
    • publishEvent

      public reactor.core.publisher.Mono<java.lang.Void> publishEvent​(java.lang.String pubsubName, java.lang.String topicName, java.lang.Object data, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Publish an event.
      Specified by:
      publishEvent in interface DaprClient
      Parameters:
      pubsubName - the pubsub name we will publish the event to
      topicName - the topicName where the event will be published.
      data - the event's data to be published, use byte[] for skipping serialization.
      metadata - The metadata for the published event.
      Returns:
      a Mono plan of type Void.
    • invokeMethod

      public <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object data, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, TypeRef<T> type)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Type Parameters:
      T - The Type of the return, use byte[] to skip serialization.
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      data - The data to be sent to invoke the service, use byte[] to skip serialization.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be sent in data.
      type - The Type needed as return for the call.
      Returns:
      A Mono Plan of type T.
    • invokeMethod

      public <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Type Parameters:
      T - The Type of the return, use byte[] to skip serialization.
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be sent in request.
      clazz - The type needed as return for the call.
      Returns:
      A Mono Plan of type T.
    • invokeMethod

      public <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, TypeRef<T> type)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Type Parameters:
      T - The Type of the return, use byte[] to skip serialization.
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be sent in request.
      type - The Type needed as return for the call.
      Returns:
      A Mono Plan of type T.
    • invokeMethod

      public <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Type Parameters:
      T - The Type of the return, use byte[] to skip serialization.
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be sent in request.
      clazz - The type needed as return for the call.
      Returns:
      A Mono Plan of type T.
    • invokeMethod

      public <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, TypeRef<T> type)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Type Parameters:
      T - The Type of the return, use byte[] to skip serialization.
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      type - The Type needed as return for the call.
      Returns:
      A Mono Plan of type T.
    • invokeMethod

      public <T> reactor.core.publisher.Mono<T> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, java.lang.Class<T> clazz)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Type Parameters:
      T - The Type of the return, use byte[] to skip serialization.
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      clazz - The type needed as return for the call.
      Returns:
      A Mono Plan of type T.
    • invokeMethod

      public reactor.core.publisher.Mono<java.lang.Void> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      Returns:
      A Mono Plan of type Void.
    • invokeMethod

      public reactor.core.publisher.Mono<java.lang.Void> invokeMethod​(java.lang.String appId, java.lang.String methodName, java.lang.Object request, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be sent in request.
      Returns:
      A Mono Plan of type Void.
    • invokeMethod

      public reactor.core.publisher.Mono<java.lang.Void> invokeMethod​(java.lang.String appId, java.lang.String methodName, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invoke a service method, using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be sent in request.
      Returns:
      A Mono Plan of type Void.
    • invokeMethod

      public reactor.core.publisher.Mono<byte[]> invokeMethod​(java.lang.String appId, java.lang.String methodName, byte[] request, HttpExtension httpExtension, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invoke a service method, without using serialization.
      Specified by:
      invokeMethod in interface DaprClient
      Parameters:
      appId - The Application ID where the service is.
      methodName - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      httpExtension - Additional fields that are needed if the receiving app is listening on HTTP, HttpExtension.NONE otherwise.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be sent in request.
      Returns:
      A Mono Plan of type byte[].
    • invokeBinding

      public reactor.core.publisher.Mono<java.lang.Void> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data)
      Invokes a Binding operation.
      Specified by:
      invokeBinding in interface DaprClient
      Parameters:
      bindingName - The bindingName of the biding to call.
      operation - The operation to be performed by the binding request processor.
      data - The data to be processed, use byte[] to skip serialization.
      Returns:
      an empty Mono.
    • invokeBinding

      public reactor.core.publisher.Mono<byte[]> invokeBinding​(java.lang.String bindingName, java.lang.String operation, byte[] data, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invokes a Binding operation, skipping serialization.
      Specified by:
      invokeBinding in interface DaprClient
      Parameters:
      bindingName - The name of the biding to call.
      operation - The operation to be performed by the binding request processor.
      data - The data to be processed, skipping serialization.
      metadata - The metadata map.
      Returns:
      a Mono plan of type byte[].
    • invokeBinding

      public <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, TypeRef<T> type)
      Invokes a Binding operation.
      Specified by:
      invokeBinding in interface DaprClient
      Type Parameters:
      T - The type of the return
      Parameters:
      bindingName - The name of the biding to call.
      operation - The operation to be performed by the binding request processor.
      data - The data to be processed, use byte[] to skip serialization.
      type - The type being returned.
      Returns:
      a Mono plan of type T.
    • invokeBinding

      public <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, java.lang.Class<T> clazz)
      Invokes a Binding operation.
      Specified by:
      invokeBinding in interface DaprClient
      Type Parameters:
      T - The type of the return
      Parameters:
      bindingName - The name of the biding to call.
      operation - The operation to be performed by the binding request processor.
      data - The data to be processed, use byte[] to skip serialization.
      clazz - The type being returned.
      Returns:
      a Mono plan of type T.
    • invokeBinding

      public <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, java.util.Map<java.lang.String,​java.lang.String> metadata, TypeRef<T> type)
      Invokes a Binding operation.
      Specified by:
      invokeBinding in interface DaprClient
      Type Parameters:
      T - The type of the return
      Parameters:
      bindingName - The name of the biding to call.
      operation - The operation to be performed by the binding request processor.
      data - The data to be processed, use byte[] to skip serialization.
      metadata - The metadata map.
      type - The type being returned.
      Returns:
      a Mono plan of type T.
    • invokeBinding

      public <T> reactor.core.publisher.Mono<T> invokeBinding​(java.lang.String bindingName, java.lang.String operation, java.lang.Object data, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
      Invokes a Binding operation.
      Specified by:
      invokeBinding in interface DaprClient
      Type Parameters:
      T - The type of the return
      Parameters:
      bindingName - The name of the biding to call.
      operation - The operation to be performed by the binding request processor.
      data - The data to be processed, use byte[] to skip serialization.
      metadata - The metadata map.
      clazz - The type being returned.
      Returns:
      a Mono plan of type T.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, State<T> state, TypeRef<T> type)
      Retrieve a State based on their key.
      Specified by:
      getState in interface DaprClient
      Type Parameters:
      T - The type of the return.
      Parameters:
      storeName - The name of the state store.
      state - State to be re-retrieved.
      type - The type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, State<T> state, java.lang.Class<T> clazz)
      Retrieve a State based on their key.
      Specified by:
      getState in interface DaprClient
      Type Parameters:
      T - The type of the return.
      Parameters:
      storeName - The name of the state store.
      state - State to be re-retrieved.
      clazz - The type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, TypeRef<T> type)
      Retrieve a State based on their key.
      Specified by:
      getState in interface DaprClient
      Type Parameters:
      T - The type of the return.
      Parameters:
      storeName - The name of the state store.
      key - The key of the State to be retrieved.
      type - The type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, java.lang.Class<T> clazz)
      Retrieve a State based on their key.
      Specified by:
      getState in interface DaprClient
      Type Parameters:
      T - The type of the return.
      Parameters:
      storeName - The name of the state store.
      key - The key of the State to be retrieved.
      clazz - The type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, StateOptions options, TypeRef<T> type)
      Retrieve a State based on their key.
      Specified by:
      getState in interface DaprClient
      Type Parameters:
      T - The Type of the return.
      Parameters:
      storeName - The name of the state store.
      key - The key of the State to be retrieved.
      options - Optional settings for retrieve operation.
      type - The Type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String storeName, java.lang.String key, StateOptions options, java.lang.Class<T> clazz)
      Retrieve a State based on their key.
      Specified by:
      getState in interface DaprClient
      Type Parameters:
      T - The Type of the return.
      Parameters:
      storeName - The name of the state store.
      key - The key of the State to be retrieved.
      options - Optional settings for retrieve operation.
      clazz - The Type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getBulkState

      public <T> reactor.core.publisher.Mono<java.util.List<State<T>>> getBulkState​(java.lang.String storeName, java.util.List<java.lang.String> keys, TypeRef<T> type)
      Retrieve bulk States based on their keys.
      Specified by:
      getBulkState in interface DaprClient
      Type Parameters:
      T - The type of the return.
      Parameters:
      storeName - The name of the state store.
      keys - The keys of the State to be retrieved.
      type - The type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • getBulkState

      public <T> reactor.core.publisher.Mono<java.util.List<State<T>>> getBulkState​(java.lang.String storeName, java.util.List<java.lang.String> keys, java.lang.Class<T> clazz)
      Retrieve bulk States based on their keys.
      Specified by:
      getBulkState in interface DaprClient
      Type Parameters:
      T - The type of the return.
      Parameters:
      storeName - The name of the state store.
      keys - The keys of the State to be retrieved.
      clazz - The type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • executeStateTransaction

      public reactor.core.publisher.Mono<java.lang.Void> executeStateTransaction​(java.lang.String storeName, java.util.List<TransactionalStateOperation<?>> operations)
      Execute a transaction.
      Specified by:
      executeStateTransaction in interface DaprClient
      Parameters:
      storeName - The name of the state store.
      operations - The operations to be performed.
      Returns:
      a Mono plan of type Void
    • saveBulkState

      public reactor.core.publisher.Mono<java.lang.Void> saveBulkState​(java.lang.String storeName, java.util.List<State<?>> states)
      Save/Update a list of states.
      Specified by:
      saveBulkState in interface DaprClient
      Parameters:
      storeName - The name of the state store.
      states - The States to be saved.
      Returns:
      a Mono plan of type Void.
    • saveState

      public reactor.core.publisher.Mono<java.lang.Void> saveState​(java.lang.String storeName, java.lang.String key, java.lang.Object value)
      Save/Update a state.
      Specified by:
      saveState in interface DaprClient
      Parameters:
      storeName - The name of the state store.
      key - The key of the state.
      value - The value of the state.
      Returns:
      a Mono plan of type Void.
    • saveState

      public reactor.core.publisher.Mono<java.lang.Void> saveState​(java.lang.String storeName, java.lang.String key, java.lang.String etag, java.lang.Object value, StateOptions options)
      Save/Update a state.
      Specified by:
      saveState in interface DaprClient
      Parameters:
      storeName - The name of the state store.
      key - The key of the state.
      etag - The etag to be used.
      value - The value of the state.
      options - The Options to use for each state.
      Returns:
      a Mono plan of type Void.
    • deleteState

      public reactor.core.publisher.Mono<java.lang.Void> deleteState​(java.lang.String storeName, java.lang.String key)
      Delete a state.
      Specified by:
      deleteState in interface DaprClient
      Parameters:
      storeName - The name of the state store.
      key - The key of the State to be removed.
      Returns:
      a Mono plan of type Void.
    • deleteState

      public reactor.core.publisher.Mono<java.lang.Void> deleteState​(java.lang.String storeName, java.lang.String key, java.lang.String etag, StateOptions options)
      Delete a state.
      Specified by:
      deleteState in interface DaprClient
      Parameters:
      storeName - The name of the state store.
      key - The key of the State to be removed.
      etag - Optional etag for conditional delete.
      options - Optional settings for state operation.
      Returns:
      a Mono plan of type Void.
    • getSecret

      public reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.lang.String>> getSecret​(java.lang.String storeName, java.lang.String key, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Fetches a secret from the configured vault.
      Specified by:
      getSecret in interface DaprClient
      Parameters:
      storeName - Name of vault component in Dapr.
      key - Secret to be fetched.
      metadata - Optional metadata.
      Returns:
      Key-value pairs for the secret.
    • getSecret

      public reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.lang.String>> getSecret​(java.lang.String storeName, java.lang.String secretName)
      Fetches a secret from the configured vault.
      Specified by:
      getSecret in interface DaprClient
      Parameters:
      storeName - Name of vault component in Dapr.
      secretName - Secret to be fetched.
      Returns:
      Key-value pairs for the secret.
    • getBulkSecret

      public reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>>> getBulkSecret​(java.lang.String storeName)
      Fetches all secrets from the configured vault.
      Specified by:
      getBulkSecret in interface DaprClient
      Parameters:
      storeName - Name of vault component in Dapr.
      Returns:
      Key-value pairs for all the secrets in the state store.
    • getBulkSecret

      public reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.String>>> getBulkSecret​(java.lang.String storeName, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Fetches all secrets from the configured vault.
      Specified by:
      getBulkSecret in interface DaprClient
      Parameters:
      storeName - Name of vault component in Dapr.
      metadata - Optional metadata.
      Returns:
      Key-value pairs for all the secrets in the state store.