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

com.craxiom.messaging.grpc.DeviceStatusGrpc Maven / Gradle / Ivy

There is a newer version: 1.6.0
Show newest version
package com.craxiom.messaging.grpc;

import static io.grpc.MethodDescriptor.generateFullMethodName;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.65.1)",
    comments = "Source: com/craxiom/messaging/grpc/device_status_stream.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class DeviceStatusGrpc {

  private DeviceStatusGrpc() {}

  public static final java.lang.String SERVICE_NAME = "com.craxiom.messaging.grpc.DeviceStatus";

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "StatusUpdate",
      requestType = com.craxiom.messaging.DeviceStatus.class,
      responseType = com.craxiom.messaging.grpc.StatusUpdateReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
  public static io.grpc.MethodDescriptor getStatusUpdateMethod() {
    io.grpc.MethodDescriptor getStatusUpdateMethod;
    if ((getStatusUpdateMethod = DeviceStatusGrpc.getStatusUpdateMethod) == null) {
      synchronized (DeviceStatusGrpc.class) {
        if ((getStatusUpdateMethod = DeviceStatusGrpc.getStatusUpdateMethod) == null) {
          DeviceStatusGrpc.getStatusUpdateMethod = getStatusUpdateMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "StatusUpdate"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.craxiom.messaging.DeviceStatus.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.craxiom.messaging.grpc.StatusUpdateReply.getDefaultInstance()))
              .setSchemaDescriptor(new DeviceStatusMethodDescriptorSupplier("StatusUpdate"))
              .build();
        }
      }
    }
    return getStatusUpdateMethod;
  }

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

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

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

  /**
   */
  public interface AsyncService {

    /**
     */
    default io.grpc.stub.StreamObserver statusUpdate(
        io.grpc.stub.StreamObserver responseObserver) {
      return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getStatusUpdateMethod(), responseObserver);
    }
  }

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

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

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

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

    /**
     */
    public io.grpc.stub.StreamObserver statusUpdate(
        io.grpc.stub.StreamObserver responseObserver) {
      return io.grpc.stub.ClientCalls.asyncClientStreamingCall(
          getChannel().newCall(getStatusUpdateMethod(), getCallOptions()), responseObserver);
    }
  }

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

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

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

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

  private static final int METHODID_STATUS_UPDATE = 0;

  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) {
        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_STATUS_UPDATE:
          return (io.grpc.stub.StreamObserver) serviceImpl.statusUpdate(
              (io.grpc.stub.StreamObserver) responseObserver);
        default:
          throw new AssertionError();
      }
    }
  }

  public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) {
    return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
        .addMethod(
          getStatusUpdateMethod(),
          io.grpc.stub.ServerCalls.asyncClientStreamingCall(
            new MethodHandlers<
              com.craxiom.messaging.DeviceStatus,
              com.craxiom.messaging.grpc.StatusUpdateReply>(
                service, METHODID_STATUS_UPDATE)))
        .build();
  }

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

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.craxiom.messaging.grpc.DeviceStatusStream.getDescriptor();
    }

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

  private static final class DeviceStatusFileDescriptorSupplier
      extends DeviceStatusBaseDescriptorSupplier {
    DeviceStatusFileDescriptorSupplier() {}
  }

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

    DeviceStatusMethodDescriptorSupplier(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 (DeviceStatusGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new DeviceStatusFileDescriptorSupplier())
              .addMethod(getStatusUpdateMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy