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 BllipParserGrpc {

  private BllipParserGrpc() {}

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

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Parse",
      requestType = edu.delaware.nlp.RpcProto.BllipParserRequest.class,
      responseType = edu.delaware.nlp.RpcProto.BllipParserResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.BllipParserRequest,
      edu.delaware.nlp.RpcProto.BllipParserResponse> getParseMethod() {
    io.grpc.MethodDescriptor<edu.delaware.nlp.RpcProto.BllipParserRequest, edu.delaware.nlp.RpcProto.BllipParserResponse> getParseMethod;
    if ((getParseMethod = BllipParserGrpc.getParseMethod) == null) {
      synchronized (BllipParserGrpc.class) {
        if ((getParseMethod = BllipParserGrpc.getParseMethod) == null) {
          BllipParserGrpc.getParseMethod = getParseMethod = 
              io.grpc.MethodDescriptor.<edu.delaware.nlp.RpcProto.BllipParserRequest, edu.delaware.nlp.RpcProto.BllipParserResponse>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(
                  "udelnlp.BllipParser", "Parse"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  edu.delaware.nlp.RpcProto.BllipParserRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  edu.delaware.nlp.RpcProto.BllipParserResponse.getDefaultInstance()))
                  .setSchemaDescriptor(new BllipParserMethodDescriptorSupplier("Parse"))
                  .build();
          }
        }
     }
     return getParseMethod;
  }

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

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

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

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

    /**
     */
    public void parse(edu.delaware.nlp.RpcProto.BllipParserRequest request,
        io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.BllipParserResponse> responseObserver) {
      asyncUnimplementedUnaryCall(getParseMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getParseMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                edu.delaware.nlp.RpcProto.BllipParserRequest,
                edu.delaware.nlp.RpcProto.BllipParserResponse>(
                  this, METHODID_PARSE)))
          .build();
    }
  }

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

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

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

    /**
     */
    public void parse(edu.delaware.nlp.RpcProto.BllipParserRequest request,
        io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.BllipParserResponse> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getParseMethod(), getCallOptions()), request, responseObserver);
    }
  }

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

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

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

    /**
     */
    public edu.delaware.nlp.RpcProto.BllipParserResponse parse(edu.delaware.nlp.RpcProto.BllipParserRequest request) {
      return blockingUnaryCall(
          getChannel(), getParseMethod(), getCallOptions(), request);
    }
  }

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

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

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<edu.delaware.nlp.RpcProto.BllipParserResponse> parse(
        edu.delaware.nlp.RpcProto.BllipParserRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getParseMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_PARSE = 0;

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

    MethodHandlers(BllipParserImplBase 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_PARSE:
          serviceImpl.parse((edu.delaware.nlp.RpcProto.BllipParserRequest) request,
              (io.grpc.stub.StreamObserver<edu.delaware.nlp.RpcProto.BllipParserResponse>) 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 BllipParserBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    BllipParserBaseDescriptorSupplier() {}

    @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("BllipParser");
    }
  }

  private static final class BllipParserFileDescriptorSupplier
      extends BllipParserBaseDescriptorSupplier {
    BllipParserFileDescriptorSupplier() {}
  }

  private static final class BllipParserMethodDescriptorSupplier
      extends BllipParserBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    BllipParserMethodDescriptorSupplier(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 (BllipParserGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new BllipParserFileDescriptorSupplier())
              .addMethod(getParseMethod())
              .build();
        }
      }
    }
    return result;
  }
}
