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

io.arthas.api.SystemPropertyGrpc Maven / Gradle / Ivy

The newest version!
package io.arthas.api;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.28.0)",
    comments = "Source: ArthasServices.proto")
public final class SystemPropertyGrpc {

  private SystemPropertyGrpc() {}

  public static final String SERVICE_NAME = "io.arthas.api.SystemProperty";

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "get",
      requestType = com.google.protobuf.Empty.class,
      responseType = io.arthas.api.ArthasServices.ResponseBody.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getGetMethod() {
    io.grpc.MethodDescriptor getGetMethod;
    if ((getGetMethod = SystemPropertyGrpc.getGetMethod) == null) {
      synchronized (SystemPropertyGrpc.class) {
        if ((getGetMethod = SystemPropertyGrpc.getGetMethod) == null) {
          SystemPropertyGrpc.getGetMethod = getGetMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "get"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Empty.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.arthas.api.ArthasServices.ResponseBody.getDefaultInstance()))
              .setSchemaDescriptor(new SystemPropertyMethodDescriptorSupplier("get"))
              .build();
        }
      }
    }
    return getGetMethod;
  }

  private static volatile io.grpc.MethodDescriptor getGetByKeyMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "getByKey",
      requestType = io.arthas.api.ArthasServices.StringKey.class,
      responseType = io.arthas.api.ArthasServices.ResponseBody.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getGetByKeyMethod() {
    io.grpc.MethodDescriptor getGetByKeyMethod;
    if ((getGetByKeyMethod = SystemPropertyGrpc.getGetByKeyMethod) == null) {
      synchronized (SystemPropertyGrpc.class) {
        if ((getGetByKeyMethod = SystemPropertyGrpc.getGetByKeyMethod) == null) {
          SystemPropertyGrpc.getGetByKeyMethod = getGetByKeyMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getByKey"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.arthas.api.ArthasServices.StringKey.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.arthas.api.ArthasServices.ResponseBody.getDefaultInstance()))
              .setSchemaDescriptor(new SystemPropertyMethodDescriptorSupplier("getByKey"))
              .build();
        }
      }
    }
    return getGetByKeyMethod;
  }

  private static volatile io.grpc.MethodDescriptor getUpdateMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "update",
      requestType = io.arthas.api.ArthasServices.StringStringMapValue.class,
      responseType = io.arthas.api.ArthasServices.ResponseBody.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getUpdateMethod() {
    io.grpc.MethodDescriptor getUpdateMethod;
    if ((getUpdateMethod = SystemPropertyGrpc.getUpdateMethod) == null) {
      synchronized (SystemPropertyGrpc.class) {
        if ((getUpdateMethod = SystemPropertyGrpc.getUpdateMethod) == null) {
          SystemPropertyGrpc.getUpdateMethod = getUpdateMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "update"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.arthas.api.ArthasServices.StringStringMapValue.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  io.arthas.api.ArthasServices.ResponseBody.getDefaultInstance()))
              .setSchemaDescriptor(new SystemPropertyMethodDescriptorSupplier("update"))
              .build();
        }
      }
    }
    return getUpdateMethod;
  }

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

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

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

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

    /**
     */
    public void get(com.google.protobuf.Empty request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(getGetMethod(), responseObserver);
    }

    /**
     */
    public void getByKey(io.arthas.api.ArthasServices.StringKey request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(getGetByKeyMethod(), responseObserver);
    }

    /**
     */
    public void update(io.arthas.api.ArthasServices.StringStringMapValue request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnimplementedUnaryCall(getUpdateMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getGetMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                com.google.protobuf.Empty,
                io.arthas.api.ArthasServices.ResponseBody>(
                  this, METHODID_GET)))
          .addMethod(
            getGetByKeyMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                io.arthas.api.ArthasServices.StringKey,
                io.arthas.api.ArthasServices.ResponseBody>(
                  this, METHODID_GET_BY_KEY)))
          .addMethod(
            getUpdateMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                io.arthas.api.ArthasServices.StringStringMapValue,
                io.arthas.api.ArthasServices.ResponseBody>(
                  this, METHODID_UPDATE)))
          .build();
    }
  }

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

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

    /**
     */
    public void get(com.google.protobuf.Empty request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void getByKey(io.arthas.api.ArthasServices.StringKey request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getGetByKeyMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void update(io.arthas.api.ArthasServices.StringStringMapValue request,
        io.grpc.stub.StreamObserver responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getUpdateMethod(), getCallOptions()), request, responseObserver);
    }
  }

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

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

    /**
     */
    public io.arthas.api.ArthasServices.ResponseBody get(com.google.protobuf.Empty request) {
      return blockingUnaryCall(
          getChannel(), getGetMethod(), getCallOptions(), request);
    }

    /**
     */
    public io.arthas.api.ArthasServices.ResponseBody getByKey(io.arthas.api.ArthasServices.StringKey request) {
      return blockingUnaryCall(
          getChannel(), getGetByKeyMethod(), getCallOptions(), request);
    }

    /**
     */
    public io.arthas.api.ArthasServices.ResponseBody update(io.arthas.api.ArthasServices.StringStringMapValue request) {
      return blockingUnaryCall(
          getChannel(), getUpdateMethod(), getCallOptions(), request);
    }
  }

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

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture get(
        com.google.protobuf.Empty request) {
      return futureUnaryCall(
          getChannel().newCall(getGetMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture getByKey(
        io.arthas.api.ArthasServices.StringKey request) {
      return futureUnaryCall(
          getChannel().newCall(getGetByKeyMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture update(
        io.arthas.api.ArthasServices.StringStringMapValue request) {
      return futureUnaryCall(
          getChannel().newCall(getUpdateMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_GET = 0;
  private static final int METHODID_GET_BY_KEY = 1;
  private static final int METHODID_UPDATE = 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 SystemPropertyImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(SystemPropertyImplBase 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:
          serviceImpl.get((com.google.protobuf.Empty) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_GET_BY_KEY:
          serviceImpl.getByKey((io.arthas.api.ArthasServices.StringKey) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_UPDATE:
          serviceImpl.update((io.arthas.api.ArthasServices.StringStringMapValue) 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 abstract class SystemPropertyBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    SystemPropertyBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return io.arthas.api.ArthasServices.getDescriptor();
    }

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

  private static final class SystemPropertyFileDescriptorSupplier
      extends SystemPropertyBaseDescriptorSupplier {
    SystemPropertyFileDescriptorSupplier() {}
  }

  private static final class SystemPropertyMethodDescriptorSupplier
      extends SystemPropertyBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    SystemPropertyMethodDescriptorSupplier(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 (SystemPropertyGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new SystemPropertyFileDescriptorSupplier())
              .addMethod(getGetMethod())
              .addMethod(getGetByKeyMethod())
              .addMethod(getUpdateMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy