PageRenderTime 43ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/components/supervisor-api/java/src/main/java/io/gitpod/supervisor/api/InfoServiceGrpc.java

https://gitlab.com/geropl/gitpod
Java | 280 lines | 213 code | 36 blank | 31 comment | 10 complexity | cc5cc9885d509fff75c0fcd5a538371e MD5 | raw file
  1. // Copyright (c) 2022 Gitpod GmbH. All rights reserved.
  2. // Licensed under the GNU Affero General Public License (AGPL).
  3. // See License-AGPL.txt in the project root for license information.
  4. package io.gitpod.supervisor.api;
  5. import static io.grpc.MethodDescriptor.generateFullMethodName;
  6. /**
  7. */
  8. @javax.annotation.Generated(
  9. value = "by gRPC proto compiler (version 1.41.0)",
  10. comments = "Source: info.proto")
  11. @io.grpc.stub.annotations.GrpcGenerated
  12. public final class InfoServiceGrpc {
  13. private InfoServiceGrpc() {}
  14. public static final String SERVICE_NAME = "supervisor.InfoService";
  15. // Static method descriptors that strictly reflect the proto.
  16. private static volatile io.grpc.MethodDescriptor<io.gitpod.supervisor.api.Info.WorkspaceInfoRequest,
  17. io.gitpod.supervisor.api.Info.WorkspaceInfoResponse> getWorkspaceInfoMethod;
  18. @io.grpc.stub.annotations.RpcMethod(
  19. fullMethodName = SERVICE_NAME + '/' + "WorkspaceInfo",
  20. requestType = io.gitpod.supervisor.api.Info.WorkspaceInfoRequest.class,
  21. responseType = io.gitpod.supervisor.api.Info.WorkspaceInfoResponse.class,
  22. methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  23. public static io.grpc.MethodDescriptor<io.gitpod.supervisor.api.Info.WorkspaceInfoRequest,
  24. io.gitpod.supervisor.api.Info.WorkspaceInfoResponse> getWorkspaceInfoMethod() {
  25. io.grpc.MethodDescriptor<io.gitpod.supervisor.api.Info.WorkspaceInfoRequest, io.gitpod.supervisor.api.Info.WorkspaceInfoResponse> getWorkspaceInfoMethod;
  26. if ((getWorkspaceInfoMethod = InfoServiceGrpc.getWorkspaceInfoMethod) == null) {
  27. synchronized (InfoServiceGrpc.class) {
  28. if ((getWorkspaceInfoMethod = InfoServiceGrpc.getWorkspaceInfoMethod) == null) {
  29. InfoServiceGrpc.getWorkspaceInfoMethod = getWorkspaceInfoMethod =
  30. io.grpc.MethodDescriptor.<io.gitpod.supervisor.api.Info.WorkspaceInfoRequest, io.gitpod.supervisor.api.Info.WorkspaceInfoResponse>newBuilder()
  31. .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
  32. .setFullMethodName(generateFullMethodName(SERVICE_NAME, "WorkspaceInfo"))
  33. .setSampledToLocalTracing(true)
  34. .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
  35. io.gitpod.supervisor.api.Info.WorkspaceInfoRequest.getDefaultInstance()))
  36. .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
  37. io.gitpod.supervisor.api.Info.WorkspaceInfoResponse.getDefaultInstance()))
  38. .setSchemaDescriptor(new InfoServiceMethodDescriptorSupplier("WorkspaceInfo"))
  39. .build();
  40. }
  41. }
  42. }
  43. return getWorkspaceInfoMethod;
  44. }
  45. /**
  46. * Creates a new async stub that supports all call types for the service
  47. */
  48. public static InfoServiceStub newStub(io.grpc.Channel channel) {
  49. io.grpc.stub.AbstractStub.StubFactory<InfoServiceStub> factory =
  50. new io.grpc.stub.AbstractStub.StubFactory<InfoServiceStub>() {
  51. @java.lang.Override
  52. public InfoServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  53. return new InfoServiceStub(channel, callOptions);
  54. }
  55. };
  56. return InfoServiceStub.newStub(factory, channel);
  57. }
  58. /**
  59. * Creates a new blocking-style stub that supports unary and streaming output calls on the service
  60. */
  61. public static InfoServiceBlockingStub newBlockingStub(
  62. io.grpc.Channel channel) {
  63. io.grpc.stub.AbstractStub.StubFactory<InfoServiceBlockingStub> factory =
  64. new io.grpc.stub.AbstractStub.StubFactory<InfoServiceBlockingStub>() {
  65. @java.lang.Override
  66. public InfoServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  67. return new InfoServiceBlockingStub(channel, callOptions);
  68. }
  69. };
  70. return InfoServiceBlockingStub.newStub(factory, channel);
  71. }
  72. /**
  73. * Creates a new ListenableFuture-style stub that supports unary calls on the service
  74. */
  75. public static InfoServiceFutureStub newFutureStub(
  76. io.grpc.Channel channel) {
  77. io.grpc.stub.AbstractStub.StubFactory<InfoServiceFutureStub> factory =
  78. new io.grpc.stub.AbstractStub.StubFactory<InfoServiceFutureStub>() {
  79. @java.lang.Override
  80. public InfoServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  81. return new InfoServiceFutureStub(channel, callOptions);
  82. }
  83. };
  84. return InfoServiceFutureStub.newStub(factory, channel);
  85. }
  86. /**
  87. */
  88. public static abstract class InfoServiceImplBase implements io.grpc.BindableService {
  89. /**
  90. */
  91. public void workspaceInfo(io.gitpod.supervisor.api.Info.WorkspaceInfoRequest request,
  92. io.grpc.stub.StreamObserver<io.gitpod.supervisor.api.Info.WorkspaceInfoResponse> responseObserver) {
  93. io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWorkspaceInfoMethod(), responseObserver);
  94. }
  95. @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
  96. return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
  97. .addMethod(
  98. getWorkspaceInfoMethod(),
  99. io.grpc.stub.ServerCalls.asyncUnaryCall(
  100. new MethodHandlers<
  101. io.gitpod.supervisor.api.Info.WorkspaceInfoRequest,
  102. io.gitpod.supervisor.api.Info.WorkspaceInfoResponse>(
  103. this, METHODID_WORKSPACE_INFO)))
  104. .build();
  105. }
  106. }
  107. /**
  108. */
  109. public static final class InfoServiceStub extends io.grpc.stub.AbstractAsyncStub<InfoServiceStub> {
  110. private InfoServiceStub(
  111. io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  112. super(channel, callOptions);
  113. }
  114. @java.lang.Override
  115. protected InfoServiceStub build(
  116. io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  117. return new InfoServiceStub(channel, callOptions);
  118. }
  119. /**
  120. */
  121. public void workspaceInfo(io.gitpod.supervisor.api.Info.WorkspaceInfoRequest request,
  122. io.grpc.stub.StreamObserver<io.gitpod.supervisor.api.Info.WorkspaceInfoResponse> responseObserver) {
  123. io.grpc.stub.ClientCalls.asyncUnaryCall(
  124. getChannel().newCall(getWorkspaceInfoMethod(), getCallOptions()), request, responseObserver);
  125. }
  126. }
  127. /**
  128. */
  129. public static final class InfoServiceBlockingStub extends io.grpc.stub.AbstractBlockingStub<InfoServiceBlockingStub> {
  130. private InfoServiceBlockingStub(
  131. io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  132. super(channel, callOptions);
  133. }
  134. @java.lang.Override
  135. protected InfoServiceBlockingStub build(
  136. io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  137. return new InfoServiceBlockingStub(channel, callOptions);
  138. }
  139. /**
  140. */
  141. public io.gitpod.supervisor.api.Info.WorkspaceInfoResponse workspaceInfo(io.gitpod.supervisor.api.Info.WorkspaceInfoRequest request) {
  142. return io.grpc.stub.ClientCalls.blockingUnaryCall(
  143. getChannel(), getWorkspaceInfoMethod(), getCallOptions(), request);
  144. }
  145. }
  146. /**
  147. */
  148. public static final class InfoServiceFutureStub extends io.grpc.stub.AbstractFutureStub<InfoServiceFutureStub> {
  149. private InfoServiceFutureStub(
  150. io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  151. super(channel, callOptions);
  152. }
  153. @java.lang.Override
  154. protected InfoServiceFutureStub build(
  155. io.grpc.Channel channel, io.grpc.CallOptions callOptions) {
  156. return new InfoServiceFutureStub(channel, callOptions);
  157. }
  158. /**
  159. */
  160. public com.google.common.util.concurrent.ListenableFuture<io.gitpod.supervisor.api.Info.WorkspaceInfoResponse> workspaceInfo(
  161. io.gitpod.supervisor.api.Info.WorkspaceInfoRequest request) {
  162. return io.grpc.stub.ClientCalls.futureUnaryCall(
  163. getChannel().newCall(getWorkspaceInfoMethod(), getCallOptions()), request);
  164. }
  165. }
  166. private static final int METHODID_WORKSPACE_INFO = 0;
  167. private static final class MethodHandlers<Req, Resp> implements
  168. io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
  169. io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
  170. io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
  171. io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
  172. private final InfoServiceImplBase serviceImpl;
  173. private final int methodId;
  174. MethodHandlers(InfoServiceImplBase serviceImpl, int methodId) {
  175. this.serviceImpl = serviceImpl;
  176. this.methodId = methodId;
  177. }
  178. @java.lang.Override
  179. @java.lang.SuppressWarnings("unchecked")
  180. public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
  181. switch (methodId) {
  182. case METHODID_WORKSPACE_INFO:
  183. serviceImpl.workspaceInfo((io.gitpod.supervisor.api.Info.WorkspaceInfoRequest) request,
  184. (io.grpc.stub.StreamObserver<io.gitpod.supervisor.api.Info.WorkspaceInfoResponse>) responseObserver);
  185. break;
  186. default:
  187. throw new AssertionError();
  188. }
  189. }
  190. @java.lang.Override
  191. @java.lang.SuppressWarnings("unchecked")
  192. public io.grpc.stub.StreamObserver<Req> invoke(
  193. io.grpc.stub.StreamObserver<Resp> responseObserver) {
  194. switch (methodId) {
  195. default:
  196. throw new AssertionError();
  197. }
  198. }
  199. }
  200. private static abstract class InfoServiceBaseDescriptorSupplier
  201. implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
  202. InfoServiceBaseDescriptorSupplier() {}
  203. @java.lang.Override
  204. public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
  205. return io.gitpod.supervisor.api.Info.getDescriptor();
  206. }
  207. @java.lang.Override
  208. public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
  209. return getFileDescriptor().findServiceByName("InfoService");
  210. }
  211. }
  212. private static final class InfoServiceFileDescriptorSupplier
  213. extends InfoServiceBaseDescriptorSupplier {
  214. InfoServiceFileDescriptorSupplier() {}
  215. }
  216. private static final class InfoServiceMethodDescriptorSupplier
  217. extends InfoServiceBaseDescriptorSupplier
  218. implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
  219. private final String methodName;
  220. InfoServiceMethodDescriptorSupplier(String methodName) {
  221. this.methodName = methodName;
  222. }
  223. @java.lang.Override
  224. public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
  225. return getServiceDescriptor().findMethodByName(methodName);
  226. }
  227. }
  228. private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
  229. public static io.grpc.ServiceDescriptor getServiceDescriptor() {
  230. io.grpc.ServiceDescriptor result = serviceDescriptor;
  231. if (result == null) {
  232. synchronized (InfoServiceGrpc.class) {
  233. result = serviceDescriptor;
  234. if (result == null) {
  235. serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
  236. .setSchemaDescriptor(new InfoServiceFileDescriptorSupplier())
  237. .addMethod(getWorkspaceInfoMethod())
  238. .build();
  239. }
  240. }
  241. }
  242. return result;
  243. }
  244. }