in.ashwanthkumar.suuchi.examples.rpc.generated.PingServiceGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of suuchi-examples Show documentation
Show all versions of suuchi-examples Show documentation
Example modules using Suuchi
package in.ashwanthkumar.suuchi.examples.rpc.generated;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
/**
*
* The Ping service definition.
*
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.2.0)",
comments = "Source: example.proto")
public final class PingServiceGrpc {
private PingServiceGrpc() {}
public static final String SERVICE_NAME = "PingService";
// Static method descriptors that strictly reflect the proto.
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor METHOD_PING =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"PingService", "Ping"),
io.grpc.protobuf.ProtoUtils.marshaller(in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingResponse.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static PingServiceStub newStub(io.grpc.Channel channel) {
return new PingServiceStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static PingServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new PingServiceBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static PingServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
return new PingServiceFutureStub(channel);
}
/**
*
* The Ping service definition.
*
*/
public static abstract class PingServiceImplBase implements io.grpc.BindableService {
/**
*/
public void ping(in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnimplementedUnaryCall(METHOD_PING, responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_PING,
asyncUnaryCall(
new MethodHandlers<
in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingRequest,
in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingResponse>(
this, METHODID_PING)))
.build();
}
}
/**
*
* The Ping service definition.
*
*/
public static final class PingServiceStub extends io.grpc.stub.AbstractStub {
private PingServiceStub(io.grpc.Channel channel) {
super(channel);
}
private PingServiceStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PingServiceStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new PingServiceStub(channel, callOptions);
}
/**
*/
public void ping(in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingRequest request,
io.grpc.stub.StreamObserver responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_PING, getCallOptions()), request, responseObserver);
}
}
/**
*
* The Ping service definition.
*
*/
public static final class PingServiceBlockingStub extends io.grpc.stub.AbstractStub {
private PingServiceBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private PingServiceBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PingServiceBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new PingServiceBlockingStub(channel, callOptions);
}
/**
*/
public in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingResponse ping(in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_PING, getCallOptions(), request);
}
}
/**
*
* The Ping service definition.
*
*/
public static final class PingServiceFutureStub extends io.grpc.stub.AbstractStub {
private PingServiceFutureStub(io.grpc.Channel channel) {
super(channel);
}
private PingServiceFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PingServiceFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new PingServiceFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture ping(
in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingRequest request) {
return futureUnaryCall(
getChannel().newCall(METHOD_PING, getCallOptions()), request);
}
}
private static final int METHODID_PING = 0;
private static final class MethodHandlers implements
io.grpc.stub.ServerCalls.UnaryMethod,
io.grpc.stub.ServerCalls.ServerStreamingMethod,
io.grpc.stub.ServerCalls.ClientStreamingMethod,
io.grpc.stub.ServerCalls.BidiStreamingMethod {
private final PingServiceImplBase serviceImpl;
private final int methodId;
MethodHandlers(PingServiceImplBase 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 responseObserver) {
switch (methodId) {
case METHODID_PING:
serviceImpl.ping((in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.PingRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver invoke(
io.grpc.stub.StreamObserver responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
private static final class PingServiceDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier {
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return in.ashwanthkumar.suuchi.examples.rpc.generated.SuuchiRPC.getDescriptor();
}
}
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
io.grpc.ServiceDescriptor result = serviceDescriptor;
if (result == null) {
synchronized (PingServiceGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new PingServiceDescriptorSupplier())
.addMethod(METHOD_PING)
.build();
}
}
}
return result;
}
}