Package io.dapr.internal.grpc

# Class DaprClientGrpcInterceptors

java.lang.Object
io.dapr.internal.grpc.DaprClientGrpcInterceptors

public class DaprClientGrpcInterceptors extends Object
Class to be used as part of your service's client stub interceptor. Usage: myClientStub = DaprClientGrpcInterceptors.intercept(myClientStub);

## Constructor Summary

Constructors
Constructor
Description
`DaprClientGrpcInterceptors()`
Instantiates a holder of all gRPC interceptors.
`DaprClientGrpcInterceptors(String daprApiToken, TimeoutPolicy timeoutPolicy)`
Instantiates a holder of all gRPC interceptors.

## Method Summary

Modifier and Type
Method
Description
`<T extends io.grpc.stub.AbstractStub<T>>
T`
`intercept(String appId, T client)`
Adds all Dapr interceptors to a gRPC async stub.
`<T extends io.grpc.stub.AbstractStub<T>>
T`
`intercept(String appId, T client, reactor.util.context.ContextView context, Consumer<io.grpc.Metadata> metadataConsumer)`
Adds all Dapr interceptors to a gRPC async stub.
`<T extends io.grpc.stub.AbstractStub<T>>
T`
`intercept(T client)`
Adds all Dapr interceptors to a gRPC async stub.
`<T extends io.grpc.stub.AbstractStub<T>>
T`
`intercept(T client, reactor.util.context.ContextView context)`
Adds all Dapr interceptors to a gRPC async stub.
`<T extends io.grpc.stub.AbstractStub<T>>
T`
`intercept(T client, reactor.util.context.ContextView context, Consumer<io.grpc.Metadata> metadataConsumer)`
Adds all Dapr interceptors to a gRPC async stub.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DaprClientGrpcInterceptors

public DaprClientGrpcInterceptors()
Instantiates a holder of all gRPC interceptors.

### DaprClientGrpcInterceptors

public DaprClientGrpcInterceptors(String daprApiToken, TimeoutPolicy timeoutPolicy)
Instantiates a holder of all gRPC interceptors.

Parameters:
  `daprApiToken` - Dapr API token.
  `timeoutPolicy` - Timeout Policy.

## Method Details

### intercept

public <T extends io.grpc.stub.AbstractStub<T>> T intercept(T client)
Adds all Dapr interceptors to a gRPC async stub.

Type Parameters:
  `T` - async client type
Parameters:
  `client` - gRPC client
Returns:
  async client instance with interceptors

### intercept

public <T extends io.grpc.stub.AbstractStub<T>> T intercept(String appId, T client)
Adds all Dapr interceptors to a gRPC async stub.

Type Parameters:
  `T` - async client type
Parameters:
  `appId` - Application ID to invoke.
  `client` - gRPC client
Returns:
  async client instance with interceptors

### intercept

public <T extends io.grpc.stub.AbstractStub<T>> T intercept(T client, reactor.util.context.ContextView context)
Adds all Dapr interceptors to a gRPC async stub.

Type Parameters:
  `T` - async client type
Parameters:
  `client` - gRPC client
  `context` - Reactor context for tracing
Returns:
  async client instance with interceptors

### intercept

public <T extends io.grpc.stub.AbstractStub<T>> T intercept(T client, reactor.util.context.ContextView context, Consumer<io.grpc.Metadata> metadataConsumer)
Adds all Dapr interceptors to a gRPC async stub.

Type Parameters:
  `T` - async client type
Parameters:
  `client` - gRPC client
  `context` - Reactor context for tracing
  `metadataConsumer` - Consumer of the gRPC metadata
Returns:
  async client instance with interceptors

### intercept

public <T extends io.grpc.stub.AbstractStub<T>> T intercept(String appId, T client, reactor.util.context.ContextView context, Consumer<io.grpc.Metadata> metadataConsumer)
Adds all Dapr interceptors to a gRPC async stub.

Type Parameters:
  `T` - async client type
Parameters:
  `appId` - Application ID to invoke.
  `client` - gRPC client
  `context` - Reactor context for tracing
  `metadataConsumer` - Consumer of the gRPC metadata
Returns:
  async client instance with interceptors