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

helloworld.GreeterGrpc Maven / Gradle / Ivy

There is a newer version: 4.0.3
Show newest version
package helloworld;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.28.0)",
    comments = "Source: helloworld.proto")
public final class GreeterGrpc {

  private GreeterGrpc() {}

  public static final String SERVICE_NAME = "helloworld.Greeter";

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "SayHello",
      requestType = helloworld.Helloworld.HelloRequest.class,
      responseType = helloworld.Helloworld.HelloReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getSayHelloMethod() {
    io.grpc.MethodDescriptor getSayHelloMethod;
    if ((getSayHelloMethod = GreeterGrpc.getSayHelloMethod) == null) {
      synchronized (GreeterGrpc.class) {
        if ((getSayHelloMethod = GreeterGrpc.getSayHelloMethod) == null) {
          GreeterGrpc.getSayHelloMethod = getSayHelloMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SayHello"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  helloworld.Helloworld.HelloRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  helloworld.Helloworld.HelloReply.getDefaultInstance()))
              .setSchemaDescriptor(new GreeterMethodDescriptorSupplier("SayHello"))
              .build();
        }
      }
    }
    return getSayHelloMethod;
  }

  private static volatile io.grpc.MethodDescriptor getSayRepeatHelloMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "SayRepeatHello",
      requestType = helloworld.Helloworld.RepeatHelloRequest.class,
      responseType = helloworld.Helloworld.HelloReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
  public static io.grpc.MethodDescriptor getSayRepeatHelloMethod() {
    io.grpc.MethodDescriptor getSayRepeatHelloMethod;
    if ((getSayRepeatHelloMethod = GreeterGrpc.getSayRepeatHelloMethod) == null) {
      synchronized (GreeterGrpc.class) {
        if ((getSayRepeatHelloMethod = GreeterGrpc.getSayRepeatHelloMethod) == null) {
          GreeterGrpc.getSayRepeatHelloMethod = getSayRepeatHelloMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SayRepeatHello"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  helloworld.Helloworld.RepeatHelloRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  helloworld.Helloworld.HelloReply.getDefaultInstance()))
              .setSchemaDescriptor(new GreeterMethodDescriptorSupplier("SayRepeatHello"))
              .build();
        }
      }
    }
    return getSayRepeatHelloMethod;
  }

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

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

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

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

    /**
     * 
     * unary call
     * 
*/ public void sayHello(helloworld.Helloworld.HelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getSayHelloMethod(), responseObserver); } /** *
     * server streaming call
     * 
*/ public void sayRepeatHello(helloworld.Helloworld.RepeatHelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnimplementedUnaryCall(getSayRepeatHelloMethod(), responseObserver); } @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) .addMethod( getSayHelloMethod(), asyncUnaryCall( new MethodHandlers< helloworld.Helloworld.HelloRequest, helloworld.Helloworld.HelloReply>( this, METHODID_SAY_HELLO))) .addMethod( getSayRepeatHelloMethod(), asyncServerStreamingCall( new MethodHandlers< helloworld.Helloworld.RepeatHelloRequest, helloworld.Helloworld.HelloReply>( this, METHODID_SAY_REPEAT_HELLO))) .build(); } } /** */ public static final class GreeterStub extends io.grpc.stub.AbstractAsyncStub { private GreeterStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected GreeterStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterStub(channel, callOptions); } /** *
     * unary call
     * 
*/ public void sayHello(helloworld.Helloworld.HelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncUnaryCall( getChannel().newCall(getSayHelloMethod(), getCallOptions()), request, responseObserver); } /** *
     * server streaming call
     * 
*/ public void sayRepeatHello(helloworld.Helloworld.RepeatHelloRequest request, io.grpc.stub.StreamObserver responseObserver) { asyncServerStreamingCall( getChannel().newCall(getSayRepeatHelloMethod(), getCallOptions()), request, responseObserver); } } /** */ public static final class GreeterBlockingStub extends io.grpc.stub.AbstractBlockingStub { private GreeterBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected GreeterBlockingStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterBlockingStub(channel, callOptions); } /** *
     * unary call
     * 
*/ public helloworld.Helloworld.HelloReply sayHello(helloworld.Helloworld.HelloRequest request) { return blockingUnaryCall( getChannel(), getSayHelloMethod(), getCallOptions(), request); } /** *
     * server streaming call
     * 
*/ public java.util.Iterator sayRepeatHello( helloworld.Helloworld.RepeatHelloRequest request) { return blockingServerStreamingCall( getChannel(), getSayRepeatHelloMethod(), getCallOptions(), request); } } /** */ public static final class GreeterFutureStub extends io.grpc.stub.AbstractFutureStub { private GreeterFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected GreeterFutureStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new GreeterFutureStub(channel, callOptions); } /** *
     * unary call
     * 
*/ public com.google.common.util.concurrent.ListenableFuture sayHello( helloworld.Helloworld.HelloRequest request) { return futureUnaryCall( getChannel().newCall(getSayHelloMethod(), getCallOptions()), request); } } private static final int METHODID_SAY_HELLO = 0; private static final int METHODID_SAY_REPEAT_HELLO = 1; 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 GreeterImplBase serviceImpl; private final int methodId; MethodHandlers(GreeterImplBase 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_SAY_HELLO: serviceImpl.sayHello((helloworld.Helloworld.HelloRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_SAY_REPEAT_HELLO: serviceImpl.sayRepeatHello((helloworld.Helloworld.RepeatHelloRequest) 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(); } } } private static abstract class GreeterBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { GreeterBaseDescriptorSupplier() {} @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return helloworld.Helloworld.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("Greeter"); } } private static final class GreeterFileDescriptorSupplier extends GreeterBaseDescriptorSupplier { GreeterFileDescriptorSupplier() {} } private static final class GreeterMethodDescriptorSupplier extends GreeterBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final String methodName; GreeterMethodDescriptorSupplier(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 (GreeterGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new GreeterFileDescriptorSupplier()) .addMethod(getSayHelloMethod()) .addMethod(getSayRepeatHelloMethod()) .build(); } } } return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy