Class DaprClientGrpc

java.lang.Object
io.dapr.client.DaprClientGrpc
All Implemented Interfaces:
DaprClient

public class DaprClientGrpc
extends java.lang.Object
implements DaprClient
An adapter for the GRPC Client.
See Also:
DaprGrpc, DaprClient
  • Method Summary

    Modifier and Type Method Description
    reactor.core.publisher.Mono<java.lang.Void> deleteState​(java.lang.String stateStoreName, java.lang.String key)
    Delete a state.
    reactor.core.publisher.Mono<java.lang.Void> deleteState​(java.lang.String stateStoreName, java.lang.String key, java.lang.String etag, StateOptions options)
    Delete a state.
    reactor.core.publisher.Mono<java.util.Map<java.lang.String,​java.lang.String>> getSecret​(java.lang.String secretStoreName, 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 secretStoreName, java.lang.String secretName, 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​(java.lang.String stateStoreName, 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 stateStoreName, java.lang.String key, java.lang.Class<T> clazz)
    Retrieve a State based on their key.
    <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String stateStoreName, java.lang.String key, java.lang.String etag, StateOptions options, java.lang.Class<T> clazz)
    Retrieve a State based on their key.
    reactor.core.publisher.Mono<java.lang.Void> invokeBinding​(java.lang.String name, java.lang.Object request)
    Invokes a Binding.
    reactor.core.publisher.Mono<java.lang.Void> invokeBinding​(java.lang.String name, java.lang.Object request, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invokes a Binding with metadata.
    reactor.core.publisher.Mono<byte[]> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, byte[] request, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invoke a service without serialization.
    reactor.core.publisher.Mono<java.lang.Void> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request)
    Invoke a service with void response, no metadata and using serialization.
    <T> reactor.core.publisher.Mono<T> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request, java.lang.Class<T> clazz)
    Invoke a service without metadata, using serialization.
    reactor.core.publisher.Mono<java.lang.Void> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invoke a service with void response, using serialization.
    <T> reactor.core.publisher.Mono<T> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
    Invoke a service with all possible parameters, using serialization.
    reactor.core.publisher.Mono<java.lang.Void> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Invoke a service without input and void response.
    <T> reactor.core.publisher.Mono<T> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
    Invoke a service without input, using serialization for response.
    reactor.core.publisher.Mono<java.lang.Void> publishEvent​(java.lang.String topic, java.lang.Object event)
    Publish an event.
    reactor.core.publisher.Mono<java.lang.Void> publishEvent​(java.lang.String topic, java.lang.Object event, java.util.Map<java.lang.String,​java.lang.String> metadata)
    Publish an event.
    reactor.core.publisher.Mono<java.lang.Void> saveState​(java.lang.String stateStoreName, java.lang.String key, java.lang.Object value)
    Save/Update a state.
    reactor.core.publisher.Mono<java.lang.Void> saveState​(java.lang.String stateStoreName, 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> saveStates​(java.lang.String stateStoreName, java.util.List<State<?>> states)
    Save/Update a list of states.

    Methods inherited from class java.lang.Object

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

    • publishEvent

      public reactor.core.publisher.Mono<java.lang.Void> publishEvent​(java.lang.String topic, java.lang.Object event)
      Publish an event.
      Specified by:
      publishEvent in interface DaprClient
      Parameters:
      topic - the topic where the event will be published.
      event - the event 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 topic, java.lang.Object event, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Publish an event.
      Specified by:
      publishEvent in interface DaprClient
      Parameters:
      topic - the topic where the event will be published.
      event - the event to be published, use byte[] for skipping serialization.
      metadata - The metadata for the published event.
      Returns:
      a Mono plan of type Void.
    • invokeService

      public <T> reactor.core.publisher.Mono<T> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
      Invoke a service with all possible parameters, using serialization.
      Specified by:
      invokeService in interface DaprClient
      Type Parameters:
      T - the Type of the return, use byte[] to skip serialization.
      Parameters:
      verb - The Verb to be used for HTTP will be the HTTP Verb, for GRPC is just a metadata value.
      appId - The Application ID where the service is.
      method - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be send in request.
      clazz - the Type needed as return for the call.
      Returns:
      A Mono Plan of type clazz.
    • invokeService

      public <T> reactor.core.publisher.Mono<T> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.util.Map<java.lang.String,​java.lang.String> metadata, java.lang.Class<T> clazz)
      Invoke a service without input, using serialization for response.
      Specified by:
      invokeService in interface DaprClient
      Type Parameters:
      T - the Type of the return, use byte[] to skip serialization.
      Parameters:
      verb - The Verb to be used for HTTP will be the HTTP Verb, for GRPC is just a metadata value.
      appId - The Application ID where the service is.
      method - The actual Method to be call in the application.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be send in request.
      clazz - the Type needed as return for the call.
      Returns:
      A Mono plan of type clazz.
    • invokeService

      public <T> reactor.core.publisher.Mono<T> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request, java.lang.Class<T> clazz)
      Invoke a service without metadata, using serialization.
      Specified by:
      invokeService in interface DaprClient
      Type Parameters:
      T - the Type of the return, use byte[] to skip serialization.
      Parameters:
      verb - The Verb to be used for HTTP will be the HTTP Verb, for GRPC is just a metadata value.
      appId - The Application ID where the service is.
      method - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      clazz - the Type needed as return for the call.
      Returns:
      A Mono Plan of type clazz.
    • invokeService

      public reactor.core.publisher.Mono<java.lang.Void> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request)
      Invoke a service with void response, no metadata and using serialization.
      Specified by:
      invokeService in interface DaprClient
      Parameters:
      verb - The Verb to be used for HTTP will be the HTTP Verb, for GRPC is just a metadata value.
      appId - The Application ID where the service is.
      method - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      Returns:
      A Mono plan for Void.
    • invokeService

      public reactor.core.publisher.Mono<java.lang.Void> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.lang.Object request, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invoke a service with void response, using serialization.
      Specified by:
      invokeService in interface DaprClient
      Parameters:
      verb - The Verb to be used for HTTP will be the HTTP Verb, for GRPC is just a metadata value.
      appId - The Application ID where the service is.
      method - The actual Method to be call in the application.
      request - The request to be sent to invoke the service, use byte[] to skip serialization.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be send in request.
      Returns:
      A Mono plan for Void.
    • invokeService

      public reactor.core.publisher.Mono<java.lang.Void> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invoke a service without input and void response.
      Specified by:
      invokeService in interface DaprClient
      Parameters:
      verb - The Verb to be used for HTTP will be the HTTP Verb, for GRPC is just a metadata value.
      appId - The Application ID where the service is.
      method - The actual Method to be call in the application.
      metadata - Metadata (in GRPC) or headers (in HTTP) to be send in request.
      Returns:
      A Mono plan for Void.
    • invokeService

      public reactor.core.publisher.Mono<byte[]> invokeService​(Verb verb, java.lang.String appId, java.lang.String method, byte[] request, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invoke a service without serialization.
      Specified by:
      invokeService in interface DaprClient
      Parameters:
      verb - The Verb to be used for HTTP will be the HTTP Verb, for GRPC is just a metadata value.
      appId - The Application ID where the service is.
      method - The actual Method to be call in the application.
      request - The request to be sent to invoke the service
      metadata - Metadata (in GRPC) or headers (in HTTP) to be send in request.
      Returns:
      A Mono plan of byte[].
    • invokeBinding

      public reactor.core.publisher.Mono<java.lang.Void> invokeBinding​(java.lang.String name, java.lang.Object request)
      Invokes a Binding.
      Specified by:
      invokeBinding in interface DaprClient
      Parameters:
      name - The name of the biding to call.
      request - The request needed for the binding, use byte[] to skip serialization.
      Returns:
      a Mono plan of type Void.
    • invokeBinding

      public reactor.core.publisher.Mono<java.lang.Void> invokeBinding​(java.lang.String name, java.lang.Object request, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Invokes a Binding with metadata.
      Specified by:
      invokeBinding in interface DaprClient
      Parameters:
      name - The name of the biding to call.
      request - The request needed for the binding, use byte[] to skip serialization.
      metadata - The metadata map.
      Returns:
      a Mono plan of type Void.
    • getState

      public <T> reactor.core.publisher.Mono<State<T>> getState​(java.lang.String stateStoreName, 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:
      stateStoreName - 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 stateStoreName, 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:
      stateStoreName - 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 stateStoreName, java.lang.String key, java.lang.String etag, 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:
      stateStoreName - The name of the state store.
      key - The key of the State to be retrieved.
      etag - Optional etag for conditional get
      options - Optional settings for retrieve operation.
      clazz - The Type of State needed as return.
      Returns:
      A Mono Plan for the requested State.
    • saveStates

      public reactor.core.publisher.Mono<java.lang.Void> saveStates​(java.lang.String stateStoreName, java.util.List<State<?>> states)
      Save/Update a list of states.
      Specified by:
      saveStates in interface DaprClient
      Parameters:
      stateStoreName - 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 stateStoreName, java.lang.String key, java.lang.Object value)
      Save/Update a state.
      Specified by:
      saveState in interface DaprClient
      Parameters:
      stateStoreName - 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 stateStoreName, 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:
      stateStoreName - 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 stateStoreName, java.lang.String key)
      Delete a state.
      Specified by:
      deleteState in interface DaprClient
      Parameters:
      stateStoreName - 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 stateStoreName, java.lang.String key, java.lang.String etag, StateOptions options)
      Delete a state.
      Specified by:
      deleteState in interface DaprClient
      Parameters:
      stateStoreName - 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 secretStoreName, java.lang.String secretName, java.util.Map<java.lang.String,​java.lang.String> metadata)
      Fetches a secret from the configured vault.
      Specified by:
      getSecret in interface DaprClient
      Parameters:
      secretStoreName - Name of vault component in Dapr.
      secretName - 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 secretStoreName, java.lang.String secretName)
      Fetches a secret from the configured vault.
      Specified by:
      getSecret in interface DaprClient
      Parameters:
      secretStoreName - Name of vault component in Dapr.
      secretName - Secret to be fetched.
      Returns:
      Key-value pairs for the secret.