grpc.store.StoreGrpc Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of client-protos-jvm Show documentation
Show all versions of client-protos-jvm Show documentation
Kotlin protobuf protocols for the JVM that define the Momento gRPC wire format
package grpc.store;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.57.2)",
comments = "Source: store.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class StoreGrpc {
private StoreGrpc() {}
public static final java.lang.String SERVICE_NAME = "store.Store";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getGetMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Get",
requestType = grpc.store._StoreGetRequest.class,
responseType = grpc.store._StoreGetResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getGetMethod() {
io.grpc.MethodDescriptor getGetMethod;
if ((getGetMethod = StoreGrpc.getGetMethod) == null) {
synchronized (StoreGrpc.class) {
if ((getGetMethod = StoreGrpc.getGetMethod) == null) {
StoreGrpc.getGetMethod = getGetMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Get"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.store._StoreGetRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.store._StoreGetResponse.getDefaultInstance()))
.setSchemaDescriptor(new StoreMethodDescriptorSupplier("Get"))
.build();
}
}
}
return getGetMethod;
}
private static volatile io.grpc.MethodDescriptor getPutMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Put",
requestType = grpc.store._StorePutRequest.class,
responseType = grpc.store._StorePutResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getPutMethod() {
io.grpc.MethodDescriptor getPutMethod;
if ((getPutMethod = StoreGrpc.getPutMethod) == null) {
synchronized (StoreGrpc.class) {
if ((getPutMethod = StoreGrpc.getPutMethod) == null) {
StoreGrpc.getPutMethod = getPutMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Put"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.store._StorePutRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.store._StorePutResponse.getDefaultInstance()))
.setSchemaDescriptor(new StoreMethodDescriptorSupplier("Put"))
.build();
}
}
}
return getPutMethod;
}
private static volatile io.grpc.MethodDescriptor getDeleteMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Delete",
requestType = grpc.store._StoreDeleteRequest.class,
responseType = grpc.store._StoreDeleteResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getDeleteMethod() {
io.grpc.MethodDescriptor getDeleteMethod;
if ((getDeleteMethod = StoreGrpc.getDeleteMethod) == null) {
synchronized (StoreGrpc.class) {
if ((getDeleteMethod = StoreGrpc.getDeleteMethod) == null) {
StoreGrpc.getDeleteMethod = getDeleteMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Delete"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.store._StoreDeleteRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.store._StoreDeleteResponse.getDefaultInstance()))
.setSchemaDescriptor(new StoreMethodDescriptorSupplier("Delete"))
.build();
}
}
}
return getDeleteMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static StoreStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public StoreStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new StoreStub(channel, callOptions);
}
};
return StoreStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static StoreBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public StoreBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new StoreBlockingStub(channel, callOptions);
}
};
return StoreBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static StoreFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public StoreFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new StoreFutureStub(channel, callOptions);
}
};
return StoreFutureStub.newStub(factory, channel);
}
/**
*/
public interface AsyncService {
/**
*/
default void get(grpc.store._StoreGetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver);
}
/**
*/
default void put(grpc.store._StorePutRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getPutMethod(), responseObserver);
}
/**
*/
default void delete(grpc.store._StoreDeleteRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeleteMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Store.
*/
public static abstract class StoreImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return StoreGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Store.
*/
public static final class StoreStub
extends io.grpc.stub.AbstractAsyncStub {
private StoreStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected StoreStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new StoreStub(channel, callOptions);
}
/**
*/
public void get(grpc.store._StoreGetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void put(grpc.store._StorePutRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getPutMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void delete(grpc.store._StoreDeleteRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getDeleteMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Store.
*/
public static final class StoreBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private StoreBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected StoreBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new StoreBlockingStub(channel, callOptions);
}
/**
*/
public grpc.store._StoreGetResponse get(grpc.store._StoreGetRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetMethod(), getCallOptions(), request);
}
/**
*/
public grpc.store._StorePutResponse put(grpc.store._StorePutRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getPutMethod(), getCallOptions(), request);
}
/**
*/
public grpc.store._StoreDeleteResponse delete(grpc.store._StoreDeleteRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getDeleteMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Store.
*/
public static final class StoreFutureStub
extends io.grpc.stub.AbstractFutureStub {
private StoreFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected StoreFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new StoreFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture get(
grpc.store._StoreGetRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture put(
grpc.store._StorePutRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getPutMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture delete(
grpc.store._StoreDeleteRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getDeleteMethod(), getCallOptions()), request);
}
}
private static final int METHODID_GET = 0;
private static final int METHODID_PUT = 1;
private static final int METHODID_DELETE = 2;
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 AsyncService serviceImpl;
private final int methodId;
MethodHandlers(AsyncService 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_GET:
serviceImpl.get((grpc.store._StoreGetRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_PUT:
serviceImpl.put((grpc.store._StorePutRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_DELETE:
serviceImpl.delete((grpc.store._StoreDeleteRequest) 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();
}
}
}
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getGetMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
grpc.store._StoreGetRequest,
grpc.store._StoreGetResponse>(
service, METHODID_GET)))
.addMethod(
getPutMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
grpc.store._StorePutRequest,
grpc.store._StorePutResponse>(
service, METHODID_PUT)))
.addMethod(
getDeleteMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
grpc.store._StoreDeleteRequest,
grpc.store._StoreDeleteResponse>(
service, METHODID_DELETE)))
.build();
}
private static abstract class StoreBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
StoreBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return grpc.store.StoreOuterClass.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Store");
}
}
private static final class StoreFileDescriptorSupplier
extends StoreBaseDescriptorSupplier {
StoreFileDescriptorSupplier() {}
}
private static final class StoreMethodDescriptorSupplier
extends StoreBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
StoreMethodDescriptorSupplier(java.lang.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 (StoreGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new StoreFileDescriptorSupplier())
.addMethod(getGetMethod())
.addMethod(getPutMethod())
.addMethod(getDeleteMethod())
.build();
}
}
}
return result;
}
}