package edu.delaware.nlp;

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.20.0)",
    comments = "Source: rpc.proto")
public final class NlpServiceGrpc {

  private NlpServiceGrpc() {}

  public static final String SERVICE_NAME = "udelnlp.NlpService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.Request,
      edu.delaware.nlp.RpcProto.Response> getProcessDocumentMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "ProcessDocument",
      requestType = edu.delaware.nlp.RpcProto.Request.class,
      responseType = edu.delaware.nlp.RpcProto.Response.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.Request,
      edu.delaware.nlp.RpcProto.Response> getProcessDocumentMethod() {
    io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.Request, edu.delaware.nlp.RpcProto.Response> getProcessDocumentMethod;
    if ((getProcessDocumentMethod = NlpServiceGrpc.getProcessDocumentMethod) == null) {
      synchronized (NlpServiceGrpc.class) {
        if ((getProcessDocumentMethod = NlpServiceGrpc.getProcessDocumentMethod) == null) {
          NlpServiceGrpc.getProcessDocumentMethod = getProcessDocumentMethod = 
              io.grpc.MethodDescriptor.<edu.delaware.nlp.RpcProto.Request, edu.delaware.nlp.RpcProto.Response>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(
                  "udelnlp.NlpService", "ProcessDocument"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  edu.delaware.nlp.RpcProto.Request.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  edu.delaware.nlp.RpcProto.Response.getDefaultInstance()))
                  .setSchemaDescriptor(new NlpServiceMethodDescriptorSupplier("ProcessDocument"))
                  .build();
          }
        }
     }
     return getProcessDocumentMethod;
  }

  private static volatile io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.EdgRequest,
      edu.delaware.nlp.RpcProto.Response> getEdgProcessDocumentMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "EdgProcessDocument",
      requestType = edu.delaware.nlp.RpcProto.EdgRequest.class,
      responseType = edu.delaware.nlp.RpcProto.Response.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.EdgRequest,
      edu.delaware.nlp.RpcProto.Response> getEdgProcessDocumentMethod() {
    io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.EdgRequest, edu.delaware.nlp.RpcProto.Response> getEdgProcessDocumentMethod;
    if ((getEdgProcessDocumentMethod = NlpServiceGrpc.getEdgProcessDocumentMethod) == null) {
      synchronized (NlpServiceGrpc.class) {
        if ((getEdgProcessDocumentMethod = NlpServiceGrpc.getEdgProcessDocumentMethod) == null) {
          NlpServiceGrpc.getEdgProcessDocumentMethod = getEdgProcessDocumentMethod = 
              io.grpc.MethodDescriptor.<edu.delaware.nlp.RpcProto.EdgRequest, edu.delaware.nlp.RpcProto.Response>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(
                  "udelnlp.NlpService", "EdgProcessDocument"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  edu.delaware.nlp.RpcProto.EdgRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  edu.delaware.nlp.RpcProto.Response.getDefaultInstance()))
                  .setSchemaDescriptor(new NlpServiceMethodDescriptorSupplier("EdgProcessDocument"))
                  .build();
          }
        }
     }
     return getEdgProcessDocumentMethod;
  }

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

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

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

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

    /**
     */
    public void processDocument(edu.delaware.nlp.RpcProto.Request request,
        io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.Response> responseObserver) {
      asyncUnimplementedUnaryCall(getProcessDocumentMethod(), responseObserver);
    }

    /**
     */
    public void edgProcessDocument(edu.delaware.nlp.RpcProto.EdgRequest request,
        io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.Response> responseObserver) {
      asyncUnimplementedUnaryCall(getEdgProcessDocumentMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getProcessDocumentMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                edu.delaware.nlp.RpcProto.Request,
                edu.delaware.nlp.RpcProto.Response>(
                  this, METHODID_PROCESS_DOCUMENT)))
          .addMethod(
            getEdgProcessDocumentMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                edu.delaware.nlp.RpcProto.EdgRequest,
                edu.delaware.nlp.RpcProto.Response>(
                  this, METHODID_EDG_PROCESS_DOCUMENT)))
          .build();
    }
  }

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

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

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

    /**
     */
    public void processDocument(edu.delaware.nlp.RpcProto.Request request,
        io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.Response> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void edgProcessDocument(edu.delaware.nlp.RpcProto.EdgRequest request,
        io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.Response> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getEdgProcessDocumentMethod(), getCallOptions()), request, responseObserver);
    }
  }

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

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

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

    /**
     */
    public edu.delaware.nlp.RpcProto.Response processDocument(edu.delaware.nlp.RpcProto.Request request) {
      return blockingUnaryCall(
          getChannel(), getProcessDocumentMethod(), getCallOptions(), request);
    }

    /**
     */
    public edu.delaware.nlp.RpcProto.Response edgProcessDocument(edu.delaware.nlp.RpcProto.EdgRequest request) {
      return blockingUnaryCall(
          getChannel(), getEdgProcessDocumentMethod(), getCallOptions(), request);
    }
  }

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

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

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<edu.delaware.nlp.RpcProto.Response> processDocument(
        edu.delaware.nlp.RpcProto.Request request) {
      return futureUnaryCall(
          getChannel().newCall(getProcessDocumentMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<edu.delaware.nlp.RpcProto.Response> edgProcessDocument(
        edu.delaware.nlp.RpcProto.EdgRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getEdgProcessDocumentMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_PROCESS_DOCUMENT = 0;
  private static final int METHODID_EDG_PROCESS_DOCUMENT = 1;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final NlpServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(NlpServiceImplBase 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<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_PROCESS_DOCUMENT:
          serviceImpl.processDocument((edu.delaware.nlp.RpcProto.Request) request,
              (io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.Response>) responseObserver);
          break;
        case METHODID_EDG_PROCESS_DOCUMENT:
          serviceImpl.edgProcessDocument((edu.delaware.nlp.RpcProto.EdgRequest) request,
              (io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.Response>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

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

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return edu.delaware.nlp.RpcProto.getDescriptor();
    }

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

  private static final class NlpServiceFileDescriptorSupplier
      extends NlpServiceBaseDescriptorSupplier {
    NlpServiceFileDescriptorSupplier() {}
  }

  private static final class NlpServiceMethodDescriptorSupplier
      extends NlpServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    NlpServiceMethodDescriptorSupplier(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 (NlpServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new NlpServiceFileDescriptorSupplier())
              .addMethod(getProcessDocumentMethod())
              .addMethod(getEdgProcessDocumentMethod())
              .build();
        }
      }
    }
    return result;
  }
}
