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

grpc.cache_client.HttpCacheGrpc Maven / Gradle / Ivy

There is a newer version: 0.119.4
Show newest version
package grpc.cache_client;

import static io.grpc.MethodDescriptor.generateFullMethodName;

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

  private HttpCacheGrpc() {}

  public static final String SERVICE_NAME = "cache_client.HttpCache";

  // 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 = grpc.cache_client._HttpGetRequest.class,
      responseType = com.google.api.HttpBody.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getGetMethod() {
    io.grpc.MethodDescriptor getGetMethod;
    if ((getGetMethod = HttpCacheGrpc.getGetMethod) == null) {
      synchronized (HttpCacheGrpc.class) {
        if ((getGetMethod = HttpCacheGrpc.getGetMethod) == null) {
          HttpCacheGrpc.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(
                  grpc.cache_client._HttpGetRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.api.HttpBody.getDefaultInstance()))
              .setSchemaDescriptor(new HttpCacheMethodDescriptorSupplier("Get"))
              .build();
        }
      }
    }
    return getGetMethod;
  }

  private static volatile io.grpc.MethodDescriptor getSetMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Set",
      requestType = grpc.cache_client._HttpSetRequest.class,
      responseType = grpc.cache_client._SetResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getSetMethod() {
    io.grpc.MethodDescriptor getSetMethod;
    if ((getSetMethod = HttpCacheGrpc.getSetMethod) == null) {
      synchronized (HttpCacheGrpc.class) {
        if ((getSetMethod = HttpCacheGrpc.getSetMethod) == null) {
          HttpCacheGrpc.getSetMethod = getSetMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Set"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  grpc.cache_client._HttpSetRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  grpc.cache_client._SetResponse.getDefaultInstance()))
              .setSchemaDescriptor(new HttpCacheMethodDescriptorSupplier("Set"))
              .build();
        }
      }
    }
    return getSetMethod;
  }

  private static volatile io.grpc.MethodDescriptor getSetButItsAPutMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "SetButItsAPut",
      requestType = grpc.cache_client._HttpSetRequest.class,
      responseType = grpc.cache_client._SetResponse.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getSetButItsAPutMethod() {
    io.grpc.MethodDescriptor getSetButItsAPutMethod;
    if ((getSetButItsAPutMethod = HttpCacheGrpc.getSetButItsAPutMethod) == null) {
      synchronized (HttpCacheGrpc.class) {
        if ((getSetButItsAPutMethod = HttpCacheGrpc.getSetButItsAPutMethod) == null) {
          HttpCacheGrpc.getSetButItsAPutMethod = getSetButItsAPutMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SetButItsAPut"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  grpc.cache_client._HttpSetRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  grpc.cache_client._SetResponse.getDefaultInstance()))
              .setSchemaDescriptor(new HttpCacheMethodDescriptorSupplier("SetButItsAPut"))
              .build();
        }
      }
    }
    return getSetButItsAPutMethod;
  }

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

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

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

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

    /**
     */
    public void get(grpc.cache_client._HttpGetRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetMethod(), responseObserver);
    }

    /**
     */
    public void set(grpc.cache_client._HttpSetRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetMethod(), responseObserver);
    }

    /**
     */
    public void setButItsAPut(grpc.cache_client._HttpSetRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getSetButItsAPutMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getGetMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                grpc.cache_client._HttpGetRequest,
                com.google.api.HttpBody>(
                  this, METHODID_GET)))
          .addMethod(
            getSetMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                grpc.cache_client._HttpSetRequest,
                grpc.cache_client._SetResponse>(
                  this, METHODID_SET)))
          .addMethod(
            getSetButItsAPutMethod(),
            io.grpc.stub.ServerCalls.asyncUnaryCall(
              new MethodHandlers<
                grpc.cache_client._HttpSetRequest,
                grpc.cache_client._SetResponse>(
                  this, METHODID_SET_BUT_ITS_APUT)))
          .build();
    }
  }

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

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

    /**
     */
    public void get(grpc.cache_client._HttpGetRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getGetMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void set(grpc.cache_client._HttpSetRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getSetMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void setButItsAPut(grpc.cache_client._HttpSetRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getSetButItsAPutMethod(), getCallOptions()), request, responseObserver);
    }
  }

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

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

    /**
     */
    public com.google.api.HttpBody get(grpc.cache_client._HttpGetRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getGetMethod(), getCallOptions(), request);
    }

    /**
     */
    public grpc.cache_client._SetResponse set(grpc.cache_client._HttpSetRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getSetMethod(), getCallOptions(), request);
    }

    /**
     */
    public grpc.cache_client._SetResponse setButItsAPut(grpc.cache_client._HttpSetRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getSetButItsAPutMethod(), getCallOptions(), request);
    }
  }

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

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture get(
        grpc.cache_client._HttpGetRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getGetMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture set(
        grpc.cache_client._HttpSetRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getSetMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture setButItsAPut(
        grpc.cache_client._HttpSetRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getSetButItsAPutMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_GET = 0;
  private static final int METHODID_SET = 1;
  private static final int METHODID_SET_BUT_ITS_APUT = 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 HttpCacheImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(HttpCacheImplBase 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((grpc.cache_client._HttpGetRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_SET:
          serviceImpl.set((grpc.cache_client._HttpSetRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_SET_BUT_ITS_APUT:
          serviceImpl.setButItsAPut((grpc.cache_client._HttpSetRequest) 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 HttpCacheBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    HttpCacheBaseDescriptorSupplier() {}

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

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

  private static final class HttpCacheFileDescriptorSupplier
      extends HttpCacheBaseDescriptorSupplier {
    HttpCacheFileDescriptorSupplier() {}
  }

  private static final class HttpCacheMethodDescriptorSupplier
      extends HttpCacheBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    HttpCacheMethodDescriptorSupplier(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 (HttpCacheGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new HttpCacheFileDescriptorSupplier())
              .addMethod(getGetMethod())
              .addMethod(getSetMethod())
              .addMethod(getSetButItsAPutMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy