grpc.cache_client.PingGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client-protos Show documentation
Show all versions of client-protos Show documentation
Java protobuf protocols that define the Momento gRPC wire format
package grpc.cache_client;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.53.0)",
comments = "Source: cacheping.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class PingGrpc {
private PingGrpc() {}
public static final String SERVICE_NAME = "cache_client.Ping";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getPingMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Ping",
requestType = grpc.cache_client._PingRequest.class,
responseType = grpc.cache_client._PingResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getPingMethod() {
io.grpc.MethodDescriptor getPingMethod;
if ((getPingMethod = PingGrpc.getPingMethod) == null) {
synchronized (PingGrpc.class) {
if ((getPingMethod = PingGrpc.getPingMethod) == null) {
PingGrpc.getPingMethod = getPingMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Ping"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.cache_client._PingRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.cache_client._PingResponse.getDefaultInstance()))
.setSchemaDescriptor(new PingMethodDescriptorSupplier("Ping"))
.build();
}
}
}
return getPingMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static PingStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public PingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new PingStub(channel, callOptions);
}
};
return PingStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static PingBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public PingBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new PingBlockingStub(channel, callOptions);
}
};
return PingBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static PingFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public PingFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new PingFutureStub(channel, callOptions);
}
};
return PingFutureStub.newStub(factory, channel);
}
/**
*/
public static abstract class PingImplBase implements io.grpc.BindableService {
/**
*/
public void ping(grpc.cache_client._PingRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPingMethod(), responseObserver);
}
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getPingMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
grpc.cache_client._PingRequest,
grpc.cache_client._PingResponse>(
this, METHODID_PING)))
.build();
}
}
/**
*/
public static final class PingStub extends io.grpc.stub.AbstractAsyncStub {
private PingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new PingStub(channel, callOptions);
}
/**
*/
public void ping(grpc.cache_client._PingRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getPingMethod(), getCallOptions()), request, responseObserver);
}
}
/**
*/
public static final class PingBlockingStub extends io.grpc.stub.AbstractBlockingStub {
private PingBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PingBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new PingBlockingStub(channel, callOptions);
}
/**
*/
public grpc.cache_client._PingResponse ping(grpc.cache_client._PingRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getPingMethod(), getCallOptions(), request);
}
}
/**
*/
public static final class PingFutureStub extends io.grpc.stub.AbstractFutureStub {
private PingFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected PingFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new PingFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture ping(
grpc.cache_client._PingRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getPingMethod(), 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 PingImplBase serviceImpl;
private final int methodId;
MethodHandlers(PingImplBase 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((grpc.cache_client._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 abstract class PingBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
PingBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return grpc.cache_client.Cacheping.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Ping");
}
}
private static final class PingFileDescriptorSupplier
extends PingBaseDescriptorSupplier {
PingFileDescriptorSupplier() {}
}
private static final class PingMethodDescriptorSupplier
extends PingBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final String methodName;
PingMethodDescriptorSupplier(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 (PingGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new PingFileDescriptorSupplier())
.addMethod(getPingMethod())
.build();
}
}
}
return result;
}
}