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

io.grpc.alts.internal.HandshakerServiceGrpc Maven / Gradle / Ivy

There is a newer version: 1.68.1
Show newest version
package io.grpc.alts.internal;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler",
    comments = "Source: grpc/gcp/handshaker.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class HandshakerServiceGrpc {

  private HandshakerServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "grpc.gcp.HandshakerService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor getDoHandshakeMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "DoHandshake",
      requestType = io.grpc.alts.internal.HandshakerReq.class,
      responseType = io.grpc.alts.internal.HandshakerResp.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor getDoHandshakeMethod() {
    io.grpc.MethodDescriptor getDoHandshakeMethod;
    if ((getDoHandshakeMethod = HandshakerServiceGrpc.getDoHandshakeMethod) == null) {
      synchronized (HandshakerServiceGrpc.class) {
        if ((getDoHandshakeMethod = HandshakerServiceGrpc.getDoHandshakeMethod) == null) {
          HandshakerServiceGrpc.getDoHandshakeMethod = getDoHandshakeMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DoHandshake"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.grpc.alts.internal.HandshakerReq.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.grpc.alts.internal.HandshakerResp.getDefaultInstance()))
              .setSchemaDescriptor(new HandshakerServiceMethodDescriptorSupplier("DoHandshake"))
              .build();
        }
      }
    }
    return getDoHandshakeMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static HandshakerServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public HandshakerServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new HandshakerServiceStub(channel, callOptions);
        }
      };
    return HandshakerServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static HandshakerServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public HandshakerServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new HandshakerServiceBlockingStub(channel, callOptions);
        }
      };
    return HandshakerServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static HandshakerServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public HandshakerServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new HandshakerServiceFutureStub(channel, callOptions);
        }
      };
    return HandshakerServiceFutureStub.newStub(factory, channel);
  }

  /**
   */
  public interface AsyncService {

    /**
     * 
     * Handshaker service accepts a stream of handshaker request, returning a
     * stream of handshaker response. Client is expected to send exactly one
     * message with either client_start or server_start followed by one or more
     * messages with next. Each time client sends a request, the handshaker
     * service expects to respond. Client does not have to wait for service's
     * response before sending next request.
     * 
*/ default io.grpc.stub.StreamObserver doHandshake( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getDoHandshakeMethod(), responseObserver); } } /** * Base class for the server implementation of the service HandshakerService. */ public static abstract class HandshakerServiceImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return HandshakerServiceGrpc.bindService(this); } } /** * A stub to allow clients to do asynchronous rpc calls to service HandshakerService. */ public static final class HandshakerServiceStub extends io.grpc.stub.AbstractAsyncStub { private HandshakerServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected HandshakerServiceStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new HandshakerServiceStub(channel, callOptions); } /** *
     * Handshaker service accepts a stream of handshaker request, returning a
     * stream of handshaker response. Client is expected to send exactly one
     * message with either client_start or server_start followed by one or more
     * messages with next. Each time client sends a request, the handshaker
     * service expects to respond. Client does not have to wait for service's
     * response before sending next request.
     * 
*/ public io.grpc.stub.StreamObserver doHandshake( io.grpc.stub.StreamObserver responseObserver) { return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( getChannel().newCall(getDoHandshakeMethod(), getCallOptions()), responseObserver); } } /** * A stub to allow clients to do synchronous rpc calls to service HandshakerService. */ public static final class HandshakerServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { private HandshakerServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected HandshakerServiceBlockingStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new HandshakerServiceBlockingStub(channel, callOptions); } } /** * A stub to allow clients to do ListenableFuture-style rpc calls to service HandshakerService. */ public static final class HandshakerServiceFutureStub extends io.grpc.stub.AbstractFutureStub { private HandshakerServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected HandshakerServiceFutureStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new HandshakerServiceFutureStub(channel, callOptions); } } private static final int METHODID_DO_HANDSHAKE = 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 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) { 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_DO_HANDSHAKE: return (io.grpc.stub.StreamObserver) serviceImpl.doHandshake( (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( getDoHandshakeMethod(), io.grpc.stub.ServerCalls.asyncBidiStreamingCall( new MethodHandlers< io.grpc.alts.internal.HandshakerReq, io.grpc.alts.internal.HandshakerResp>( service, METHODID_DO_HANDSHAKE))) .build(); } private static abstract class HandshakerServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { HandshakerServiceBaseDescriptorSupplier() {} @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return io.grpc.alts.internal.HandshakerProto.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("HandshakerService"); } } private static final class HandshakerServiceFileDescriptorSupplier extends HandshakerServiceBaseDescriptorSupplier { HandshakerServiceFileDescriptorSupplier() {} } private static final class HandshakerServiceMethodDescriptorSupplier extends HandshakerServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final java.lang.String methodName; HandshakerServiceMethodDescriptorSupplier(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 (HandshakerServiceGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new HandshakerServiceFileDescriptorSupplier()) .addMethod(getDoHandshakeMethod()) .build(); } } } return result; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy