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

com.github.tjake.jlama.net.JlamaServiceGrpc Maven / Gradle / Ivy

package com.github.tjake.jlama.net;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.53.0)",
    comments = "Source: JlamaService.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class JlamaServiceGrpc {

  private JlamaServiceGrpc() {}

  public static final String SERVICE_NAME = "com.github.tjake.jlama.net.JlamaService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor getRegisterMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "register",
      requestType = com.github.tjake.jlama.net.RegisterRequest.class,
      responseType = com.github.tjake.jlama.net.RegisterResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getRegisterMethod() {
    io.grpc.MethodDescriptor getRegisterMethod;
    if ((getRegisterMethod = JlamaServiceGrpc.getRegisterMethod) == null) {
      synchronized (JlamaServiceGrpc.class) {
        if ((getRegisterMethod = JlamaServiceGrpc.getRegisterMethod) == null) {
          JlamaServiceGrpc.getRegisterMethod = getRegisterMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "register"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.github.tjake.jlama.net.RegisterRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.github.tjake.jlama.net.RegisterResponse.getDefaultInstance()))
              .setSchemaDescriptor(new JlamaServiceMethodDescriptorSupplier("register"))
              .build();
        }
      }
    }
    return getRegisterMethod;
  }

  private static volatile io.grpc.MethodDescriptor getGenerateMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "generate",
      requestType = com.github.tjake.jlama.net.GenerateRequest.class,
      responseType = com.github.tjake.jlama.net.GenerateResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor getGenerateMethod() {
    io.grpc.MethodDescriptor getGenerateMethod;
    if ((getGenerateMethod = JlamaServiceGrpc.getGenerateMethod) == null) {
      synchronized (JlamaServiceGrpc.class) {
        if ((getGenerateMethod = JlamaServiceGrpc.getGenerateMethod) == null) {
          JlamaServiceGrpc.getGenerateMethod = getGenerateMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "generate"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.github.tjake.jlama.net.GenerateRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.github.tjake.jlama.net.GenerateResponse.getDefaultInstance()))
              .setSchemaDescriptor(new JlamaServiceMethodDescriptorSupplier("generate"))
              .build();
        }
      }
    }
    return getGenerateMethod;
  }

  private static volatile io.grpc.MethodDescriptor getCombineMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "combine",
      requestType = com.github.tjake.jlama.net.CombineRequest.class,
      responseType = com.github.tjake.jlama.net.CombineResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
  public static io.grpc.MethodDescriptor getCombineMethod() {
    io.grpc.MethodDescriptor getCombineMethod;
    if ((getCombineMethod = JlamaServiceGrpc.getCombineMethod) == null) {
      synchronized (JlamaServiceGrpc.class) {
        if ((getCombineMethod = JlamaServiceGrpc.getCombineMethod) == null) {
          JlamaServiceGrpc.getCombineMethod = getCombineMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "combine"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.github.tjake.jlama.net.CombineRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.github.tjake.jlama.net.CombineResponse.getDefaultInstance()))
              .setSchemaDescriptor(new JlamaServiceMethodDescriptorSupplier("combine"))
              .build();
        }
      }
    }
    return getCombineMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static JlamaServiceStub newStub(io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public JlamaServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new JlamaServiceStub(channel, callOptions);
        }
      };
    return JlamaServiceStub.newStub(factory, channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static JlamaServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public JlamaServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new JlamaServiceBlockingStub(channel, callOptions);
        }
      };
    return JlamaServiceBlockingStub.newStub(factory, channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static JlamaServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    io.grpc.stub.AbstractStub.StubFactory factory =
      new io.grpc.stub.AbstractStub.StubFactory() {
        @java.lang.Override
        public JlamaServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
          return new JlamaServiceFutureStub(channel, callOptions);
        }
      };
    return JlamaServiceFutureStub.newStub(factory, channel);
  }

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

    /**
     */
    public void register(com.github.tjake.jlama.net.RegisterRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRegisterMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver generate(
        io.grpc.stub.StreamObserver responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getGenerateMethod(), responseObserver);
    }

    /**
     */
    public io.grpc.stub.StreamObserver combine(
        io.grpc.stub.StreamObserver responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getCombineMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getRegisterMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                com.github.tjake.jlama.net.RegisterRequest,
                com.github.tjake.jlama.net.RegisterResponse>(
                  this, METHODID_REGISTER)))
          .addMethod(
            getGenerateMethod(),
            io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
              new MethodHandlers<
                com.github.tjake.jlama.net.GenerateRequest,
                com.github.tjake.jlama.net.GenerateResponse>(
                  this, METHODID_GENERATE)))
          .addMethod(
            getCombineMethod(),
            io.grpc.stub.ServerCalls.asyncBidiStreamingCall(
              new MethodHandlers<
                com.github.tjake.jlama.net.CombineRequest,
                com.github.tjake.jlama.net.CombineResponse>(
                  this, METHODID_COMBINE)))
          .build();
    }
  }

  /**
   */
  public static final class JlamaServiceStub extends io.grpc.stub.AbstractAsyncStub {
    private JlamaServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public void register(com.github.tjake.jlama.net.RegisterRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getRegisterMethod(), getCallOptions()), request, responseObserver);
    }

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

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

  /**
   */
  public static final class JlamaServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub {
    private JlamaServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public com.github.tjake.jlama.net.RegisterResponse register(com.github.tjake.jlama.net.RegisterRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getRegisterMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class JlamaServiceFutureStub extends io.grpc.stub.AbstractFutureStub {
    private JlamaServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture register(
        com.github.tjake.jlama.net.RegisterRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getRegisterMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_REGISTER = 0;
  private static final int METHODID_GENERATE = 1;
  private static final int METHODID_COMBINE = 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 JlamaServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(JlamaServiceImplBase 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_REGISTER:
          serviceImpl.register((com.github.tjake.jlama.net.RegisterRequest) 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) {
        case METHODID_GENERATE:
          return (io.grpc.stub.StreamObserver) serviceImpl.generate(
              (io.grpc.stub.StreamObserver) responseObserver);
        case METHODID_COMBINE:
          return (io.grpc.stub.StreamObserver) serviceImpl.combine(
              (io.grpc.stub.StreamObserver) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

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

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.github.tjake.jlama.net.JlamaServiceOuterClass.getDescriptor();
    }

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

  private static final class JlamaServiceFileDescriptorSupplier
      extends JlamaServiceBaseDescriptorSupplier {
    JlamaServiceFileDescriptorSupplier() {}
  }

  private static final class JlamaServiceMethodDescriptorSupplier
      extends JlamaServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    JlamaServiceMethodDescriptorSupplier(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 (JlamaServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new JlamaServiceFileDescriptorSupplier())
              .addMethod(getRegisterMethod())
              .addMethod(getGenerateMethod())
              .addMethod(getCombineMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy