281 lines
11 KiB
Java
281 lines
11 KiB
Java
|
|
package cmvr.api;
|
||
|
|
|
||
|
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* <pre>
|
||
|
|
* Real-time bidirectional robot audio service.
|
||
|
|
* Java backend is the gRPC client; robot terminal is the gRPC server.
|
||
|
|
* </pre>
|
||
|
|
*/
|
||
|
|
@javax.annotation.Generated(
|
||
|
|
value = "by gRPC proto compiler (version 1.52.0)",
|
||
|
|
comments = "Source: cmvr/api/robot_audio.proto")
|
||
|
|
@io.grpc.stub.annotations.GrpcGenerated
|
||
|
|
public final class RobotAudioServiceGrpc {
|
||
|
|
|
||
|
|
private RobotAudioServiceGrpc() {}
|
||
|
|
|
||
|
|
public static final String SERVICE_NAME = "cmvr.api.RobotAudioService";
|
||
|
|
|
||
|
|
// Static method descriptors that strictly reflect the proto.
|
||
|
|
private static volatile io.grpc.MethodDescriptor<cmvr.api.RobotAudio.RobotAudioRequest,
|
||
|
|
cmvr.api.RobotAudio.RobotAudioResponse> getAudioTalkMethod;
|
||
|
|
|
||
|
|
@io.grpc.stub.annotations.RpcMethod(
|
||
|
|
fullMethodName = SERVICE_NAME + '/' + "AudioTalk",
|
||
|
|
requestType = cmvr.api.RobotAudio.RobotAudioRequest.class,
|
||
|
|
responseType = cmvr.api.RobotAudio.RobotAudioResponse.class,
|
||
|
|
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||
|
|
public static io.grpc.MethodDescriptor<cmvr.api.RobotAudio.RobotAudioRequest,
|
||
|
|
cmvr.api.RobotAudio.RobotAudioResponse> getAudioTalkMethod() {
|
||
|
|
io.grpc.MethodDescriptor<cmvr.api.RobotAudio.RobotAudioRequest, cmvr.api.RobotAudio.RobotAudioResponse> getAudioTalkMethod;
|
||
|
|
if ((getAudioTalkMethod = RobotAudioServiceGrpc.getAudioTalkMethod) == null) {
|
||
|
|
synchronized (RobotAudioServiceGrpc.class) {
|
||
|
|
if ((getAudioTalkMethod = RobotAudioServiceGrpc.getAudioTalkMethod) == null) {
|
||
|
|
RobotAudioServiceGrpc.getAudioTalkMethod = getAudioTalkMethod =
|
||
|
|
io.grpc.MethodDescriptor.<cmvr.api.RobotAudio.RobotAudioRequest, cmvr.api.RobotAudio.RobotAudioResponse>newBuilder()
|
||
|
|
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
|
||
|
|
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "AudioTalk"))
|
||
|
|
.setSampledToLocalTracing(true)
|
||
|
|
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||
|
|
cmvr.api.RobotAudio.RobotAudioRequest.getDefaultInstance()))
|
||
|
|
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
|
||
|
|
cmvr.api.RobotAudio.RobotAudioResponse.getDefaultInstance()))
|
||
|
|
.setSchemaDescriptor(new RobotAudioServiceMethodDescriptorSupplier("AudioTalk"))
|
||
|
|
.build();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return getAudioTalkMethod;
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Creates a new async stub that supports all call types for the service
|
||
|
|
*/
|
||
|
|
public static RobotAudioServiceStub newStub(io.grpc.Channel channel) {
|
||
|
|
io.grpc.stub.AbstractStub.StubFactory<RobotAudioServiceStub> factory =
|
||
|
|
new io.grpc.stub.AbstractStub.StubFactory<RobotAudioServiceStub>() {
|
||
|
|
@java.lang.Override
|
||
|
|
public RobotAudioServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
return new RobotAudioServiceStub(channel, callOptions);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
return RobotAudioServiceStub.newStub(factory, channel);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
|
||
|
|
*/
|
||
|
|
public static RobotAudioServiceBlockingStub newBlockingStub(
|
||
|
|
io.grpc.Channel channel) {
|
||
|
|
io.grpc.stub.AbstractStub.StubFactory<RobotAudioServiceBlockingStub> factory =
|
||
|
|
new io.grpc.stub.AbstractStub.StubFactory<RobotAudioServiceBlockingStub>() {
|
||
|
|
@java.lang.Override
|
||
|
|
public RobotAudioServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
return new RobotAudioServiceBlockingStub(channel, callOptions);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
return RobotAudioServiceBlockingStub.newStub(factory, channel);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Creates a new ListenableFuture-style stub that supports unary calls on the service
|
||
|
|
*/
|
||
|
|
public static RobotAudioServiceFutureStub newFutureStub(
|
||
|
|
io.grpc.Channel channel) {
|
||
|
|
io.grpc.stub.AbstractStub.StubFactory<RobotAudioServiceFutureStub> factory =
|
||
|
|
new io.grpc.stub.AbstractStub.StubFactory<RobotAudioServiceFutureStub>() {
|
||
|
|
@java.lang.Override
|
||
|
|
public RobotAudioServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
return new RobotAudioServiceFutureStub(channel, callOptions);
|
||
|
|
}
|
||
|
|
};
|
||
|
|
return RobotAudioServiceFutureStub.newStub(factory, channel);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* <pre>
|
||
|
|
* Real-time bidirectional robot audio service.
|
||
|
|
* Java backend is the gRPC client; robot terminal is the gRPC server.
|
||
|
|
* </pre>
|
||
|
|
*/
|
||
|
|
public static abstract class RobotAudioServiceImplBase implements io.grpc.BindableService {
|
||
|
|
|
||
|
|
/**
|
||
|
|
*/
|
||
|
|
public io.grpc.stub.StreamObserver<cmvr.api.RobotAudio.RobotAudioRequest> audioTalk(
|
||
|
|
io.grpc.stub.StreamObserver<cmvr.api.RobotAudio.RobotAudioResponse> responseObserver) {
|
||
|
|
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getAudioTalkMethod(), responseObserver);
|
||
|
|
}
|
||
|
|
|
||
|
|
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
|
||
|
|
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
|
||
|
|
.addMethod(
|
||
|
|
getAudioTalkMethod(),
|
||
|
|
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
|
||
|
|
new MethodHandlers<
|
||
|
|
cmvr.api.RobotAudio.RobotAudioRequest,
|
||
|
|
cmvr.api.RobotAudio.RobotAudioResponse>(
|
||
|
|
this, METHODID_AUDIO_TALK)))
|
||
|
|
.build();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* <pre>
|
||
|
|
* Real-time bidirectional robot audio service.
|
||
|
|
* Java backend is the gRPC client; robot terminal is the gRPC server.
|
||
|
|
* </pre>
|
||
|
|
*/
|
||
|
|
public static final class RobotAudioServiceStub extends io.grpc.stub.AbstractAsyncStub<RobotAudioServiceStub> {
|
||
|
|
private RobotAudioServiceStub(
|
||
|
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
super(channel, callOptions);
|
||
|
|
}
|
||
|
|
|
||
|
|
@java.lang.Override
|
||
|
|
protected RobotAudioServiceStub build(
|
||
|
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
return new RobotAudioServiceStub(channel, callOptions);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
*/
|
||
|
|
public io.grpc.stub.StreamObserver<cmvr.api.RobotAudio.RobotAudioRequest> audioTalk(
|
||
|
|
io.grpc.stub.StreamObserver<cmvr.api.RobotAudio.RobotAudioResponse> responseObserver) {
|
||
|
|
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
|
||
|
|
getChannel().newCall(getAudioTalkMethod(), getCallOptions()), responseObserver);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* <pre>
|
||
|
|
* Real-time bidirectional robot audio service.
|
||
|
|
* Java backend is the gRPC client; robot terminal is the gRPC server.
|
||
|
|
* </pre>
|
||
|
|
*/
|
||
|
|
public static final class RobotAudioServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<RobotAudioServiceBlockingStub> {
|
||
|
|
private RobotAudioServiceBlockingStub(
|
||
|
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
super(channel, callOptions);
|
||
|
|
}
|
||
|
|
|
||
|
|
@java.lang.Override
|
||
|
|
protected RobotAudioServiceBlockingStub build(
|
||
|
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
return new RobotAudioServiceBlockingStub(channel, callOptions);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* <pre>
|
||
|
|
* Real-time bidirectional robot audio service.
|
||
|
|
* Java backend is the gRPC client; robot terminal is the gRPC server.
|
||
|
|
* </pre>
|
||
|
|
*/
|
||
|
|
public static final class RobotAudioServiceFutureStub extends io.grpc.stub.AbstractFutureStub<RobotAudioServiceFutureStub> {
|
||
|
|
private RobotAudioServiceFutureStub(
|
||
|
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
super(channel, callOptions);
|
||
|
|
}
|
||
|
|
|
||
|
|
@java.lang.Override
|
||
|
|
protected RobotAudioServiceFutureStub build(
|
||
|
|
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
|
||
|
|
return new RobotAudioServiceFutureStub(channel, callOptions);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private static final int METHODID_AUDIO_TALK = 0;
|
||
|
|
|
||
|
|
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 RobotAudioServiceImplBase serviceImpl;
|
||
|
|
private final int methodId;
|
||
|
|
|
||
|
|
MethodHandlers(RobotAudioServiceImplBase 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) {
|
||
|
|
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) {
|
||
|
|
case METHODID_AUDIO_TALK:
|
||
|
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.audioTalk(
|
||
|
|
(io.grpc.stub.StreamObserver<cmvr.api.RobotAudio.RobotAudioResponse>) responseObserver);
|
||
|
|
default:
|
||
|
|
throw new AssertionError();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private static abstract class RobotAudioServiceBaseDescriptorSupplier
|
||
|
|
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
|
||
|
|
RobotAudioServiceBaseDescriptorSupplier() {}
|
||
|
|
|
||
|
|
@java.lang.Override
|
||
|
|
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
|
||
|
|
return cmvr.api.RobotAudio.getDescriptor();
|
||
|
|
}
|
||
|
|
|
||
|
|
@java.lang.Override
|
||
|
|
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
|
||
|
|
return getFileDescriptor().findServiceByName("RobotAudioService");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private static final class RobotAudioServiceFileDescriptorSupplier
|
||
|
|
extends RobotAudioServiceBaseDescriptorSupplier {
|
||
|
|
RobotAudioServiceFileDescriptorSupplier() {}
|
||
|
|
}
|
||
|
|
|
||
|
|
private static final class RobotAudioServiceMethodDescriptorSupplier
|
||
|
|
extends RobotAudioServiceBaseDescriptorSupplier
|
||
|
|
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
|
||
|
|
private final String methodName;
|
||
|
|
|
||
|
|
RobotAudioServiceMethodDescriptorSupplier(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 (RobotAudioServiceGrpc.class) {
|
||
|
|
result = serviceDescriptor;
|
||
|
|
if (result == null) {
|
||
|
|
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
|
||
|
|
.setSchemaDescriptor(new RobotAudioServiceFileDescriptorSupplier())
|
||
|
|
.addMethod(getAudioTalkMethod())
|
||
|
|
.build();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
}
|