io.etcd.jetcd.api.LeaseGrpc Maven / Gradle / Ivy
The newest version!
package io.etcd.jetcd.api;
import static io.grpc.MethodDescriptor.generateFullMethodName;
/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.68.1)",
comments = "Source: rpc.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class LeaseGrpc {
private LeaseGrpc() {}
public static final java.lang.String SERVICE_NAME = "etcdserverpb.Lease";
// Static method descriptors that strictly reflect the proto.
private static volatile io.grpc.MethodDescriptor getLeaseGrantMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "LeaseGrant",
requestType = io.etcd.jetcd.api.LeaseGrantRequest.class,
responseType = io.etcd.jetcd.api.LeaseGrantResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getLeaseGrantMethod() {
io.grpc.MethodDescriptor getLeaseGrantMethod;
if ((getLeaseGrantMethod = LeaseGrpc.getLeaseGrantMethod) == null) {
synchronized (LeaseGrpc.class) {
if ((getLeaseGrantMethod = LeaseGrpc.getLeaseGrantMethod) == null) {
LeaseGrpc.getLeaseGrantMethod = getLeaseGrantMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "LeaseGrant"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseGrantRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseGrantResponse.getDefaultInstance()))
.setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseGrant"))
.build();
}
}
}
return getLeaseGrantMethod;
}
private static volatile io.grpc.MethodDescriptor getLeaseRevokeMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "LeaseRevoke",
requestType = io.etcd.jetcd.api.LeaseRevokeRequest.class,
responseType = io.etcd.jetcd.api.LeaseRevokeResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getLeaseRevokeMethod() {
io.grpc.MethodDescriptor getLeaseRevokeMethod;
if ((getLeaseRevokeMethod = LeaseGrpc.getLeaseRevokeMethod) == null) {
synchronized (LeaseGrpc.class) {
if ((getLeaseRevokeMethod = LeaseGrpc.getLeaseRevokeMethod) == null) {
LeaseGrpc.getLeaseRevokeMethod = getLeaseRevokeMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "LeaseRevoke"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseRevokeRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseRevokeResponse.getDefaultInstance()))
.setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseRevoke"))
.build();
}
}
}
return getLeaseRevokeMethod;
}
private static volatile io.grpc.MethodDescriptor getLeaseKeepAliveMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "LeaseKeepAlive",
requestType = io.etcd.jetcd.api.LeaseKeepAliveRequest.class,
responseType = io.etcd.jetcd.api.LeaseKeepAliveResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
public static io.grpc.MethodDescriptor getLeaseKeepAliveMethod() {
io.grpc.MethodDescriptor getLeaseKeepAliveMethod;
if ((getLeaseKeepAliveMethod = LeaseGrpc.getLeaseKeepAliveMethod) == null) {
synchronized (LeaseGrpc.class) {
if ((getLeaseKeepAliveMethod = LeaseGrpc.getLeaseKeepAliveMethod) == null) {
LeaseGrpc.getLeaseKeepAliveMethod = getLeaseKeepAliveMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "LeaseKeepAlive"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseKeepAliveRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseKeepAliveResponse.getDefaultInstance()))
.setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseKeepAlive"))
.build();
}
}
}
return getLeaseKeepAliveMethod;
}
private static volatile io.grpc.MethodDescriptor getLeaseTimeToLiveMethod;
@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "LeaseTimeToLive",
requestType = io.etcd.jetcd.api.LeaseTimeToLiveRequest.class,
responseType = io.etcd.jetcd.api.LeaseTimeToLiveResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor getLeaseTimeToLiveMethod() {
io.grpc.MethodDescriptor getLeaseTimeToLiveMethod;
if ((getLeaseTimeToLiveMethod = LeaseGrpc.getLeaseTimeToLiveMethod) == null) {
synchronized (LeaseGrpc.class) {
if ((getLeaseTimeToLiveMethod = LeaseGrpc.getLeaseTimeToLiveMethod) == null) {
LeaseGrpc.getLeaseTimeToLiveMethod = getLeaseTimeToLiveMethod =
io.grpc.MethodDescriptor.newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "LeaseTimeToLive"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseTimeToLiveRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.etcd.jetcd.api.LeaseTimeToLiveResponse.getDefaultInstance()))
.setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseTimeToLive"))
.build();
}
}
}
return getLeaseTimeToLiveMethod;
}
/**
* Creates a new async stub that supports all call types for the service
*/
public static LeaseStub newStub(io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public LeaseStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new LeaseStub(channel, callOptions);
}
};
return LeaseStub.newStub(factory, channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static LeaseBlockingStub newBlockingStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public LeaseBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new LeaseBlockingStub(channel, callOptions);
}
};
return LeaseBlockingStub.newStub(factory, channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary calls on the service
*/
public static LeaseFutureStub newFutureStub(
io.grpc.Channel channel) {
io.grpc.stub.AbstractStub.StubFactory factory =
new io.grpc.stub.AbstractStub.StubFactory() {
@java.lang.Override
public LeaseFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new LeaseFutureStub(channel, callOptions);
}
};
return LeaseFutureStub.newStub(factory, channel);
}
/**
*/
public interface AsyncService {
/**
*
* LeaseGrant creates a lease which expires if the server does not receive a keepAlive
* within a given time to live period. All keys attached to the lease will be expired and
* deleted if the lease expires. Each expired key generates a delete event in the event history.
*
*/
default void leaseGrant(io.etcd.jetcd.api.LeaseGrantRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLeaseGrantMethod(), responseObserver);
}
/**
*
* LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
*
*/
default void leaseRevoke(io.etcd.jetcd.api.LeaseRevokeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLeaseRevokeMethod(), responseObserver);
}
/**
*
* LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client
* to the server and streaming keep alive responses from the server to the client.
*
*/
default io.grpc.stub.StreamObserver leaseKeepAlive(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getLeaseKeepAliveMethod(), responseObserver);
}
/**
*
* LeaseTimeToLive retrieves lease information.
*
*/
default void leaseTimeToLive(io.etcd.jetcd.api.LeaseTimeToLiveRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getLeaseTimeToLiveMethod(), responseObserver);
}
}
/**
* Base class for the server implementation of the service Lease.
*/
public static abstract class LeaseImplBase
implements io.grpc.BindableService, AsyncService {
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return LeaseGrpc.bindService(this);
}
}
/**
* A stub to allow clients to do asynchronous rpc calls to service Lease.
*/
public static final class LeaseStub
extends io.grpc.stub.AbstractAsyncStub {
private LeaseStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected LeaseStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new LeaseStub(channel, callOptions);
}
/**
*
* LeaseGrant creates a lease which expires if the server does not receive a keepAlive
* within a given time to live period. All keys attached to the lease will be expired and
* deleted if the lease expires. Each expired key generates a delete event in the event history.
*
*/
public void leaseGrant(io.etcd.jetcd.api.LeaseGrantRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getLeaseGrantMethod(), getCallOptions()), request, responseObserver);
}
/**
*
* LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
*
*/
public void leaseRevoke(io.etcd.jetcd.api.LeaseRevokeRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getLeaseRevokeMethod(), getCallOptions()), request, responseObserver);
}
/**
*
* LeaseKeepAlive keeps the lease alive by streaming keep alive requests from the client
* to the server and streaming keep alive responses from the server to the client.
*
*/
public io.grpc.stub.StreamObserver leaseKeepAlive(
io.grpc.stub.StreamObserver responseObserver) {
return io.grpc.stub.ClientCalls.asyncBidiStreamingCall(
getChannel().newCall(getLeaseKeepAliveMethod(), getCallOptions()), responseObserver);
}
/**
*
* LeaseTimeToLive retrieves lease information.
*
*/
public void leaseTimeToLive(io.etcd.jetcd.api.LeaseTimeToLiveRequest request,
io.grpc.stub.StreamObserver responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getLeaseTimeToLiveMethod(), getCallOptions()), request, responseObserver);
}
}
/**
* A stub to allow clients to do synchronous rpc calls to service Lease.
*/
public static final class LeaseBlockingStub
extends io.grpc.stub.AbstractBlockingStub {
private LeaseBlockingStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected LeaseBlockingStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new LeaseBlockingStub(channel, callOptions);
}
/**
*
* LeaseGrant creates a lease which expires if the server does not receive a keepAlive
* within a given time to live period. All keys attached to the lease will be expired and
* deleted if the lease expires. Each expired key generates a delete event in the event history.
*
*/
public io.etcd.jetcd.api.LeaseGrantResponse leaseGrant(io.etcd.jetcd.api.LeaseGrantRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getLeaseGrantMethod(), getCallOptions(), request);
}
/**
*
* LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
*
*/
public io.etcd.jetcd.api.LeaseRevokeResponse leaseRevoke(io.etcd.jetcd.api.LeaseRevokeRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getLeaseRevokeMethod(), getCallOptions(), request);
}
/**
*
* LeaseTimeToLive retrieves lease information.
*
*/
public io.etcd.jetcd.api.LeaseTimeToLiveResponse leaseTimeToLive(io.etcd.jetcd.api.LeaseTimeToLiveRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getLeaseTimeToLiveMethod(), getCallOptions(), request);
}
}
/**
* A stub to allow clients to do ListenableFuture-style rpc calls to service Lease.
*/
public static final class LeaseFutureStub
extends io.grpc.stub.AbstractFutureStub {
private LeaseFutureStub(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected LeaseFutureStub build(
io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
return new LeaseFutureStub(channel, callOptions);
}
/**
*
* LeaseGrant creates a lease which expires if the server does not receive a keepAlive
* within a given time to live period. All keys attached to the lease will be expired and
* deleted if the lease expires. Each expired key generates a delete event in the event history.
*
*/
public com.google.common.util.concurrent.ListenableFuture leaseGrant(
io.etcd.jetcd.api.LeaseGrantRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getLeaseGrantMethod(), getCallOptions()), request);
}
/**
*
* LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
*
*/
public com.google.common.util.concurrent.ListenableFuture leaseRevoke(
io.etcd.jetcd.api.LeaseRevokeRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getLeaseRevokeMethod(), getCallOptions()), request);
}
/**
*
* LeaseTimeToLive retrieves lease information.
*
*/
public com.google.common.util.concurrent.ListenableFuture leaseTimeToLive(
io.etcd.jetcd.api.LeaseTimeToLiveRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getLeaseTimeToLiveMethod(), getCallOptions()), request);
}
}
private static final int METHODID_LEASE_GRANT = 0;
private static final int METHODID_LEASE_REVOKE = 1;
private static final int METHODID_LEASE_TIME_TO_LIVE = 2;
private static final int METHODID_LEASE_KEEP_ALIVE = 3;
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_LEASE_GRANT:
serviceImpl.leaseGrant((io.etcd.jetcd.api.LeaseGrantRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_LEASE_REVOKE:
serviceImpl.leaseRevoke((io.etcd.jetcd.api.LeaseRevokeRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
case METHODID_LEASE_TIME_TO_LIVE:
serviceImpl.leaseTimeToLive((io.etcd.jetcd.api.LeaseTimeToLiveRequest) 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) {
case METHODID_LEASE_KEEP_ALIVE:
return (io.grpc.stub.StreamObserver) serviceImpl.leaseKeepAlive(
(io.grpc.stub.StreamObserver) responseObserver);
default:
throw new AssertionError();
}
}
}
public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
getLeaseGrantMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
io.etcd.jetcd.api.LeaseGrantRequest,
io.etcd.jetcd.api.LeaseGrantResponse>(
service, METHODID_LEASE_GRANT)))
.addMethod(
getLeaseRevokeMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
io.etcd.jetcd.api.LeaseRevokeRequest,
io.etcd.jetcd.api.LeaseRevokeResponse>(
service, METHODID_LEASE_REVOKE)))
.addMethod(
getLeaseKeepAliveMethod(),
io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
new MethodHandlers<
io.etcd.jetcd.api.LeaseKeepAliveRequest,
io.etcd.jetcd.api.LeaseKeepAliveResponse>(
service, METHODID_LEASE_KEEP_ALIVE)))
.addMethod(
getLeaseTimeToLiveMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
io.etcd.jetcd.api.LeaseTimeToLiveRequest,
io.etcd.jetcd.api.LeaseTimeToLiveResponse>(
service, METHODID_LEASE_TIME_TO_LIVE)))
.build();
}
private static abstract class LeaseBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
LeaseBaseDescriptorSupplier() {}
@java.lang.Override
public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
return io.etcd.jetcd.api.JetcdProto.getDescriptor();
}
@java.lang.Override
public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
return getFileDescriptor().findServiceByName("Lease");
}
}
private static final class LeaseFileDescriptorSupplier
extends LeaseBaseDescriptorSupplier {
LeaseFileDescriptorSupplier() {}
}
private static final class LeaseMethodDescriptorSupplier
extends LeaseBaseDescriptorSupplier
implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
private final java.lang.String methodName;
LeaseMethodDescriptorSupplier(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 (LeaseGrpc.class) {
result = serviceDescriptor;
if (result == null) {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new LeaseFileDescriptorSupplier())
.addMethod(getLeaseGrantMethod())
.addMethod(getLeaseRevokeMethod())
.addMethod(getLeaseKeepAliveMethod())
.addMethod(getLeaseTimeToLiveMethod())
.build();
}
}
}
return result;
}
}