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

io.seldon.protos.GenericGrpc Maven / Gradle / Ivy

package io.seldon.protos;

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.0.0)",
    comments = "Source: prediction.proto")
public class GenericGrpc {

  private GenericGrpc() {}

  public static final String SERVICE_NAME = "seldon.protos.Generic";

  // 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_TRANSFORM_INPUT =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "seldon.protos.Generic", "TransformInput"),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()));
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_TRANSFORM_OUTPUT =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "seldon.protos.Generic", "TransformOutput"),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()));
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_ROUTE =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "seldon.protos.Generic", "Route"),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()));
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_AGGREGATE =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "seldon.protos.Generic", "Aggregate"),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessageList.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()));
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_SEND_FEEDBACK =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "seldon.protos.Generic", "SendFeedback"),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.Feedback.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(io.seldon.protos.PredictionProtos.SeldonMessage.getDefaultInstance()));

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

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

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

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

    /**
     */
    public void transformInput(io.seldon.protos.PredictionProtos.SeldonMessage request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_TRANSFORM_INPUT, responseObserver);
    }

    /**
     */
    public void transformOutput(io.seldon.protos.PredictionProtos.SeldonMessage request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_TRANSFORM_OUTPUT, responseObserver);
    }

    /**
     */
    public void route(io.seldon.protos.PredictionProtos.SeldonMessage request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_ROUTE, responseObserver);
    }

    /**
     */
    public void aggregate(io.seldon.protos.PredictionProtos.SeldonMessageList request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_AGGREGATE, responseObserver);
    }

    /**
     */
    public void sendFeedback(io.seldon.protos.PredictionProtos.Feedback request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_SEND_FEEDBACK, responseObserver);
    }

    @java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            METHOD_TRANSFORM_INPUT,
            asyncUnaryCall(
              new MethodHandlers<
                io.seldon.protos.PredictionProtos.SeldonMessage,
                io.seldon.protos.PredictionProtos.SeldonMessage>(
                  this, METHODID_TRANSFORM_INPUT)))
          .addMethod(
            METHOD_TRANSFORM_OUTPUT,
            asyncUnaryCall(
              new MethodHandlers<
                io.seldon.protos.PredictionProtos.SeldonMessage,
                io.seldon.protos.PredictionProtos.SeldonMessage>(
                  this, METHODID_TRANSFORM_OUTPUT)))
          .addMethod(
            METHOD_ROUTE,
            asyncUnaryCall(
              new MethodHandlers<
                io.seldon.protos.PredictionProtos.SeldonMessage,
                io.seldon.protos.PredictionProtos.SeldonMessage>(
                  this, METHODID_ROUTE)))
          .addMethod(
            METHOD_AGGREGATE,
            asyncUnaryCall(
              new MethodHandlers<
                io.seldon.protos.PredictionProtos.SeldonMessageList,
                io.seldon.protos.PredictionProtos.SeldonMessage>(
                  this, METHODID_AGGREGATE)))
          .addMethod(
            METHOD_SEND_FEEDBACK,
            asyncUnaryCall(
              new MethodHandlers<
                io.seldon.protos.PredictionProtos.Feedback,
                io.seldon.protos.PredictionProtos.SeldonMessage>(
                  this, METHODID_SEND_FEEDBACK)))
          .build();
    }
  }

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

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

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

    /**
     */
    public void transformInput(io.seldon.protos.PredictionProtos.SeldonMessage request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_TRANSFORM_INPUT, getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void transformOutput(io.seldon.protos.PredictionProtos.SeldonMessage request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_TRANSFORM_OUTPUT, getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void route(io.seldon.protos.PredictionProtos.SeldonMessage request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_ROUTE, getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void aggregate(io.seldon.protos.PredictionProtos.SeldonMessageList request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_AGGREGATE, getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void sendFeedback(io.seldon.protos.PredictionProtos.Feedback request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_SEND_FEEDBACK, getCallOptions()), request, responseObserver);
    }
  }

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

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

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

    /**
     */
    public io.seldon.protos.PredictionProtos.SeldonMessage transformInput(io.seldon.protos.PredictionProtos.SeldonMessage request) {
      return blockingUnaryCall(
          getChannel(), METHOD_TRANSFORM_INPUT, getCallOptions(), request);
    }

    /**
     */
    public io.seldon.protos.PredictionProtos.SeldonMessage transformOutput(io.seldon.protos.PredictionProtos.SeldonMessage request) {
      return blockingUnaryCall(
          getChannel(), METHOD_TRANSFORM_OUTPUT, getCallOptions(), request);
    }

    /**
     */
    public io.seldon.protos.PredictionProtos.SeldonMessage route(io.seldon.protos.PredictionProtos.SeldonMessage request) {
      return blockingUnaryCall(
          getChannel(), METHOD_ROUTE, getCallOptions(), request);
    }

    /**
     */
    public io.seldon.protos.PredictionProtos.SeldonMessage aggregate(io.seldon.protos.PredictionProtos.SeldonMessageList request) {
      return blockingUnaryCall(
          getChannel(), METHOD_AGGREGATE, getCallOptions(), request);
    }

    /**
     */
    public io.seldon.protos.PredictionProtos.SeldonMessage sendFeedback(io.seldon.protos.PredictionProtos.Feedback request) {
      return blockingUnaryCall(
          getChannel(), METHOD_SEND_FEEDBACK, getCallOptions(), request);
    }
  }

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

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

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture transformInput(
        io.seldon.protos.PredictionProtos.SeldonMessage request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_TRANSFORM_INPUT, getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture transformOutput(
        io.seldon.protos.PredictionProtos.SeldonMessage request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_TRANSFORM_OUTPUT, getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture route(
        io.seldon.protos.PredictionProtos.SeldonMessage request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_ROUTE, getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture aggregate(
        io.seldon.protos.PredictionProtos.SeldonMessageList request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_AGGREGATE, getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture sendFeedback(
        io.seldon.protos.PredictionProtos.Feedback request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_SEND_FEEDBACK, getCallOptions()), request);
    }
  }

  private static final int METHODID_TRANSFORM_INPUT = 0;
  private static final int METHODID_TRANSFORM_OUTPUT = 1;
  private static final int METHODID_ROUTE = 2;
  private static final int METHODID_AGGREGATE = 3;
  private static final int METHODID_SEND_FEEDBACK = 4;

  private static 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 GenericImplBase serviceImpl;
    private final int methodId;

    public MethodHandlers(GenericImplBase 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_TRANSFORM_INPUT:
          serviceImpl.transformInput((io.seldon.protos.PredictionProtos.SeldonMessage) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_TRANSFORM_OUTPUT:
          serviceImpl.transformOutput((io.seldon.protos.PredictionProtos.SeldonMessage) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_ROUTE:
          serviceImpl.route((io.seldon.protos.PredictionProtos.SeldonMessage) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_AGGREGATE:
          serviceImpl.aggregate((io.seldon.protos.PredictionProtos.SeldonMessageList) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_SEND_FEEDBACK:
          serviceImpl.sendFeedback((io.seldon.protos.PredictionProtos.Feedback) 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();
      }
    }
  }

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    return new io.grpc.ServiceDescriptor(SERVICE_NAME,
        METHOD_TRANSFORM_INPUT,
        METHOD_TRANSFORM_OUTPUT,
        METHOD_ROUTE,
        METHOD_AGGREGATE,
        METHOD_SEND_FEEDBACK);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy