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

com.diozero.remote.message.protobuf.SPIServiceGrpc Maven / Gradle / Ivy

The newest version!
package com.diozero.remote.message.protobuf;

import static io.grpc.MethodDescriptor.generateFullMethodName;

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

  private SPIServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "diozero.SPIService";

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Open",
      requestType = com.diozero.remote.message.protobuf.SPI.Open.class,
      responseType = com.diozero.remote.message.protobuf.Response.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getOpenMethod() {
    io.grpc.MethodDescriptor getOpenMethod;
    if ((getOpenMethod = SPIServiceGrpc.getOpenMethod) == null) {
      synchronized (SPIServiceGrpc.class) {
        if ((getOpenMethod = SPIServiceGrpc.getOpenMethod) == null) {
          SPIServiceGrpc.getOpenMethod = getOpenMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Open"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.SPI.Open.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.Response.getDefaultInstance()))
              .setSchemaDescriptor(new SPIServiceMethodDescriptorSupplier("Open"))
              .build();
        }
      }
    }
    return getOpenMethod;
  }

  private static volatile io.grpc.MethodDescriptor getWriteMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Write",
      requestType = com.diozero.remote.message.protobuf.SPI.ByteArray.class,
      responseType = com.diozero.remote.message.protobuf.Response.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getWriteMethod() {
    io.grpc.MethodDescriptor getWriteMethod;
    if ((getWriteMethod = SPIServiceGrpc.getWriteMethod) == null) {
      synchronized (SPIServiceGrpc.class) {
        if ((getWriteMethod = SPIServiceGrpc.getWriteMethod) == null) {
          SPIServiceGrpc.getWriteMethod = getWriteMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Write"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.SPI.ByteArray.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.Response.getDefaultInstance()))
              .setSchemaDescriptor(new SPIServiceMethodDescriptorSupplier("Write"))
              .build();
        }
      }
    }
    return getWriteMethod;
  }

  private static volatile io.grpc.MethodDescriptor getWriteAndReadMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "WriteAndRead",
      requestType = com.diozero.remote.message.protobuf.SPI.ByteArray.class,
      responseType = com.diozero.remote.message.protobuf.BytesResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getWriteAndReadMethod() {
    io.grpc.MethodDescriptor getWriteAndReadMethod;
    if ((getWriteAndReadMethod = SPIServiceGrpc.getWriteAndReadMethod) == null) {
      synchronized (SPIServiceGrpc.class) {
        if ((getWriteAndReadMethod = SPIServiceGrpc.getWriteAndReadMethod) == null) {
          SPIServiceGrpc.getWriteAndReadMethod = getWriteAndReadMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WriteAndRead"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.SPI.ByteArray.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.BytesResponse.getDefaultInstance()))
              .setSchemaDescriptor(new SPIServiceMethodDescriptorSupplier("WriteAndRead"))
              .build();
        }
      }
    }
    return getWriteAndReadMethod;
  }

  private static volatile io.grpc.MethodDescriptor getCloseMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Close",
      requestType = com.diozero.remote.message.protobuf.SPI.Identifier.class,
      responseType = com.diozero.remote.message.protobuf.Response.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getCloseMethod() {
    io.grpc.MethodDescriptor getCloseMethod;
    if ((getCloseMethod = SPIServiceGrpc.getCloseMethod) == null) {
      synchronized (SPIServiceGrpc.class) {
        if ((getCloseMethod = SPIServiceGrpc.getCloseMethod) == null) {
          SPIServiceGrpc.getCloseMethod = getCloseMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Close"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.SPI.Identifier.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.diozero.remote.message.protobuf.Response.getDefaultInstance()))
              .setSchemaDescriptor(new SPIServiceMethodDescriptorSupplier("Close"))
              .build();
        }
      }
    }
    return getCloseMethod;
  }

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

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

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

  /**
   */
  public interface AsyncService {

    /**
     */
    default void open(com.diozero.remote.message.protobuf.SPI.Open request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getOpenMethod(), responseObserver);
    }

    /**
     */
    default void write(com.diozero.remote.message.protobuf.SPI.ByteArray request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWriteMethod(), responseObserver);
    }

    /**
     */
    default void writeAndRead(com.diozero.remote.message.protobuf.SPI.ByteArray request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWriteAndReadMethod(), responseObserver);
    }

    /**
     */
    default void close(com.diozero.remote.message.protobuf.SPI.Identifier request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCloseMethod(), responseObserver);
    }
  }

  /**
   * Base class for the server implementation of the service SPIService.
   */
  public static abstract class SPIServiceImplBase
      implements io.grpc.BindableService, AsyncService {

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return SPIServiceGrpc.bindService(this);
    }
  }

  /**
   * A stub to allow clients to do asynchronous rpc calls to service SPIService.
   */
  public static final class SPIServiceStub
      extends io.grpc.stub.AbstractAsyncStub {
    private SPIServiceStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public void open(com.diozero.remote.message.protobuf.SPI.Open request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getOpenMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void write(com.diozero.remote.message.protobuf.SPI.ByteArray request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getWriteMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void writeAndRead(com.diozero.remote.message.protobuf.SPI.ByteArray request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getWriteAndReadMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void close(com.diozero.remote.message.protobuf.SPI.Identifier request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getCloseMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   * A stub to allow clients to do synchronous rpc calls to service SPIService.
   */
  public static final class SPIServiceBlockingStub
      extends io.grpc.stub.AbstractBlockingStub {
    private SPIServiceBlockingStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public com.diozero.remote.message.protobuf.Response open(com.diozero.remote.message.protobuf.SPI.Open request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getOpenMethod(), getCallOptions(), request);
    }

    /**
     */
    public com.diozero.remote.message.protobuf.Response write(com.diozero.remote.message.protobuf.SPI.ByteArray request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getWriteMethod(), getCallOptions(), request);
    }

    /**
     */
    public com.diozero.remote.message.protobuf.BytesResponse writeAndRead(com.diozero.remote.message.protobuf.SPI.ByteArray request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getWriteAndReadMethod(), getCallOptions(), request);
    }

    /**
     */
    public com.diozero.remote.message.protobuf.Response close(com.diozero.remote.message.protobuf.SPI.Identifier request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getCloseMethod(), getCallOptions(), request);
    }
  }

  /**
   * A stub to allow clients to do ListenableFuture-style rpc calls to service SPIService.
   */
  public static final class SPIServiceFutureStub
      extends io.grpc.stub.AbstractFutureStub {
    private SPIServiceFutureStub(
        io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture open(
        com.diozero.remote.message.protobuf.SPI.Open request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getOpenMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture write(
        com.diozero.remote.message.protobuf.SPI.ByteArray request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getWriteMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture writeAndRead(
        com.diozero.remote.message.protobuf.SPI.ByteArray request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getWriteAndReadMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture close(
        com.diozero.remote.message.protobuf.SPI.Identifier request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getCloseMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_OPEN = 0;
  private static final int METHODID_WRITE = 1;
  private static final int METHODID_WRITE_AND_READ = 2;
  private static final int METHODID_CLOSE = 3;

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

    MethodHandlers(AsyncService 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_OPEN:
          serviceImpl.open((com.diozero.remote.message.protobuf.SPI.Open) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_WRITE:
          serviceImpl.write((com.diozero.remote.message.protobuf.SPI.ByteArray) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_WRITE_AND_READ:
          serviceImpl.writeAndRead((com.diozero.remote.message.protobuf.SPI.ByteArray) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_CLOSE:
          serviceImpl.close((com.diozero.remote.message.protobuf.SPI.Identifier) 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 final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getOpenMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.diozero.remote.message.protobuf.SPI.Open,
              com.diozero.remote.message.protobuf.Response>(
                service, METHODID_OPEN)))
        .addMethod(
          getWriteMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.diozero.remote.message.protobuf.SPI.ByteArray,
              com.diozero.remote.message.protobuf.Response>(
                service, METHODID_WRITE)))
        .addMethod(
          getWriteAndReadMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.diozero.remote.message.protobuf.SPI.ByteArray,
              com.diozero.remote.message.protobuf.BytesResponse>(
                service, METHODID_WRITE_AND_READ)))
        .addMethod(
          getCloseMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.diozero.remote.message.protobuf.SPI.Identifier,
              com.diozero.remote.message.protobuf.Response>(
                service, METHODID_CLOSE)))
        .build();
  }

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

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.diozero.remote.message.protobuf.Diozero.getDescriptor();
    }

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

  private static final class SPIServiceFileDescriptorSupplier
      extends SPIServiceBaseDescriptorSupplier {
    SPIServiceFileDescriptorSupplier() {}
  }

  private static final class SPIServiceMethodDescriptorSupplier
      extends SPIServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final java.lang.String methodName;

    SPIServiceMethodDescriptorSupplier(java.lang.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 (SPIServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new SPIServiceFileDescriptorSupplier())
              .addMethod(getOpenMethod())
              .addMethod(getWriteMethod())
              .addMethod(getWriteAndReadMethod())
              .addMethod(getCloseMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy