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

io.grpc.testing.integration.MetricsServiceGrpc Maven / Gradle / Ivy

There is a newer version: 1.68.0
Show newest version
package io.grpc.testing.integration;

import static io.grpc.MethodDescriptor.generateFullMethodName;

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

  private MetricsServiceGrpc() {}

  public static final java.lang.String SERVICE_NAME = "grpc.testing.MetricsService";

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetAllGauges",
      requestType = io.grpc.testing.integration.Metrics.EmptyMessage.class,
      responseType = io.grpc.testing.integration.Metrics.GaugeResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
  public static io.grpc.MethodDescriptor getGetAllGaugesMethod() {
    io.grpc.MethodDescriptor getGetAllGaugesMethod;
    if ((getGetAllGaugesMethod = MetricsServiceGrpc.getGetAllGaugesMethod) == null) {
      synchronized (MetricsServiceGrpc.class) {
        if ((getGetAllGaugesMethod = MetricsServiceGrpc.getGetAllGaugesMethod) == null) {
          MetricsServiceGrpc.getGetAllGaugesMethod = getGetAllGaugesMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetAllGauges"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.grpc.testing.integration.Metrics.EmptyMessage.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.grpc.testing.integration.Metrics.GaugeResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MetricsServiceMethodDescriptorSupplier("GetAllGauges"))
              .build();
        }
      }
    }
    return getGetAllGaugesMethod;
  }

  private static volatile io.grpc.MethodDescriptor getGetGaugeMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "GetGauge",
      requestType = io.grpc.testing.integration.Metrics.GaugeRequest.class,
      responseType = io.grpc.testing.integration.Metrics.GaugeResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getGetGaugeMethod() {
    io.grpc.MethodDescriptor getGetGaugeMethod;
    if ((getGetGaugeMethod = MetricsServiceGrpc.getGetGaugeMethod) == null) {
      synchronized (MetricsServiceGrpc.class) {
        if ((getGetGaugeMethod = MetricsServiceGrpc.getGetGaugeMethod) == null) {
          MetricsServiceGrpc.getGetGaugeMethod = getGetGaugeMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetGauge"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.grpc.testing.integration.Metrics.GaugeRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.grpc.testing.integration.Metrics.GaugeResponse.getDefaultInstance()))
              .setSchemaDescriptor(new MetricsServiceMethodDescriptorSupplier("GetGauge"))
              .build();
        }
      }
    }
    return getGetGaugeMethod;
  }

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

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

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

  /**
   */
  public interface AsyncService {

    /**
     * 
     * Returns the values of all the gauges that are currently being maintained by
     * the service
     * 
*/ default void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetAllGaugesMethod(), responseObserver); } /** *
     * Returns the value of one gauge
     * 
*/ default void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetGaugeMethod(), responseObserver); } } /** * Base class for the server implementation of the service MetricsService. */ public static abstract class MetricsServiceImplBase implements io.grpc.BindableService, AsyncService { @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return MetricsServiceGrpc.bindService(this); } } /** * A stub to allow clients to do asynchronous rpc calls to service MetricsService. */ public static final class MetricsServiceStub extends io.grpc.stub.AbstractAsyncStub { private MetricsServiceStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected MetricsServiceStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new MetricsServiceStub(channel, callOptions); } /** *
     * Returns the values of all the gauges that are currently being maintained by
     * the service
     * 
*/ public void getAllGauges(io.grpc.testing.integration.Metrics.EmptyMessage request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncServerStreamingCall( getChannel().newCall(getGetAllGaugesMethod(), getCallOptions()), request, responseObserver); } /** *
     * Returns the value of one gauge
     * 
*/ public void getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request, io.grpc.stub.StreamObserver responseObserver) { io.grpc.stub.ClientCalls.asyncUnaryCall( getChannel().newCall(getGetGaugeMethod(), getCallOptions()), request, responseObserver); } } /** * A stub to allow clients to do synchronous rpc calls to service MetricsService. */ public static final class MetricsServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub { private MetricsServiceBlockingStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected MetricsServiceBlockingStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new MetricsServiceBlockingStub(channel, callOptions); } /** *
     * Returns the values of all the gauges that are currently being maintained by
     * the service
     * 
*/ public java.util.Iterator getAllGauges( io.grpc.testing.integration.Metrics.EmptyMessage request) { return io.grpc.stub.ClientCalls.blockingServerStreamingCall( getChannel(), getGetAllGaugesMethod(), getCallOptions(), request); } /** *
     * Returns the value of one gauge
     * 
*/ public io.grpc.testing.integration.Metrics.GaugeResponse getGauge(io.grpc.testing.integration.Metrics.GaugeRequest request) { return io.grpc.stub.ClientCalls.blockingUnaryCall( getChannel(), getGetGaugeMethod(), getCallOptions(), request); } } /** * A stub to allow clients to do ListenableFuture-style rpc calls to service MetricsService. */ public static final class MetricsServiceFutureStub extends io.grpc.stub.AbstractFutureStub { private MetricsServiceFutureStub( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { super(channel, callOptions); } @java.lang.Override protected MetricsServiceFutureStub build( io.grpc.Channel channel, io.grpc.CallOptions callOptions) { return new MetricsServiceFutureStub(channel, callOptions); } /** *
     * Returns the value of one gauge
     * 
*/ public com.google.common.util.concurrent.ListenableFuture getGauge( io.grpc.testing.integration.Metrics.GaugeRequest request) { return io.grpc.stub.ClientCalls.futureUnaryCall( getChannel().newCall(getGetGaugeMethod(), getCallOptions()), request); } } private static final int METHODID_GET_ALL_GAUGES = 0; private static final int METHODID_GET_GAUGE = 1; 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_GET_ALL_GAUGES: serviceImpl.getAllGauges((io.grpc.testing.integration.Metrics.EmptyMessage) request, (io.grpc.stub.StreamObserver) responseObserver); break; case METHODID_GET_GAUGE: serviceImpl.getGauge((io.grpc.testing.integration.Metrics.GaugeRequest) 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( getGetAllGaugesMethod(), io.grpc.stub.ServerCalls.asyncServerStreamingCall( new MethodHandlers< io.grpc.testing.integration.Metrics.EmptyMessage, io.grpc.testing.integration.Metrics.GaugeResponse>( service, METHODID_GET_ALL_GAUGES))) .addMethod( getGetGaugeMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( new MethodHandlers< io.grpc.testing.integration.Metrics.GaugeRequest, io.grpc.testing.integration.Metrics.GaugeResponse>( service, METHODID_GET_GAUGE))) .build(); } private static abstract class MetricsServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { MetricsServiceBaseDescriptorSupplier() {} @java.lang.Override public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { return io.grpc.testing.integration.Metrics.getDescriptor(); } @java.lang.Override public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { return getFileDescriptor().findServiceByName("MetricsService"); } } private static final class MetricsServiceFileDescriptorSupplier extends MetricsServiceBaseDescriptorSupplier { MetricsServiceFileDescriptorSupplier() {} } private static final class MetricsServiceMethodDescriptorSupplier extends MetricsServiceBaseDescriptorSupplier implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { private final java.lang.String methodName; MetricsServiceMethodDescriptorSupplier(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 (MetricsServiceGrpc.class) { result = serviceDescriptor; if (result == null) { serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) .setSchemaDescriptor(new MetricsServiceFileDescriptorSupplier()) .addMethod(getGetAllGaugesMethod()) .addMethod(getGetGaugeMethod()) .build(); } } } return result; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy