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

ai.grakn.rpc.proto.KeyspaceServiceGrpc Maven / Gradle / Ivy

The newest version!
package ai.grakn.rpc.proto;

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.2.0)",
    comments = "Source: Keyspace.proto")
public final class KeyspaceServiceGrpc {

  private KeyspaceServiceGrpc() {}

  public static final String SERVICE_NAME = "keyspace.KeyspaceService";

  // 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_CREATE =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "keyspace.KeyspaceService", "create"),
          io.grpc.protobuf.ProtoUtils.marshaller(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Req.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Res.getDefaultInstance()));
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_RETRIEVE =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "keyspace.KeyspaceService", "retrieve"),
          io.grpc.protobuf.ProtoUtils.marshaller(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Req.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Res.getDefaultInstance()));
  @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
  public static final io.grpc.MethodDescriptor METHOD_DELETE =
      io.grpc.MethodDescriptor.create(
          io.grpc.MethodDescriptor.MethodType.UNARY,
          generateFullMethodName(
              "keyspace.KeyspaceService", "delete"),
          io.grpc.protobuf.ProtoUtils.marshaller(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Req.getDefaultInstance()),
          io.grpc.protobuf.ProtoUtils.marshaller(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Res.getDefaultInstance()));

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

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

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

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

    /**
     */
    public void create(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Req request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_CREATE, responseObserver);
    }

    /**
     */
    public void retrieve(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Req request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_RETRIEVE, responseObserver);
    }

    /**
     */
    public void delete(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Req request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(METHOD_DELETE, responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            METHOD_CREATE,
            asyncUnaryCall(
              new MethodHandlers<
                ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Req,
                ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Res>(
                  this, METHODID_CREATE)))
          .addMethod(
            METHOD_RETRIEVE,
            asyncUnaryCall(
              new MethodHandlers<
                ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Req,
                ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Res>(
                  this, METHODID_RETRIEVE)))
          .addMethod(
            METHOD_DELETE,
            asyncUnaryCall(
              new MethodHandlers<
                ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Req,
                ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Res>(
                  this, METHODID_DELETE)))
          .build();
    }
  }

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

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

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

    /**
     */
    public void create(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Req request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_CREATE, getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void retrieve(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Req request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_RETRIEVE, getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void delete(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Req request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(METHOD_DELETE, getCallOptions()), request, responseObserver);
    }
  }

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

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

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

    /**
     */
    public ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Res create(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Req request) {
      return blockingUnaryCall(
          getChannel(), METHOD_CREATE, getCallOptions(), request);
    }

    /**
     */
    public ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Res retrieve(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Req request) {
      return blockingUnaryCall(
          getChannel(), METHOD_RETRIEVE, getCallOptions(), request);
    }

    /**
     */
    public ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Res delete(ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Req request) {
      return blockingUnaryCall(
          getChannel(), METHOD_DELETE, getCallOptions(), request);
    }
  }

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

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

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture create(
        ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Req request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_CREATE, getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture retrieve(
        ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Req request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_RETRIEVE, getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture delete(
        ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Req request) {
      return futureUnaryCall(
          getChannel().newCall(METHOD_DELETE, getCallOptions()), request);
    }
  }

  private static final int METHODID_CREATE = 0;
  private static final int METHODID_RETRIEVE = 1;
  private static final int METHODID_DELETE = 2;

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

    MethodHandlers(KeyspaceServiceImplBase 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_CREATE:
          serviceImpl.create((ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Create.Req) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_RETRIEVE:
          serviceImpl.retrieve((ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Retrieve.Req) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_DELETE:
          serviceImpl.delete((ai.grakn.rpc.proto.KeyspaceProto.Keyspace.Delete.Req) 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 final class KeyspaceServiceDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier {
    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return ai.grakn.rpc.proto.KeyspaceProto.getDescriptor();
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (KeyspaceServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new KeyspaceServiceDescriptorSupplier())
              .addMethod(METHOD_CREATE)
              .addMethod(METHOD_RETRIEVE)
              .addMethod(METHOD_DELETE)
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy