grpc.cache_client.HttpCacheGrpc 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.cache_client;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.57.2)",
comments = "Source: httpcache.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class HttpCacheGrpc {
private HttpCacheGrpc() {}
public static final java.lang.String SERVICE_NAME = "cache_client.HttpCache";
// 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.cache_client._HttpGetRequest.class,
responseType = com.google.api.HttpBody.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getGetMethod() {
io.grpc.MethodDescriptor getGetMethod;
if ((getGetMethod = HttpCacheGrpc.getGetMethod) == null) {
synchronized (HttpCacheGrpc.class) {
if ((getGetMethod = HttpCacheGrpc.getGetMethod) == null) {
HttpCacheGrpc.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.cache_client._HttpGetRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
com.google.api.HttpBody.getDefaultInstance()))
.setSchemaDescriptor(new HttpCacheMethodDescriptorSupplier("Get"))
.build();
}
}
}
return getGetMethod;
}
private static volatile io.grpc.MethodDescriptor getSetMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "Set",
requestType = grpc.cache_client._HttpSetRequest.class,
responseType = grpc.cache_client._SetResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getSetMethod() {
io.grpc.MethodDescriptor getSetMethod;
if ((getSetMethod = HttpCacheGrpc.getSetMethod) == null) {
synchronized (HttpCacheGrpc.class) {
if ((getSetMethod = HttpCacheGrpc.getSetMethod) == null) {
HttpCacheGrpc.getSetMethod = getSetMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "Set"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.cache_client._HttpSetRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.cache_client._SetResponse.getDefaultInstance()))
.setSchemaDescriptor(new HttpCacheMethodDescriptorSupplier("Set"))
.build();
}
}
}
return getSetMethod;
}
private static volatile io.grpc.MethodDescriptor getSetButItsAPutMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "SetButItsAPut",
requestType = grpc.cache_client._HttpSetRequest.class,
responseType = grpc.cache_client._SetResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getSetButItsAPutMethod() {
io.grpc.MethodDescriptor getSetButItsAPutMethod;
if ((getSetButItsAPutMethod = HttpCacheGrpc.getSetButItsAPutMethod) == null) {
synchronized (HttpCacheGrpc.class) {
if ((getSetButItsAPutMethod = HttpCacheGrpc.getSetButItsAPutMethod) == null) {
HttpCacheGrpc.getSetButItsAPutMethod = getSetButItsAPutMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetButItsAPut"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.cache_client._HttpSetRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
grpc.cache_client._SetResponse.getDefaultInstance()))
.setSchemaDescriptor(new HttpCacheMethodDescriptorSupplier("SetButItsAPut"))
.build();
}
}
}
return getSetButItsAPutMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static HttpCacheStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public HttpCacheStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new HttpCacheStub(channel, callOptions);
}
};
return HttpCacheStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static HttpCacheBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public HttpCacheBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new HttpCacheBlockingStub(channel, callOptions);
}
};
return HttpCacheBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static HttpCacheFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public HttpCacheFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new HttpCacheFutureStub(channel, callOptions);
}
};
return HttpCacheFutureStub.newStub(factory, channel);
}
/**
*/
public interface AsyncService {
/**
*/
default void get(grpc.cache_client._HttpGetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver);
}
/**
*/
default void set(grpc.cache_client._HttpSetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetMethod(), responseObserver);
}
/**
*/
default void setButItsAPut(grpc.cache_client._HttpSetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetButItsAPutMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service HttpCache.
*/
public static abstract class HttpCacheImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return HttpCacheGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service HttpCache.
*/
public static final class HttpCacheStub
extends io.grpc.stub.AbstractAsyncStub {
private HttpCacheStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected HttpCacheStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new HttpCacheStub(channel, callOptions);
}
/**
*/
public void get(grpc.cache_client._HttpGetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void set(grpc.cache_client._HttpSetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getSetMethod(), getCallOptions()), request, responseObserver);
}
/**
*/
public void setButItsAPut(grpc.cache_client._HttpSetRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getSetButItsAPutMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service HttpCache.
*/
public static final class HttpCacheBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private HttpCacheBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected HttpCacheBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new HttpCacheBlockingStub(channel, callOptions);
}
/**
*/
public com.google.api.HttpBody get(grpc.cache_client._HttpGetRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetMethod(), getCallOptions(), request);
}
/**
*/
public grpc.cache_client._SetResponse set(grpc.cache_client._HttpSetRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getSetMethod(), getCallOptions(), request);
}
/**
*/
public grpc.cache_client._SetResponse setButItsAPut(grpc.cache_client._HttpSetRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getSetButItsAPutMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service HttpCache.
*/
public static final class HttpCacheFutureStub
extends io.grpc.stub.AbstractFutureStub {
private HttpCacheFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected HttpCacheFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new HttpCacheFutureStub(channel, callOptions);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture get(
grpc.cache_client._HttpGetRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getGetMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture set(
grpc.cache_client._HttpSetRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getSetMethod(), getCallOptions()), request);
}
/**
*/
public com.google.common.util.concurrent.ListenableFuture setButItsAPut(
grpc.cache_client._HttpSetRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getSetButItsAPutMethod(), getCallOptions()), request);
}
}
private static final int METHODID_GET = 0;
private static final int METHODID_SET = 1;
private static final int METHODID_SET_BUT_ITS_APUT = 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.cache_client._HttpGetRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_SET:
serviceImpl.set((grpc.cache_client._HttpSetRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_SET_BUT_ITS_APUT:
serviceImpl.setButItsAPut((grpc.cache_client._HttpSetRequest) 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.cache_client._HttpGetRequest,
com.google.api.HttpBody>(
service, METHODID_GET)))
.addMethod(
getSetMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
grpc.cache_client._HttpSetRequest,
grpc.cache_client._SetResponse>(
service, METHODID_SET)))
.addMethod(
getSetButItsAPutMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
grpc.cache_client._HttpSetRequest,
grpc.cache_client._SetResponse>(
service, METHODID_SET_BUT_ITS_APUT)))
.build();
}
private static abstract class HttpCacheBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
HttpCacheBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return grpc.cache_client.Httpcache.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("HttpCache");
}
}
private static final class HttpCacheFileDescriptorSupplier
extends HttpCacheBaseDescriptorSupplier {
HttpCacheFileDescriptorSupplier() {}
}
private static final class HttpCacheMethodDescriptorSupplier
extends HttpCacheBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
HttpCacheMethodDescriptorSupplier(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 (HttpCacheGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new HttpCacheFileDescriptorSupplier())
.addMethod(getGetMethod())
.addMethod(getSetMethod())
.addMethod(getSetButItsAPutMethod())
.build();
}
}
}
return result;
}
}