All Downloads are FREE. Search and download functionalities are using the official Maven repository.

etcdserverpb.LeaseGrpc Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
package etcdserverpb;

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;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.7.0)",
    comments = "Source: etcd/etcdserver/etcdserverpb/rpc.proto")
public final class LeaseGrpc {

  private LeaseGrpc() {}

  public static final String SERVICE_NAME = "etcdserverpb.Lease";

  // 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_LEASE_GRANT =
      io.grpc.MethodDescriptor.newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "etcdserverpb.Lease", "LeaseGrant"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseGrantRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseGrantResponse.getDefaultInstance()))
          .setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseGrant"))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_LEASE_REVOKE =
      io.grpc.MethodDescriptor.newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "etcdserverpb.Lease", "LeaseRevoke"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseRevokeRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseRevokeResponse.getDefaultInstance()))
          .setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseRevoke"))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_LEASE_KEEP_ALIVE =
      io.grpc.MethodDescriptor.newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
          .setFullMethodName(generateFullMethodName(
              "etcdserverpb.Lease", "LeaseKeepAlive"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseKeepAliveRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseKeepAliveResponse.getDefaultInstance()))
          .setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseKeepAlive"))
          .build();
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_LEASE_TIME_TO_LIVE =
      io.grpc.MethodDescriptor.newBuilder()
          .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
          .setFullMethodName(generateFullMethodName(
              "etcdserverpb.Lease", "LeaseTimeToLive"))
          .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseTimeToLiveRequest.getDefaultInstance()))
          .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
              etcdserverpb.Rpc.LeaseTimeToLiveResponse.getDefaultInstance()))
          .setSchemaDescriptor(new LeaseMethodDescriptorSupplier("LeaseTimeToLive"))
          .build();

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static LeaseStub newStub(io.grpc.Channel channel) {
    return new LeaseStub(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) {
    return new LeaseBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static LeaseFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new LeaseFutureStub(channel);
  }

  /**
   */
  public static abstract class LeaseImplBase implements io.grpc.BindableService {

    /**
     * 
     * 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(etcdserverpb.Rpc.LeaseGrantRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_LEASE_GRANT, responseObserver); } /** *
     * LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
     * 
*/ public void leaseRevoke(etcdserverpb.Rpc.LeaseRevokeRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_LEASE_REVOKE, 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 asyncUnimplementedStreamingCall(METHOD_LEASE_KEEP_ALIVE, responseObserver); } /** *
     * LeaseTimeToLive retrieves lease information.
     * 
*/ public void leaseTimeToLive(etcdserverpb.Rpc.LeaseTimeToLiveRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(METHOD_LEASE_TIME_TO_LIVE, responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( METHOD_LEASE_GRANT, asyncUnaryCall( new MethodHandlers< etcdserverpb.Rpc.LeaseGrantRequest, etcdserverpb.Rpc.LeaseGrantResponse>( this, METHODID_LEASE_GRANT))) .addMethod( METHOD_LEASE_REVOKE, asyncUnaryCall( new MethodHandlers< etcdserverpb.Rpc.LeaseRevokeRequest, etcdserverpb.Rpc.LeaseRevokeResponse>( this, METHODID_LEASE_REVOKE))) .addMethod( METHOD_LEASE_KEEP_ALIVE, asyncBidiStreamingCall( new MethodHandlers< etcdserverpb.Rpc.LeaseKeepAliveRequest, etcdserverpb.Rpc.LeaseKeepAliveResponse>( this, METHODID_LEASE_KEEP_ALIVE))) .addMethod( METHOD_LEASE_TIME_TO_LIVE, asyncUnaryCall( new MethodHandlers< etcdserverpb.Rpc.LeaseTimeToLiveRequest, etcdserverpb.Rpc.LeaseTimeToLiveResponse>( this, METHODID_LEASE_TIME_TO_LIVE))) .build(); } } /** */ public static final class LeaseStub extends io.grpc.stub.AbstractStub { private LeaseStub(io.grpc.Channel channel) { super(channel); } 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(etcdserverpb.Rpc.LeaseGrantRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_LEASE_GRANT, getCallOptions()), request, responseObserver); } /** *
     * LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
     * 
*/ public void leaseRevoke(etcdserverpb.Rpc.LeaseRevokeRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_LEASE_REVOKE, 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 asyncBidiStreamingCall( getChannel().newCall(METHOD_LEASE_KEEP_ALIVE, getCallOptions()), responseObserver); } /** *
     * LeaseTimeToLive retrieves lease information.
     * 
*/ public void leaseTimeToLive(etcdserverpb.Rpc.LeaseTimeToLiveRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(METHOD_LEASE_TIME_TO_LIVE, getCallOptions()), request, responseObserver); } } /** */ public static final class LeaseBlockingStub extends io.grpc.stub.AbstractStub { private LeaseBlockingStub(io.grpc.Channel channel) { super(channel); } 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 etcdserverpb.Rpc.LeaseGrantResponse leaseGrant(etcdserverpb.Rpc.LeaseGrantRequest request) { return blockingUnaryCall( getChannel(), METHOD_LEASE_GRANT, getCallOptions(), request); } /** *
     * LeaseRevoke revokes a lease. All keys attached to the lease will expire and be deleted.
     * 
*/ public etcdserverpb.Rpc.LeaseRevokeResponse leaseRevoke(etcdserverpb.Rpc.LeaseRevokeRequest request) { return blockingUnaryCall( getChannel(), METHOD_LEASE_REVOKE, getCallOptions(), request); } /** *
     * LeaseTimeToLive retrieves lease information.
     * 
*/ public etcdserverpb.Rpc.LeaseTimeToLiveResponse leaseTimeToLive(etcdserverpb.Rpc.LeaseTimeToLiveRequest request) { return blockingUnaryCall( getChannel(), METHOD_LEASE_TIME_TO_LIVE, getCallOptions(), request); } } /** */ public static final class LeaseFutureStub extends io.grpc.stub.AbstractStub { private LeaseFutureStub(io.grpc.Channel channel) { super(channel); } 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( etcdserverpb.Rpc.LeaseGrantRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_LEASE_GRANT, 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( etcdserverpb.Rpc.LeaseRevokeRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_LEASE_REVOKE, getCallOptions()), request); } /** *
     * LeaseTimeToLive retrieves lease information.
     * 
*/ public com.google.common.util.concurrent.ListenableFuture leaseTimeToLive( etcdserverpb.Rpc.LeaseTimeToLiveRequest request) { return futureUnaryCall( getChannel().newCall(METHOD_LEASE_TIME_TO_LIVE, 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 LeaseImplBase serviceImpl; private final int methodId; MethodHandlers(LeaseImplBase 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((etcdserverpb.Rpc.LeaseGrantRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_LEASE_REVOKE: serviceImpl.leaseRevoke((etcdserverpb.Rpc.LeaseRevokeRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_LEASE_TIME_TO_LIVE: serviceImpl.leaseTimeToLive((etcdserverpb.Rpc.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(); } } } 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 etcdserverpb.Rpc.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 String methodName; LeaseMethodDescriptorSupplier(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(METHOD_LEASE_GRANT) .addMethod(METHOD_LEASE_REVOKE) .addMethod(METHOD_LEASE_KEEP_ALIVE) .addMethod(METHOD_LEASE_TIME_TO_LIVE) .build(); } } } return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy