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

com.scalar.dl.rpc.GatewayPrivilegedGrpc Maven / Gradle / Ivy

The newest version!
package com.scalar.dl.rpc;

import static io.grpc.MethodDescriptor.generateFullMethodName;

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

  private GatewayPrivilegedGrpc() {}

  public static final java.lang.String SERVICE_NAME = "rpc.GatewayPrivileged";

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

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "RegisterCert",
      requestType = com.scalar.dl.rpc.CertificateRegistrationRequest.class,
      responseType = com.google.protobuf.Empty.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getRegisterCertMethod() {
    io.grpc.MethodDescriptor getRegisterCertMethod;
    if ((getRegisterCertMethod = GatewayPrivilegedGrpc.getRegisterCertMethod) == null) {
      synchronized (GatewayPrivilegedGrpc.class) {
        if ((getRegisterCertMethod = GatewayPrivilegedGrpc.getRegisterCertMethod) == null) {
          GatewayPrivilegedGrpc.getRegisterCertMethod = getRegisterCertMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RegisterCert"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.scalar.dl.rpc.CertificateRegistrationRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Empty.getDefaultInstance()))
              .setSchemaDescriptor(new GatewayPrivilegedMethodDescriptorSupplier("RegisterCert"))
              .build();
        }
      }
    }
    return getRegisterCertMethod;
  }

  private static volatile io.grpc.MethodDescriptor getRegisterSecretMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "RegisterSecret",
      requestType = com.scalar.dl.rpc.SecretRegistrationRequest.class,
      responseType = com.google.protobuf.Empty.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getRegisterSecretMethod() {
    io.grpc.MethodDescriptor getRegisterSecretMethod;
    if ((getRegisterSecretMethod = GatewayPrivilegedGrpc.getRegisterSecretMethod) == null) {
      synchronized (GatewayPrivilegedGrpc.class) {
        if ((getRegisterSecretMethod = GatewayPrivilegedGrpc.getRegisterSecretMethod) == null) {
          GatewayPrivilegedGrpc.getRegisterSecretMethod = getRegisterSecretMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RegisterSecret"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.scalar.dl.rpc.SecretRegistrationRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Empty.getDefaultInstance()))
              .setSchemaDescriptor(new GatewayPrivilegedMethodDescriptorSupplier("RegisterSecret"))
              .build();
        }
      }
    }
    return getRegisterSecretMethod;
  }

  private static volatile io.grpc.MethodDescriptor getRegisterFunctionMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "RegisterFunction",
      requestType = com.scalar.dl.rpc.FunctionRegistrationRequest.class,
      responseType = com.google.protobuf.Empty.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor getRegisterFunctionMethod() {
    io.grpc.MethodDescriptor getRegisterFunctionMethod;
    if ((getRegisterFunctionMethod = GatewayPrivilegedGrpc.getRegisterFunctionMethod) == null) {
      synchronized (GatewayPrivilegedGrpc.class) {
        if ((getRegisterFunctionMethod = GatewayPrivilegedGrpc.getRegisterFunctionMethod) == null) {
          GatewayPrivilegedGrpc.getRegisterFunctionMethod = getRegisterFunctionMethod =
              io.grpc.MethodDescriptor.newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RegisterFunction"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.scalar.dl.rpc.FunctionRegistrationRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.google.protobuf.Empty.getDefaultInstance()))
              .setSchemaDescriptor(new GatewayPrivilegedMethodDescriptorSupplier("RegisterFunction"))
              .build();
        }
      }
    }
    return getRegisterFunctionMethod;
  }

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

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

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

  /**
   */
  public interface AsyncService {

    /**
     */
    default void registerCert(com.scalar.dl.rpc.CertificateRegistrationRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRegisterCertMethod(), responseObserver);
    }

    /**
     */
    default void registerSecret(com.scalar.dl.rpc.SecretRegistrationRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRegisterSecretMethod(), responseObserver);
    }

    /**
     */
    default void registerFunction(com.scalar.dl.rpc.FunctionRegistrationRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getRegisterFunctionMethod(), responseObserver);
    }
  }

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

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

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

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

    /**
     */
    public void registerCert(com.scalar.dl.rpc.CertificateRegistrationRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getRegisterCertMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void registerSecret(com.scalar.dl.rpc.SecretRegistrationRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getRegisterSecretMethod(), getCallOptions()), request, responseObserver);
    }

    /**
     */
    public void registerFunction(com.scalar.dl.rpc.FunctionRegistrationRequest request,
        io.grpc.stub.StreamObserver responseObserver) {
      io.grpc.stub.ClientCalls.asyncUnaryCall(
          getChannel().newCall(getRegisterFunctionMethod(), getCallOptions()), request, responseObserver);
    }
  }

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

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

    /**
     */
    public com.google.protobuf.Empty registerCert(com.scalar.dl.rpc.CertificateRegistrationRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getRegisterCertMethod(), getCallOptions(), request);
    }

    /**
     */
    public com.google.protobuf.Empty registerSecret(com.scalar.dl.rpc.SecretRegistrationRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getRegisterSecretMethod(), getCallOptions(), request);
    }

    /**
     */
    public com.google.protobuf.Empty registerFunction(com.scalar.dl.rpc.FunctionRegistrationRequest request) {
      return io.grpc.stub.ClientCalls.blockingUnaryCall(
          getChannel(), getRegisterFunctionMethod(), getCallOptions(), request);
    }
  }

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

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

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture registerCert(
        com.scalar.dl.rpc.CertificateRegistrationRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getRegisterCertMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture registerSecret(
        com.scalar.dl.rpc.SecretRegistrationRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getRegisterSecretMethod(), getCallOptions()), request);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture registerFunction(
        com.scalar.dl.rpc.FunctionRegistrationRequest request) {
      return io.grpc.stub.ClientCalls.futureUnaryCall(
          getChannel().newCall(getRegisterFunctionMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_REGISTER_CERT = 0;
  private static final int METHODID_REGISTER_SECRET = 1;
  private static final int METHODID_REGISTER_FUNCTION = 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 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_REGISTER_CERT:
          serviceImpl.registerCert((com.scalar.dl.rpc.CertificateRegistrationRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_REGISTER_SECRET:
          serviceImpl.registerSecret((com.scalar.dl.rpc.SecretRegistrationRequest) request,
              (io.grpc.stub.StreamObserver) responseObserver);
          break;
        case METHODID_REGISTER_FUNCTION:
          serviceImpl.registerFunction((com.scalar.dl.rpc.FunctionRegistrationRequest) 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(
          getRegisterCertMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.scalar.dl.rpc.CertificateRegistrationRequest,
              com.google.protobuf.Empty>(
                service, METHODID_REGISTER_CERT)))
        .addMethod(
          getRegisterSecretMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.scalar.dl.rpc.SecretRegistrationRequest,
              com.google.protobuf.Empty>(
                service, METHODID_REGISTER_SECRET)))
        .addMethod(
          getRegisterFunctionMethod(),
          io.grpc.stub.ServerCalls.asyncUnaryCall(
            new MethodHandlers<
              com.scalar.dl.rpc.FunctionRegistrationRequest,
              com.google.protobuf.Empty>(
                service, METHODID_REGISTER_FUNCTION)))
        .build();
  }

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

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.scalar.dl.rpc.ScalarProto.getDescriptor();
    }

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

  private static final class GatewayPrivilegedFileDescriptorSupplier
      extends GatewayPrivilegedBaseDescriptorSupplier {
    GatewayPrivilegedFileDescriptorSupplier() {}
  }

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

    GatewayPrivilegedMethodDescriptorSupplier(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 (GatewayPrivilegedGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new GatewayPrivilegedFileDescriptorSupplier())
              .addMethod(getRegisterCertMethod())
              .addMethod(getRegisterSecretMethod())
              .addMethod(getRegisterFunctionMethod())
              .build();
        }
      }
    }
    return result;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy