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

function.MessageFunctionGrpc Maven / Gradle / Ivy

package function;

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.8.0)",
    comments = "Source: function.proto")
public final class MessageFunctionGrpc {

  private MessageFunctionGrpc() {}

  public static final String SERVICE_NAME = "function.MessageFunction";

  // Static method descriptors that strictly reflect the proto.
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  @java.lang.Deprecated // Use {@link #getCallMethod()} instead. 
  public static final io.grpc.MethodDescriptor METHOD_CALL = getCallMethod();

  private static volatile io.grpc.MethodDescriptor getCallMethod;

  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static io.grpc.MethodDescriptor getCallMethod() {
    io.grpc.MethodDescriptor getCallMethod;
    if ((getCallMethod = MessageFunctionGrpc.getCallMethod) == null) {
      synchronized (MessageFunctionGrpc.class) {
        if ((getCallMethod = MessageFunctionGrpc.getCallMethod) == null) {
          MessageFunctionGrpc.getCallMethod = getCallMethod = 
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(
                  "function.MessageFunction", "Call"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  function.Function.Message.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  function.Function.Message.getDefaultInstance()))
                  .setSchemaDescriptor(new MessageFunctionMethodDescriptorSupplier("Call"))
                  .build();
          }
        }
     }
     return getCallMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static MessageFunctionStub newStub(io.grpc.Channel channel) {
    return new MessageFunctionStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static MessageFunctionBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new MessageFunctionBlockingStub(channel);
  }

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

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

    /**
     */
    public io.grpc.stub.StreamObserver call(
        io.grpc.stub.StreamObserver responseObserver) {
      return asyncUnimplementedStreamingCall(getCallMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getCallMethod(),
            asyncBidiStreamingCall(
              new MethodHandlers<
                function.Function.Message,
                function.Function.Message>(
                  this, METHODID_CALL)))
          .build();
    }
  }

  /**
   */
  public static final class MessageFunctionStub extends io.grpc.stub.AbstractStub {
    private MessageFunctionStub(io.grpc.Channel channel) {
      super(channel);
    }

    private MessageFunctionStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected MessageFunctionStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new MessageFunctionStub(channel, callOptions);
    }

    /**
     */
    public io.grpc.stub.StreamObserver call(
        io.grpc.stub.StreamObserver responseObserver) {
      return asyncBidiStreamingCall(
          getChannel().newCall(getCallMethod(), getCallOptions()), responseObserver);
    }
  }

  /**
   */
  public static final class MessageFunctionBlockingStub extends io.grpc.stub.AbstractStub {
    private MessageFunctionBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

    private MessageFunctionBlockingStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected MessageFunctionBlockingStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new MessageFunctionBlockingStub(channel, callOptions);
    }
  }

  /**
   */
  public static final class MessageFunctionFutureStub extends io.grpc.stub.AbstractStub {
    private MessageFunctionFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

    private MessageFunctionFutureStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected MessageFunctionFutureStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new MessageFunctionFutureStub(channel, callOptions);
    }
  }

  private static final int METHODID_CALL = 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 MessageFunctionImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(MessageFunctionImplBase 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_CALL:
          return (io.grpc.stub.StreamObserver) serviceImpl.call(
              (io.grpc.stub.StreamObserver) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class MessageFunctionBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    MessageFunctionBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return function.Function.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("MessageFunction");
    }
  }

  private static final class MessageFunctionFileDescriptorSupplier
      extends MessageFunctionBaseDescriptorSupplier {
    MessageFunctionFileDescriptorSupplier() {}
  }

  private static final class MessageFunctionMethodDescriptorSupplier
      extends MessageFunctionBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    MessageFunctionMethodDescriptorSupplier(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 (MessageFunctionGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new MessageFunctionFileDescriptorSupplier())
              .addMethod(getCallMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy