mirror of https://github.com/dapr/java-sdk.git
commit
b42372ed81
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: statestore
|
||||
spec:
|
||||
type: state.redis
|
||||
metadata:
|
||||
- name: redisHost
|
||||
value: localhost:6379
|
||||
- name: redisPassword
|
||||
value: ""
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: dapr.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: messagebus
|
||||
spec:
|
||||
type: pubsub.redis
|
||||
metadata:
|
||||
- name: redisHost
|
||||
value: localhost:6379
|
||||
- name: redisPassword
|
||||
value: ""
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.dapr</groupId>
|
||||
<artifactId>examples</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>0.0.1</version>
|
||||
<name>dapr-client</name>
|
||||
<url>https://github.com/dapr/dapr-client</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<grpc.version>1.24.0</grpc.version>
|
||||
<protobuf.version>3.10.0</protobuf.version>
|
||||
<protoc.version>3.10.0</protoc.version>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-bom</artifactId>
|
||||
<version>${grpc.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.dapr</groupId>
|
||||
<artifactId>client</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-protobuf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-stub</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java-util</artifactId>
|
||||
<version>${protobuf.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<extensions>
|
||||
</extensions>
|
||||
<plugins>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
package io.dapr.examples;
|
||||
|
||||
import com.google.protobuf.Any;
|
||||
import com.google.protobuf.ByteString;
|
||||
|
||||
import io.dapr.DaprGrpc;
|
||||
import io.dapr.DaprGrpc.DaprBlockingStub;
|
||||
import io.dapr.DaprProtos.DeleteStateEnvelope;
|
||||
import io.dapr.DaprProtos.GetStateEnvelope;
|
||||
import io.dapr.DaprProtos.GetStateResponseEnvelope;
|
||||
import io.dapr.DaprProtos.PublishEventEnvelope;
|
||||
import io.dapr.DaprProtos.SaveStateEnvelope;
|
||||
import io.dapr.DaprProtos.StateRequest;
|
||||
import io.grpc.ManagedChannel;
|
||||
import io.grpc.ManagedChannelBuilder;
|
||||
|
||||
/**
|
||||
* Simple example, to run:
|
||||
* mvn compile
|
||||
* dapr run --grpc-port 50001 -- mvn exec:java -Dexec.mainClass=io.dapr.examples.Example
|
||||
*/
|
||||
public class Example {
|
||||
public static void main(String[] args) {
|
||||
ManagedChannel channel =
|
||||
ManagedChannelBuilder.forAddress("localhost", 50001).usePlaintext().build();
|
||||
DaprBlockingStub client = DaprGrpc.newBlockingStub(channel);
|
||||
|
||||
Any data = Any.newBuilder().setValue(ByteString.copyFromUtf8("foo")).build();
|
||||
client.publishEvent(PublishEventEnvelope.newBuilder().setTopic("foo").setData(data).build());
|
||||
System.out.println("Published!");
|
||||
|
||||
String key = "mykey";
|
||||
StateRequest req = StateRequest.newBuilder()
|
||||
.setKey(key)
|
||||
.setValue(Any.newBuilder().setValue(ByteString.copyFromUtf8("my value")).build())
|
||||
.build();
|
||||
SaveStateEnvelope state = SaveStateEnvelope.newBuilder()
|
||||
.addRequests(req)
|
||||
.build();
|
||||
client.saveState(state);
|
||||
System.out.println("Saved!");
|
||||
|
||||
GetStateResponseEnvelope get = client.getState(GetStateEnvelope.newBuilder().setKey(key).build());
|
||||
System.out.println("Got: " + get.getData().getValue().toStringUtf8());
|
||||
|
||||
client.deleteState(DeleteStateEnvelope.newBuilder().setKey(key).build());
|
||||
System.out.println("Deleted!");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,82 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.dapr</groupId>
|
||||
<artifactId>client</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<version>0.0.1</version>
|
||||
<name>dapr-client</name>
|
||||
<url>https://github.com/dapr/dapr-client</url>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<grpc.version>1.24.0</grpc.version>
|
||||
<protobuf.version>3.10.0</protobuf.version>
|
||||
<protoc.version>3.10.0</protoc.version>
|
||||
<maven.compiler.source>1.7</maven.compiler.source>
|
||||
<maven.compiler.target>1.7</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-bom</artifactId>
|
||||
<version>${grpc.version}</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-netty-shaded</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-protobuf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-stub</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.annotation</groupId>
|
||||
<artifactId>javax.annotation-api</artifactId>
|
||||
<version>1.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.grpc</groupId>
|
||||
<artifactId>grpc-testing</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.protobuf</groupId>
|
||||
<artifactId>protobuf-java-util</artifactId>
|
||||
<version>${protobuf.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.12</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>2.25.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<extensions>
|
||||
</extensions>
|
||||
<plugins>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,590 @@
|
|||
package io.dapr;
|
||||
|
||||
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.futureUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* User Code definitions
|
||||
* </pre>
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = "by gRPC proto compiler (version 1.24.0)",
|
||||
comments = "Source: daprclient/daprclient.proto")
|
||||
public final class DaprClientGrpc {
|
||||
|
||||
private DaprClientGrpc() {}
|
||||
|
||||
public static final String SERVICE_NAME = "daprclient.DaprClient";
|
||||
|
||||
// Static method descriptors that strictly reflect the proto.
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.InvokeEnvelope,
|
||||
com.google.protobuf.Any> getOnInvokeMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "OnInvoke",
|
||||
requestType = io.dapr.DaprClientProtos.InvokeEnvelope.class,
|
||||
responseType = com.google.protobuf.Any.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.InvokeEnvelope,
|
||||
com.google.protobuf.Any> getOnInvokeMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.InvokeEnvelope, com.google.protobuf.Any> getOnInvokeMethod;
|
||||
if ((getOnInvokeMethod = DaprClientGrpc.getOnInvokeMethod) == null) {
|
||||
synchronized (DaprClientGrpc.class) {
|
||||
if ((getOnInvokeMethod = DaprClientGrpc.getOnInvokeMethod) == null) {
|
||||
DaprClientGrpc.getOnInvokeMethod = getOnInvokeMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprClientProtos.InvokeEnvelope, com.google.protobuf.Any>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "OnInvoke"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprClientProtos.InvokeEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Any.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprClientMethodDescriptorSupplier("OnInvoke"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getOnInvokeMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<com.google.protobuf.Empty,
|
||||
io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope> getGetTopicSubscriptionsMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "GetTopicSubscriptions",
|
||||
requestType = com.google.protobuf.Empty.class,
|
||||
responseType = io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<com.google.protobuf.Empty,
|
||||
io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope> getGetTopicSubscriptionsMethod() {
|
||||
io.grpc.MethodDescriptor<com.google.protobuf.Empty, io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope> getGetTopicSubscriptionsMethod;
|
||||
if ((getGetTopicSubscriptionsMethod = DaprClientGrpc.getGetTopicSubscriptionsMethod) == null) {
|
||||
synchronized (DaprClientGrpc.class) {
|
||||
if ((getGetTopicSubscriptionsMethod = DaprClientGrpc.getGetTopicSubscriptionsMethod) == null) {
|
||||
DaprClientGrpc.getGetTopicSubscriptionsMethod = getGetTopicSubscriptionsMethod =
|
||||
io.grpc.MethodDescriptor.<com.google.protobuf.Empty, io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetTopicSubscriptions"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Empty.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprClientMethodDescriptorSupplier("GetTopicSubscriptions"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getGetTopicSubscriptionsMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<com.google.protobuf.Empty,
|
||||
io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope> getGetBindingsSubscriptionsMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "GetBindingsSubscriptions",
|
||||
requestType = com.google.protobuf.Empty.class,
|
||||
responseType = io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<com.google.protobuf.Empty,
|
||||
io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope> getGetBindingsSubscriptionsMethod() {
|
||||
io.grpc.MethodDescriptor<com.google.protobuf.Empty, io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope> getGetBindingsSubscriptionsMethod;
|
||||
if ((getGetBindingsSubscriptionsMethod = DaprClientGrpc.getGetBindingsSubscriptionsMethod) == null) {
|
||||
synchronized (DaprClientGrpc.class) {
|
||||
if ((getGetBindingsSubscriptionsMethod = DaprClientGrpc.getGetBindingsSubscriptionsMethod) == null) {
|
||||
DaprClientGrpc.getGetBindingsSubscriptionsMethod = getGetBindingsSubscriptionsMethod =
|
||||
io.grpc.MethodDescriptor.<com.google.protobuf.Empty, io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBindingsSubscriptions"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Empty.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprClientMethodDescriptorSupplier("GetBindingsSubscriptions"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getGetBindingsSubscriptionsMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.BindingEventEnvelope,
|
||||
io.dapr.DaprClientProtos.BindingResponseEnvelope> getOnBindingEventMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "OnBindingEvent",
|
||||
requestType = io.dapr.DaprClientProtos.BindingEventEnvelope.class,
|
||||
responseType = io.dapr.DaprClientProtos.BindingResponseEnvelope.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.BindingEventEnvelope,
|
||||
io.dapr.DaprClientProtos.BindingResponseEnvelope> getOnBindingEventMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.BindingEventEnvelope, io.dapr.DaprClientProtos.BindingResponseEnvelope> getOnBindingEventMethod;
|
||||
if ((getOnBindingEventMethod = DaprClientGrpc.getOnBindingEventMethod) == null) {
|
||||
synchronized (DaprClientGrpc.class) {
|
||||
if ((getOnBindingEventMethod = DaprClientGrpc.getOnBindingEventMethod) == null) {
|
||||
DaprClientGrpc.getOnBindingEventMethod = getOnBindingEventMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprClientProtos.BindingEventEnvelope, io.dapr.DaprClientProtos.BindingResponseEnvelope>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "OnBindingEvent"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprClientProtos.BindingEventEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprClientProtos.BindingResponseEnvelope.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprClientMethodDescriptorSupplier("OnBindingEvent"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getOnBindingEventMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.CloudEventEnvelope,
|
||||
com.google.protobuf.Empty> getOnTopicEventMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "OnTopicEvent",
|
||||
requestType = io.dapr.DaprClientProtos.CloudEventEnvelope.class,
|
||||
responseType = com.google.protobuf.Empty.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.CloudEventEnvelope,
|
||||
com.google.protobuf.Empty> getOnTopicEventMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprClientProtos.CloudEventEnvelope, com.google.protobuf.Empty> getOnTopicEventMethod;
|
||||
if ((getOnTopicEventMethod = DaprClientGrpc.getOnTopicEventMethod) == null) {
|
||||
synchronized (DaprClientGrpc.class) {
|
||||
if ((getOnTopicEventMethod = DaprClientGrpc.getOnTopicEventMethod) == null) {
|
||||
DaprClientGrpc.getOnTopicEventMethod = getOnTopicEventMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprClientProtos.CloudEventEnvelope, com.google.protobuf.Empty>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "OnTopicEvent"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprClientProtos.CloudEventEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Empty.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprClientMethodDescriptorSupplier("OnTopicEvent"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getOnTopicEventMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new async stub that supports all call types for the service
|
||||
*/
|
||||
public static DaprClientStub newStub(io.grpc.Channel channel) {
|
||||
return new DaprClientStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||
*/
|
||||
public static DaprClientBlockingStub newBlockingStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new DaprClientBlockingStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||
*/
|
||||
public static DaprClientFutureStub newFutureStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new DaprClientFutureStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* User Code definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static abstract class DaprClientImplBase implements io.grpc.BindableService {
|
||||
|
||||
/**
|
||||
*/
|
||||
public void onInvoke(io.dapr.DaprClientProtos.InvokeEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Any> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getOnInvokeMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void getTopicSubscriptions(com.google.protobuf.Empty request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getGetTopicSubscriptionsMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void getBindingsSubscriptions(com.google.protobuf.Empty request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getGetBindingsSubscriptionsMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void onBindingEvent(io.dapr.DaprClientProtos.BindingEventEnvelope request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.BindingResponseEnvelope> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getOnBindingEventMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void onTopicEvent(io.dapr.DaprClientProtos.CloudEventEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getOnTopicEventMethod(), responseObserver);
|
||||
}
|
||||
|
||||
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||
.addMethod(
|
||||
getOnInvokeMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprClientProtos.InvokeEnvelope,
|
||||
com.google.protobuf.Any>(
|
||||
this, METHODID_ON_INVOKE)))
|
||||
.addMethod(
|
||||
getGetTopicSubscriptionsMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
com.google.protobuf.Empty,
|
||||
io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope>(
|
||||
this, METHODID_GET_TOPIC_SUBSCRIPTIONS)))
|
||||
.addMethod(
|
||||
getGetBindingsSubscriptionsMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
com.google.protobuf.Empty,
|
||||
io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope>(
|
||||
this, METHODID_GET_BINDINGS_SUBSCRIPTIONS)))
|
||||
.addMethod(
|
||||
getOnBindingEventMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprClientProtos.BindingEventEnvelope,
|
||||
io.dapr.DaprClientProtos.BindingResponseEnvelope>(
|
||||
this, METHODID_ON_BINDING_EVENT)))
|
||||
.addMethod(
|
||||
getOnTopicEventMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprClientProtos.CloudEventEnvelope,
|
||||
com.google.protobuf.Empty>(
|
||||
this, METHODID_ON_TOPIC_EVENT)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* User Code definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static final class DaprClientStub extends io.grpc.stub.AbstractStub<DaprClientStub> {
|
||||
private DaprClientStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private DaprClientStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected DaprClientStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new DaprClientStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void onInvoke(io.dapr.DaprClientProtos.InvokeEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Any> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getOnInvokeMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void getTopicSubscriptions(com.google.protobuf.Empty request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getGetTopicSubscriptionsMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void getBindingsSubscriptions(com.google.protobuf.Empty request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getGetBindingsSubscriptionsMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void onBindingEvent(io.dapr.DaprClientProtos.BindingEventEnvelope request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.BindingResponseEnvelope> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getOnBindingEventMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void onTopicEvent(io.dapr.DaprClientProtos.CloudEventEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getOnTopicEventMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* User Code definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static final class DaprClientBlockingStub extends io.grpc.stub.AbstractStub<DaprClientBlockingStub> {
|
||||
private DaprClientBlockingStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private DaprClientBlockingStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected DaprClientBlockingStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new DaprClientBlockingStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.protobuf.Any onInvoke(io.dapr.DaprClientProtos.InvokeEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getOnInvokeMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope getTopicSubscriptions(com.google.protobuf.Empty request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getGetTopicSubscriptionsMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope getBindingsSubscriptions(com.google.protobuf.Empty request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getGetBindingsSubscriptionsMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public io.dapr.DaprClientProtos.BindingResponseEnvelope onBindingEvent(io.dapr.DaprClientProtos.BindingEventEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getOnBindingEventMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.protobuf.Empty onTopicEvent(io.dapr.DaprClientProtos.CloudEventEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getOnTopicEventMethod(), getCallOptions(), request);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* User Code definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static final class DaprClientFutureStub extends io.grpc.stub.AbstractStub<DaprClientFutureStub> {
|
||||
private DaprClientFutureStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private DaprClientFutureStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected DaprClientFutureStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new DaprClientFutureStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Any> onInvoke(
|
||||
io.dapr.DaprClientProtos.InvokeEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getOnInvokeMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope> getTopicSubscriptions(
|
||||
com.google.protobuf.Empty request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getGetTopicSubscriptionsMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope> getBindingsSubscriptions(
|
||||
com.google.protobuf.Empty request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getGetBindingsSubscriptionsMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<io.dapr.DaprClientProtos.BindingResponseEnvelope> onBindingEvent(
|
||||
io.dapr.DaprClientProtos.BindingEventEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getOnBindingEventMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> onTopicEvent(
|
||||
io.dapr.DaprClientProtos.CloudEventEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getOnTopicEventMethod(), getCallOptions()), request);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int METHODID_ON_INVOKE = 0;
|
||||
private static final int METHODID_GET_TOPIC_SUBSCRIPTIONS = 1;
|
||||
private static final int METHODID_GET_BINDINGS_SUBSCRIPTIONS = 2;
|
||||
private static final int METHODID_ON_BINDING_EVENT = 3;
|
||||
private static final int METHODID_ON_TOPIC_EVENT = 4;
|
||||
|
||||
private static final class MethodHandlers<Req, Resp> implements
|
||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||
private final DaprClientImplBase serviceImpl;
|
||||
private final int methodId;
|
||||
|
||||
MethodHandlers(DaprClientImplBase serviceImpl, int methodId) {
|
||||
this.serviceImpl = serviceImpl;
|
||||
this.methodId = methodId;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
case METHODID_ON_INVOKE:
|
||||
serviceImpl.onInvoke((io.dapr.DaprClientProtos.InvokeEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<com.google.protobuf.Any>) responseObserver);
|
||||
break;
|
||||
case METHODID_GET_TOPIC_SUBSCRIPTIONS:
|
||||
serviceImpl.getTopicSubscriptions((com.google.protobuf.Empty) request,
|
||||
(io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.GetTopicSubscriptionsEnvelope>) responseObserver);
|
||||
break;
|
||||
case METHODID_GET_BINDINGS_SUBSCRIPTIONS:
|
||||
serviceImpl.getBindingsSubscriptions((com.google.protobuf.Empty) request,
|
||||
(io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.GetBindingsSubscriptionsEnvelope>) responseObserver);
|
||||
break;
|
||||
case METHODID_ON_BINDING_EVENT:
|
||||
serviceImpl.onBindingEvent((io.dapr.DaprClientProtos.BindingEventEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<io.dapr.DaprClientProtos.BindingResponseEnvelope>) responseObserver);
|
||||
break;
|
||||
case METHODID_ON_TOPIC_EVENT:
|
||||
serviceImpl.onTopicEvent((io.dapr.DaprClientProtos.CloudEventEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class DaprClientBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||
DaprClientBaseDescriptorSupplier() {}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||
return io.dapr.DaprClientProtos.getDescriptor();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||
return getFileDescriptor().findServiceByName("DaprClient");
|
||||
}
|
||||
}
|
||||
|
||||
private static final class DaprClientFileDescriptorSupplier
|
||||
extends DaprClientBaseDescriptorSupplier {
|
||||
DaprClientFileDescriptorSupplier() {}
|
||||
}
|
||||
|
||||
private static final class DaprClientMethodDescriptorSupplier
|
||||
extends DaprClientBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||
private final String methodName;
|
||||
|
||||
DaprClientMethodDescriptorSupplier(String methodName) {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||
return getServiceDescriptor().findMethodByName(methodName);
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (DaprClientGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||
.setSchemaDescriptor(new DaprClientFileDescriptorSupplier())
|
||||
.addMethod(getOnInvokeMethod())
|
||||
.addMethod(getGetTopicSubscriptionsMethod())
|
||||
.addMethod(getGetBindingsSubscriptionsMethod())
|
||||
.addMethod(getOnBindingEventMethod())
|
||||
.addMethod(getOnTopicEventMethod())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,664 @@
|
|||
package io.dapr;
|
||||
|
||||
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||||
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
|
||||
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
|
||||
import static io.grpc.stub.ClientCalls.futureUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
|
||||
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Dapr definitions
|
||||
* </pre>
|
||||
*/
|
||||
@javax.annotation.Generated(
|
||||
value = "by gRPC proto compiler (version 1.24.0)",
|
||||
comments = "Source: dapr/dapr.proto")
|
||||
public final class DaprGrpc {
|
||||
|
||||
private DaprGrpc() {}
|
||||
|
||||
public static final String SERVICE_NAME = "dapr.Dapr";
|
||||
|
||||
// Static method descriptors that strictly reflect the proto.
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprProtos.PublishEventEnvelope,
|
||||
com.google.protobuf.Empty> getPublishEventMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "PublishEvent",
|
||||
requestType = io.dapr.DaprProtos.PublishEventEnvelope.class,
|
||||
responseType = com.google.protobuf.Empty.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprProtos.PublishEventEnvelope,
|
||||
com.google.protobuf.Empty> getPublishEventMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprProtos.PublishEventEnvelope, com.google.protobuf.Empty> getPublishEventMethod;
|
||||
if ((getPublishEventMethod = DaprGrpc.getPublishEventMethod) == null) {
|
||||
synchronized (DaprGrpc.class) {
|
||||
if ((getPublishEventMethod = DaprGrpc.getPublishEventMethod) == null) {
|
||||
DaprGrpc.getPublishEventMethod = getPublishEventMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprProtos.PublishEventEnvelope, com.google.protobuf.Empty>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "PublishEvent"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.PublishEventEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Empty.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprMethodDescriptorSupplier("PublishEvent"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getPublishEventMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprProtos.InvokeServiceEnvelope,
|
||||
io.dapr.DaprProtos.InvokeServiceResponseEnvelope> getInvokeServiceMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "InvokeService",
|
||||
requestType = io.dapr.DaprProtos.InvokeServiceEnvelope.class,
|
||||
responseType = io.dapr.DaprProtos.InvokeServiceResponseEnvelope.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprProtos.InvokeServiceEnvelope,
|
||||
io.dapr.DaprProtos.InvokeServiceResponseEnvelope> getInvokeServiceMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprProtos.InvokeServiceEnvelope, io.dapr.DaprProtos.InvokeServiceResponseEnvelope> getInvokeServiceMethod;
|
||||
if ((getInvokeServiceMethod = DaprGrpc.getInvokeServiceMethod) == null) {
|
||||
synchronized (DaprGrpc.class) {
|
||||
if ((getInvokeServiceMethod = DaprGrpc.getInvokeServiceMethod) == null) {
|
||||
DaprGrpc.getInvokeServiceMethod = getInvokeServiceMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprProtos.InvokeServiceEnvelope, io.dapr.DaprProtos.InvokeServiceResponseEnvelope>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "InvokeService"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.InvokeServiceEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.InvokeServiceResponseEnvelope.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprMethodDescriptorSupplier("InvokeService"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getInvokeServiceMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprProtos.InvokeBindingEnvelope,
|
||||
com.google.protobuf.Empty> getInvokeBindingMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "InvokeBinding",
|
||||
requestType = io.dapr.DaprProtos.InvokeBindingEnvelope.class,
|
||||
responseType = com.google.protobuf.Empty.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprProtos.InvokeBindingEnvelope,
|
||||
com.google.protobuf.Empty> getInvokeBindingMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprProtos.InvokeBindingEnvelope, com.google.protobuf.Empty> getInvokeBindingMethod;
|
||||
if ((getInvokeBindingMethod = DaprGrpc.getInvokeBindingMethod) == null) {
|
||||
synchronized (DaprGrpc.class) {
|
||||
if ((getInvokeBindingMethod = DaprGrpc.getInvokeBindingMethod) == null) {
|
||||
DaprGrpc.getInvokeBindingMethod = getInvokeBindingMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprProtos.InvokeBindingEnvelope, com.google.protobuf.Empty>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "InvokeBinding"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.InvokeBindingEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Empty.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprMethodDescriptorSupplier("InvokeBinding"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getInvokeBindingMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprProtos.GetStateEnvelope,
|
||||
io.dapr.DaprProtos.GetStateResponseEnvelope> getGetStateMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "GetState",
|
||||
requestType = io.dapr.DaprProtos.GetStateEnvelope.class,
|
||||
responseType = io.dapr.DaprProtos.GetStateResponseEnvelope.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprProtos.GetStateEnvelope,
|
||||
io.dapr.DaprProtos.GetStateResponseEnvelope> getGetStateMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprProtos.GetStateEnvelope, io.dapr.DaprProtos.GetStateResponseEnvelope> getGetStateMethod;
|
||||
if ((getGetStateMethod = DaprGrpc.getGetStateMethod) == null) {
|
||||
synchronized (DaprGrpc.class) {
|
||||
if ((getGetStateMethod = DaprGrpc.getGetStateMethod) == null) {
|
||||
DaprGrpc.getGetStateMethod = getGetStateMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprProtos.GetStateEnvelope, io.dapr.DaprProtos.GetStateResponseEnvelope>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetState"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.GetStateEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.GetStateResponseEnvelope.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprMethodDescriptorSupplier("GetState"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getGetStateMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprProtos.SaveStateEnvelope,
|
||||
com.google.protobuf.Empty> getSaveStateMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "SaveState",
|
||||
requestType = io.dapr.DaprProtos.SaveStateEnvelope.class,
|
||||
responseType = com.google.protobuf.Empty.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprProtos.SaveStateEnvelope,
|
||||
com.google.protobuf.Empty> getSaveStateMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprProtos.SaveStateEnvelope, com.google.protobuf.Empty> getSaveStateMethod;
|
||||
if ((getSaveStateMethod = DaprGrpc.getSaveStateMethod) == null) {
|
||||
synchronized (DaprGrpc.class) {
|
||||
if ((getSaveStateMethod = DaprGrpc.getSaveStateMethod) == null) {
|
||||
DaprGrpc.getSaveStateMethod = getSaveStateMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprProtos.SaveStateEnvelope, com.google.protobuf.Empty>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SaveState"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.SaveStateEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Empty.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprMethodDescriptorSupplier("SaveState"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getSaveStateMethod;
|
||||
}
|
||||
|
||||
private static volatile io.grpc.MethodDescriptor<io.dapr.DaprProtos.DeleteStateEnvelope,
|
||||
com.google.protobuf.Empty> getDeleteStateMethod;
|
||||
|
||||
@io.grpc.stub.annotations.RpcMethod(
|
||||
fullMethodName = SERVICE_NAME + '/' + "DeleteState",
|
||||
requestType = io.dapr.DaprProtos.DeleteStateEnvelope.class,
|
||||
responseType = com.google.protobuf.Empty.class,
|
||||
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
public static io.grpc.MethodDescriptor<io.dapr.DaprProtos.DeleteStateEnvelope,
|
||||
com.google.protobuf.Empty> getDeleteStateMethod() {
|
||||
io.grpc.MethodDescriptor<io.dapr.DaprProtos.DeleteStateEnvelope, com.google.protobuf.Empty> getDeleteStateMethod;
|
||||
if ((getDeleteStateMethod = DaprGrpc.getDeleteStateMethod) == null) {
|
||||
synchronized (DaprGrpc.class) {
|
||||
if ((getDeleteStateMethod = DaprGrpc.getDeleteStateMethod) == null) {
|
||||
DaprGrpc.getDeleteStateMethod = getDeleteStateMethod =
|
||||
io.grpc.MethodDescriptor.<io.dapr.DaprProtos.DeleteStateEnvelope, com.google.protobuf.Empty>newBuilder()
|
||||
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
|
||||
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteState"))
|
||||
.setSampledToLocalTracing(true)
|
||||
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
io.dapr.DaprProtos.DeleteStateEnvelope.getDefaultInstance()))
|
||||
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||||
com.google.protobuf.Empty.getDefaultInstance()))
|
||||
.setSchemaDescriptor(new DaprMethodDescriptorSupplier("DeleteState"))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return getDeleteStateMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new async stub that supports all call types for the service
|
||||
*/
|
||||
public static DaprStub newStub(io.grpc.Channel channel) {
|
||||
return new DaprStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||||
*/
|
||||
public static DaprBlockingStub newBlockingStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new DaprBlockingStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||||
*/
|
||||
public static DaprFutureStub newFutureStub(
|
||||
io.grpc.Channel channel) {
|
||||
return new DaprFutureStub(channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Dapr definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static abstract class DaprImplBase implements io.grpc.BindableService {
|
||||
|
||||
/**
|
||||
*/
|
||||
public void publishEvent(io.dapr.DaprProtos.PublishEventEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getPublishEventMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void invokeService(io.dapr.DaprProtos.InvokeServiceEnvelope request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprProtos.InvokeServiceResponseEnvelope> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getInvokeServiceMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void invokeBinding(io.dapr.DaprProtos.InvokeBindingEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getInvokeBindingMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void getState(io.dapr.DaprProtos.GetStateEnvelope request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprProtos.GetStateResponseEnvelope> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getGetStateMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void saveState(io.dapr.DaprProtos.SaveStateEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getSaveStateMethod(), responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void deleteState(io.dapr.DaprProtos.DeleteStateEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnimplementedUnaryCall(getDeleteStateMethod(), responseObserver);
|
||||
}
|
||||
|
||||
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||||
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||||
.addMethod(
|
||||
getPublishEventMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprProtos.PublishEventEnvelope,
|
||||
com.google.protobuf.Empty>(
|
||||
this, METHODID_PUBLISH_EVENT)))
|
||||
.addMethod(
|
||||
getInvokeServiceMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprProtos.InvokeServiceEnvelope,
|
||||
io.dapr.DaprProtos.InvokeServiceResponseEnvelope>(
|
||||
this, METHODID_INVOKE_SERVICE)))
|
||||
.addMethod(
|
||||
getInvokeBindingMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprProtos.InvokeBindingEnvelope,
|
||||
com.google.protobuf.Empty>(
|
||||
this, METHODID_INVOKE_BINDING)))
|
||||
.addMethod(
|
||||
getGetStateMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprProtos.GetStateEnvelope,
|
||||
io.dapr.DaprProtos.GetStateResponseEnvelope>(
|
||||
this, METHODID_GET_STATE)))
|
||||
.addMethod(
|
||||
getSaveStateMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprProtos.SaveStateEnvelope,
|
||||
com.google.protobuf.Empty>(
|
||||
this, METHODID_SAVE_STATE)))
|
||||
.addMethod(
|
||||
getDeleteStateMethod(),
|
||||
asyncUnaryCall(
|
||||
new MethodHandlers<
|
||||
io.dapr.DaprProtos.DeleteStateEnvelope,
|
||||
com.google.protobuf.Empty>(
|
||||
this, METHODID_DELETE_STATE)))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Dapr definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static final class DaprStub extends io.grpc.stub.AbstractStub<DaprStub> {
|
||||
private DaprStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private DaprStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected DaprStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new DaprStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void publishEvent(io.dapr.DaprProtos.PublishEventEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getPublishEventMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void invokeService(io.dapr.DaprProtos.InvokeServiceEnvelope request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprProtos.InvokeServiceResponseEnvelope> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getInvokeServiceMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void invokeBinding(io.dapr.DaprProtos.InvokeBindingEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getInvokeBindingMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void getState(io.dapr.DaprProtos.GetStateEnvelope request,
|
||||
io.grpc.stub.StreamObserver<io.dapr.DaprProtos.GetStateResponseEnvelope> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getGetStateMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void saveState(io.dapr.DaprProtos.SaveStateEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getSaveStateMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public void deleteState(io.dapr.DaprProtos.DeleteStateEnvelope request,
|
||||
io.grpc.stub.StreamObserver<com.google.protobuf.Empty> responseObserver) {
|
||||
asyncUnaryCall(
|
||||
getChannel().newCall(getDeleteStateMethod(), getCallOptions()), request, responseObserver);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Dapr definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static final class DaprBlockingStub extends io.grpc.stub.AbstractStub<DaprBlockingStub> {
|
||||
private DaprBlockingStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private DaprBlockingStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected DaprBlockingStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new DaprBlockingStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.protobuf.Empty publishEvent(io.dapr.DaprProtos.PublishEventEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getPublishEventMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public io.dapr.DaprProtos.InvokeServiceResponseEnvelope invokeService(io.dapr.DaprProtos.InvokeServiceEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getInvokeServiceMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.protobuf.Empty invokeBinding(io.dapr.DaprProtos.InvokeBindingEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getInvokeBindingMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public io.dapr.DaprProtos.GetStateResponseEnvelope getState(io.dapr.DaprProtos.GetStateEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getGetStateMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.protobuf.Empty saveState(io.dapr.DaprProtos.SaveStateEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getSaveStateMethod(), getCallOptions(), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.protobuf.Empty deleteState(io.dapr.DaprProtos.DeleteStateEnvelope request) {
|
||||
return blockingUnaryCall(
|
||||
getChannel(), getDeleteStateMethod(), getCallOptions(), request);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* Dapr definitions
|
||||
* </pre>
|
||||
*/
|
||||
public static final class DaprFutureStub extends io.grpc.stub.AbstractStub<DaprFutureStub> {
|
||||
private DaprFutureStub(io.grpc.Channel channel) {
|
||||
super(channel);
|
||||
}
|
||||
|
||||
private DaprFutureStub(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
super(channel, callOptions);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected DaprFutureStub build(io.grpc.Channel channel,
|
||||
io.grpc.CallOptions callOptions) {
|
||||
return new DaprFutureStub(channel, callOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> publishEvent(
|
||||
io.dapr.DaprProtos.PublishEventEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getPublishEventMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<io.dapr.DaprProtos.InvokeServiceResponseEnvelope> invokeService(
|
||||
io.dapr.DaprProtos.InvokeServiceEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getInvokeServiceMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> invokeBinding(
|
||||
io.dapr.DaprProtos.InvokeBindingEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getInvokeBindingMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<io.dapr.DaprProtos.GetStateResponseEnvelope> getState(
|
||||
io.dapr.DaprProtos.GetStateEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getGetStateMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> saveState(
|
||||
io.dapr.DaprProtos.SaveStateEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getSaveStateMethod(), getCallOptions()), request);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Empty> deleteState(
|
||||
io.dapr.DaprProtos.DeleteStateEnvelope request) {
|
||||
return futureUnaryCall(
|
||||
getChannel().newCall(getDeleteStateMethod(), getCallOptions()), request);
|
||||
}
|
||||
}
|
||||
|
||||
private static final int METHODID_PUBLISH_EVENT = 0;
|
||||
private static final int METHODID_INVOKE_SERVICE = 1;
|
||||
private static final int METHODID_INVOKE_BINDING = 2;
|
||||
private static final int METHODID_GET_STATE = 3;
|
||||
private static final int METHODID_SAVE_STATE = 4;
|
||||
private static final int METHODID_DELETE_STATE = 5;
|
||||
|
||||
private static final class MethodHandlers<Req, Resp> implements
|
||||
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
||||
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
||||
private final DaprImplBase serviceImpl;
|
||||
private final int methodId;
|
||||
|
||||
MethodHandlers(DaprImplBase serviceImpl, int methodId) {
|
||||
this.serviceImpl = serviceImpl;
|
||||
this.methodId = methodId;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
case METHODID_PUBLISH_EVENT:
|
||||
serviceImpl.publishEvent((io.dapr.DaprProtos.PublishEventEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
|
||||
break;
|
||||
case METHODID_INVOKE_SERVICE:
|
||||
serviceImpl.invokeService((io.dapr.DaprProtos.InvokeServiceEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<io.dapr.DaprProtos.InvokeServiceResponseEnvelope>) responseObserver);
|
||||
break;
|
||||
case METHODID_INVOKE_BINDING:
|
||||
serviceImpl.invokeBinding((io.dapr.DaprProtos.InvokeBindingEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
|
||||
break;
|
||||
case METHODID_GET_STATE:
|
||||
serviceImpl.getState((io.dapr.DaprProtos.GetStateEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<io.dapr.DaprProtos.GetStateResponseEnvelope>) responseObserver);
|
||||
break;
|
||||
case METHODID_SAVE_STATE:
|
||||
serviceImpl.saveState((io.dapr.DaprProtos.SaveStateEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
|
||||
break;
|
||||
case METHODID_DELETE_STATE:
|
||||
serviceImpl.deleteState((io.dapr.DaprProtos.DeleteStateEnvelope) request,
|
||||
(io.grpc.stub.StreamObserver<com.google.protobuf.Empty>) responseObserver);
|
||||
break;
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@java.lang.SuppressWarnings("unchecked")
|
||||
public io.grpc.stub.StreamObserver<Req> invoke(
|
||||
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
||||
switch (methodId) {
|
||||
default:
|
||||
throw new AssertionError();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static abstract class DaprBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||||
DaprBaseDescriptorSupplier() {}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||||
return io.dapr.DaprProtos.getDescriptor();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||||
return getFileDescriptor().findServiceByName("Dapr");
|
||||
}
|
||||
}
|
||||
|
||||
private static final class DaprFileDescriptorSupplier
|
||||
extends DaprBaseDescriptorSupplier {
|
||||
DaprFileDescriptorSupplier() {}
|
||||
}
|
||||
|
||||
private static final class DaprMethodDescriptorSupplier
|
||||
extends DaprBaseDescriptorSupplier
|
||||
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||||
private final String methodName;
|
||||
|
||||
DaprMethodDescriptorSupplier(String methodName) {
|
||||
this.methodName = methodName;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
|
||||
return getServiceDescriptor().findMethodByName(methodName);
|
||||
}
|
||||
}
|
||||
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (DaprGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||||
.setSchemaDescriptor(new DaprFileDescriptorSupplier())
|
||||
.addMethod(getPublishEventMethod())
|
||||
.addMethod(getInvokeServiceMethod())
|
||||
.addMethod(getInvokeBindingMethod())
|
||||
.addMethod(getGetStateMethod())
|
||||
.addMethod(getSaveStateMethod())
|
||||
.addMethod(getDeleteStateMethod())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue