diff --git a/src/automation/.env.example b/src/automation/.env.example index 35c4e0b97f715c3c0a6ff961f209070eae547590..26cce5feea6e46f0a48e7d23f2e98c746e233d0f 100644 --- a/src/automation/.env.example +++ b/src/automation/.env.example @@ -1,5 +1,8 @@ # Define the host for the Context Service -quarkus.kubernetes.env.vars.context-service-host=context +quarkus.kubernetes.env.vars.context-service-host=ContextService # Define the host for the Device Service -quarkus.kubernetes.env.vars.device-service-host=device \ No newline at end of file +quarkus.kubernetes.env.vars.device-service-host=DeviceService + +# Define the host for the Health Service +quarkus.kubernetes.env.vars.health-service-host=ContextService \ No newline at end of file diff --git a/src/automation/src/main/java/eu/teraflow/automation/ContextHealthCheck.java b/src/automation/src/main/java/eu/teraflow/automation/ContextHealthCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..ada29539d29234f981b9062c75723eb045ebf073 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/ContextHealthCheck.java @@ -0,0 +1,9 @@ +package eu.teraflow.automation; + +import grpc.health.v1.HealthOuterClass; +import io.smallrye.mutiny.Uni; + +public interface ContextHealthCheck { + + Uni<HealthOuterClass.HealthCheckResponse> getServingStatus(); +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/ContextHealthCheckImpl.java b/src/automation/src/main/java/eu/teraflow/automation/ContextHealthCheckImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..03cd6b08cd3872260693a85f9e3f6120f4ca833f --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/ContextHealthCheckImpl.java @@ -0,0 +1,36 @@ +package eu.teraflow.automation; + +import grpc.health.v1.Health; +import grpc.health.v1.HealthOuterClass; +import io.quarkus.grpc.GrpcClient; +import io.smallrye.mutiny.Uni; +import javax.enterprise.context.ApplicationScoped; +import org.jboss.logging.Logger; + +@ApplicationScoped +public class ContextHealthCheckImpl implements ContextHealthCheck { + + private static final Logger LOGGER = Logger.getLogger(ContextHealthCheckImpl.class); + + @GrpcClient("health") + Health healthDelegate; + + @Override + public Uni<HealthOuterClass.HealthCheckResponse> getServingStatus() { + + final var request = + HealthOuterClass.HealthCheckRequest.newBuilder().setService("ContextService").build(); + + final var healthCheckResponseUni = healthDelegate.check(request); + + healthCheckResponseUni + .subscribe() + .with( + healthCheckResponse -> { + final var status = healthCheckResponse.getStatus(); + LOGGER.infof("HEALTH STATUS OF CONTEXT IS: %s", status); + }); + + return healthCheckResponseUni; + } +} diff --git a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java b/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java index cedbce546d400a10f6cd3334d3fc443b430db3b4..315c9f92f5fad33fdac9a0c92270d0f0b0a3a43d 100644 --- a/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java +++ b/src/automation/src/main/java/eu/teraflow/automation/ContextSubscriber.java @@ -2,8 +2,10 @@ package eu.teraflow.automation; import eu.teraflow.automation.context.ContextService; import eu.teraflow.automation.device.model.DeviceEvent; +import grpc.health.v1.HealthOuterClass; import io.quarkus.runtime.StartupEvent; import io.smallrye.mutiny.Multi; +import java.time.Duration; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.event.Observes; import javax.inject.Inject; @@ -17,19 +19,30 @@ public class ContextSubscriber { private final ContextService contextService; private final AutomationService automationService; private final AutomationConfiguration automationConfiguration; + private final ContextHealthCheck healthCheck; @Inject public ContextSubscriber( ContextService contextService, AutomationService automationService, - AutomationConfiguration automationConfiguration) { + AutomationConfiguration automationConfiguration, + ContextHealthCheck healthCheck) { this.contextService = contextService; this.automationService = automationService; this.automationConfiguration = automationConfiguration; + this.healthCheck = healthCheck; } public void listenForDeviceEvents() { - Multi<DeviceEvent> deviceEventsMulti = contextService.getDeviceEvents(); + // TODO: Exponential backoff retry policy + Multi<DeviceEvent> deviceEventsMulti = + contextService + .getDeviceEvents() + .onFailure() + .retry() + .withBackOff(Duration.ofSeconds(1)) + .withJitter(0.2) + .atMost(10); deviceEventsMulti .onItem() @@ -39,11 +52,24 @@ public class ContextSubscriber { void onStart(@Observes StartupEvent ev) { - if (automationConfiguration.shouldSubscribeToContextComponent()) { - LOGGER.info("Listening for Device events..."); - listenForDeviceEvents(); - } else { - LOGGER.info("Not listening for Device events..."); - } + final var healthCheckResponseUni = healthCheck.getServingStatus(); + + healthCheckResponseUni + .subscribe() + .with( + healthCheckResponse -> { + final var status = healthCheckResponse.getStatus().toString(); + LOGGER.infof("HEALTH STATUS is: %s", status); + final var expectedStatus = + HealthOuterClass.HealthCheckResponse.ServingStatus.SERVING.toString(); + + if (automationConfiguration.shouldSubscribeToContextComponent() + && status.equals(expectedStatus)) { + LOGGER.info("Listening for Device events..."); + listenForDeviceEvents(); + } else { + LOGGER.info("Not listening for Device events..."); + } + }); } } diff --git a/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java b/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java new file mode 100644 index 0000000000000000000000000000000000000000..77cbffac886e68e9b387322f973d75006b8eb1c6 --- /dev/null +++ b/src/automation/src/main/java/eu/teraflow/automation/SimpleReadinessCheck.java @@ -0,0 +1,58 @@ +package eu.teraflow.automation; + +import grpc.health.v1.HealthOuterClass; +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import org.eclipse.microprofile.health.HealthCheck; +import org.eclipse.microprofile.health.HealthCheckResponse; +import org.eclipse.microprofile.health.HealthCheckResponseBuilder; +import org.eclipse.microprofile.health.Readiness; +import org.jboss.logging.Logger; + +@Readiness +@ApplicationScoped +public class SimpleReadinessCheck implements HealthCheck { + + private static final Logger LOGGER = Logger.getLogger(SimpleReadinessCheck.class); + private final ContextHealthCheck healthCheck; + + @Inject + public SimpleReadinessCheck(ContextHealthCheck healthCheck) { + this.healthCheck = healthCheck; + } + + @Override + public HealthCheckResponse call() { + + HealthCheckResponseBuilder responseBuilder = + HealthCheckResponse.named("Context service health check"); + + try { + checkContextServiceConnection(); + responseBuilder.up(); + } catch (IllegalStateException e) { + responseBuilder.down(); + } + + return responseBuilder.build(); + } + + private void checkContextServiceConnection() { + + final var healthCheckResponseUni = healthCheck.getServingStatus(); + + healthCheckResponseUni + .subscribe() + .with( + healthCheckResponse -> { + final var status = healthCheckResponse.getStatus().toString(); + LOGGER.infof("HEALTH STATUS is: %s", status); + final var expectedStatus = + HealthOuterClass.HealthCheckResponse.ServingStatus.SERVING.toString(); + + if (!status.equals(expectedStatus)) { + throw new IllegalStateException("Cannot contact context service"); + } + }); + } +} diff --git a/src/automation/src/main/proto/health.proto b/src/automation/src/main/proto/health.proto new file mode 120000 index 0000000000000000000000000000000000000000..1f420774aec59b7212b0653311cf5770b6142388 --- /dev/null +++ b/src/automation/src/main/proto/health.proto @@ -0,0 +1 @@ +../../../../../proto/health.proto \ No newline at end of file diff --git a/src/automation/src/main/resources/application.yaml b/src/automation/src/main/resources/application.yaml index 2ea1ef12a279b6e94ab7aa2eff1dacb7020c7ac2..4fbd8d87aa75c59320ff355c45679b96e70f1835 100644 --- a/src/automation/src/main/resources/application.yaml +++ b/src/automation/src/main/resources/application.yaml @@ -10,6 +10,9 @@ quarkus: host: ${quarkus.kubernetes.env.vars.context-service-host} device: host: ${quarkus.kubernetes.env.vars.device-service-host} + health: + host: ${quarkus.kubernetes.env.vars.health-service-host} + port: 1010 http: port: 8080 container-image: @@ -38,5 +41,6 @@ quarkus: container-port: 9999 env: vars: - context-service-host: context - device-service-host: device \ No newline at end of file + context-service-host: ContextService + device-service-host: DeviceService + health-service-host: ContextService \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/grpc/health/v1/Health.java b/src/automation/target/generated-sources/grpc/grpc/health/v1/Health.java new file mode 100644 index 0000000000000000000000000000000000000000..eab8513ed534e1bf9120fc7edbc4ce398dc9cd3e --- /dev/null +++ b/src/automation/target/generated-sources/grpc/grpc/health/v1/Health.java @@ -0,0 +1,18 @@ +package grpc.health.v1; + +import io.quarkus.grpc.runtime.MutinyService; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: health.proto") +public interface Health extends MutinyService { + + + io.smallrye.mutiny.Uni<grpc.health.v1.HealthOuterClass.HealthCheckResponse> check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request); + + + io.smallrye.mutiny.Multi<grpc.health.v1.HealthOuterClass.HealthCheckResponse> watch(grpc.health.v1.HealthOuterClass.HealthCheckRequest request); + + + +} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthBean.java b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthBean.java new file mode 100644 index 0000000000000000000000000000000000000000..b2beb9c7ca6efb54ccf3aa7f5b52c299eaf81926 --- /dev/null +++ b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthBean.java @@ -0,0 +1,36 @@ +package grpc.health.v1; + +import io.grpc.BindableService; +import io.quarkus.grpc.GrpcService; +import io.quarkus.grpc.runtime.MutinyBean; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: health.proto") +public class HealthBean extends MutinyHealthGrpc.HealthImplBase implements BindableService, MutinyBean { + + private final Health delegate; + + HealthBean(@GrpcService Health delegate) { + this.delegate = delegate; + } + + @Override + public io.smallrye.mutiny.Uni<grpc.health.v1.HealthOuterClass.HealthCheckResponse> check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + try { + return delegate.check(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + + @Override + public io.smallrye.mutiny.Multi<grpc.health.v1.HealthOuterClass.HealthCheckResponse> watch(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + try { + return delegate.watch(request); + } catch (UnsupportedOperationException e) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + } + +} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthClient.java b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthClient.java new file mode 100644 index 0000000000000000000000000000000000000000..7fd39aa3f1f583352ffab2338ed08405079dfb4b --- /dev/null +++ b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthClient.java @@ -0,0 +1,33 @@ +package grpc.health.v1; + +import java.util.function.BiFunction; + +import io.quarkus.grpc.runtime.MutinyClient; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: health.proto") +public class HealthClient implements Health, MutinyClient<MutinyHealthGrpc.MutinyHealthStub> { + + private final MutinyHealthGrpc.MutinyHealthStub stub; + + public HealthClient(String name, io.grpc.Channel channel, BiFunction<String, MutinyHealthGrpc.MutinyHealthStub, MutinyHealthGrpc.MutinyHealthStub> stubConfigurator) { + this.stub = stubConfigurator.apply(name,MutinyHealthGrpc.newMutinyStub(channel)); + } + + @Override + public MutinyHealthGrpc.MutinyHealthStub getStub() { + return stub; + } + + @Override + public io.smallrye.mutiny.Uni<grpc.health.v1.HealthOuterClass.HealthCheckResponse> check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + return stub.check(request); + } + + @Override + public io.smallrye.mutiny.Multi<grpc.health.v1.HealthOuterClass.HealthCheckResponse> watch(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + return stub.watch(request); + } + +} \ No newline at end of file diff --git a/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthGrpc.java b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..3681cc9fa4a601bb09aa871122aead37335409ac --- /dev/null +++ b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthGrpc.java @@ -0,0 +1,342 @@ +package grpc.health.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.38.1)", + comments = "Source: health.proto") +public final class HealthGrpc { + + private HealthGrpc() {} + + public static final String SERVICE_NAME = "grpc.health.v1.Health"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor<grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse> getCheckMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Check", + requestType = grpc.health.v1.HealthOuterClass.HealthCheckRequest.class, + responseType = grpc.health.v1.HealthOuterClass.HealthCheckResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor<grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse> getCheckMethod() { + io.grpc.MethodDescriptor<grpc.health.v1.HealthOuterClass.HealthCheckRequest, grpc.health.v1.HealthOuterClass.HealthCheckResponse> getCheckMethod; + if ((getCheckMethod = HealthGrpc.getCheckMethod) == null) { + synchronized (HealthGrpc.class) { + if ((getCheckMethod = HealthGrpc.getCheckMethod) == null) { + HealthGrpc.getCheckMethod = getCheckMethod = + io.grpc.MethodDescriptor.<grpc.health.v1.HealthOuterClass.HealthCheckRequest, grpc.health.v1.HealthOuterClass.HealthCheckResponse>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Check")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + grpc.health.v1.HealthOuterClass.HealthCheckRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + grpc.health.v1.HealthOuterClass.HealthCheckResponse.getDefaultInstance())) + .setSchemaDescriptor(new HealthMethodDescriptorSupplier("Check")) + .build(); + } + } + } + return getCheckMethod; + } + + private static volatile io.grpc.MethodDescriptor<grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse> getWatchMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Watch", + requestType = grpc.health.v1.HealthOuterClass.HealthCheckRequest.class, + responseType = grpc.health.v1.HealthOuterClass.HealthCheckResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor<grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse> getWatchMethod() { + io.grpc.MethodDescriptor<grpc.health.v1.HealthOuterClass.HealthCheckRequest, grpc.health.v1.HealthOuterClass.HealthCheckResponse> getWatchMethod; + if ((getWatchMethod = HealthGrpc.getWatchMethod) == null) { + synchronized (HealthGrpc.class) { + if ((getWatchMethod = HealthGrpc.getWatchMethod) == null) { + HealthGrpc.getWatchMethod = getWatchMethod = + io.grpc.MethodDescriptor.<grpc.health.v1.HealthOuterClass.HealthCheckRequest, grpc.health.v1.HealthOuterClass.HealthCheckResponse>newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Watch")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + grpc.health.v1.HealthOuterClass.HealthCheckRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + grpc.health.v1.HealthOuterClass.HealthCheckResponse.getDefaultInstance())) + .setSchemaDescriptor(new HealthMethodDescriptorSupplier("Watch")) + .build(); + } + } + } + return getWatchMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static HealthStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<HealthStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<HealthStub>() { + @java.lang.Override + public HealthStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HealthStub(channel, callOptions); + } + }; + return HealthStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static HealthBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<HealthBlockingStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<HealthBlockingStub>() { + @java.lang.Override + public HealthBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HealthBlockingStub(channel, callOptions); + } + }; + return HealthBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static HealthFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory<HealthFutureStub> factory = + new io.grpc.stub.AbstractStub.StubFactory<HealthFutureStub>() { + @java.lang.Override + public HealthFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HealthFutureStub(channel, callOptions); + } + }; + return HealthFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class HealthImplBase implements io.grpc.BindableService { + + /** + */ + public void check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request, + io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCheckMethod(), responseObserver); + } + + /** + */ + public void watch(grpc.health.v1.HealthOuterClass.HealthCheckRequest request, + io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse> responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getWatchMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCheckMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse>( + this, METHODID_CHECK))) + .addMethod( + getWatchMethod(), + io.grpc.stub.ServerCalls.asyncServerStreamingCall( + new MethodHandlers< + grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse>( + this, METHODID_WATCH))) + .build(); + } + } + + /** + */ + public static final class HealthStub extends io.grpc.stub.AbstractAsyncStub<HealthStub> { + private HealthStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HealthStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HealthStub(channel, callOptions); + } + + /** + */ + public void check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request, + io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse> responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCheckMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void watch(grpc.health.v1.HealthOuterClass.HealthCheckRequest request, + io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse> responseObserver) { + io.grpc.stub.ClientCalls.asyncServerStreamingCall( + getChannel().newCall(getWatchMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class HealthBlockingStub extends io.grpc.stub.AbstractBlockingStub<HealthBlockingStub> { + private HealthBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HealthBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HealthBlockingStub(channel, callOptions); + } + + /** + */ + public grpc.health.v1.HealthOuterClass.HealthCheckResponse check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCheckMethod(), getCallOptions(), request); + } + + /** + */ + public java.util.Iterator<grpc.health.v1.HealthOuterClass.HealthCheckResponse> watch( + grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + return io.grpc.stub.ClientCalls.blockingServerStreamingCall( + getChannel(), getWatchMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class HealthFutureStub extends io.grpc.stub.AbstractFutureStub<HealthFutureStub> { + private HealthFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected HealthFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new HealthFutureStub(channel, callOptions); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture<grpc.health.v1.HealthOuterClass.HealthCheckResponse> check( + grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCheckMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_CHECK = 0; + private static final int METHODID_WATCH = 1; + + private static final class MethodHandlers<Req, Resp> implements + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { + private final HealthImplBase serviceImpl; + private final int methodId; + + MethodHandlers(HealthImplBase 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<Resp> responseObserver) { + switch (methodId) { + case METHODID_CHECK: + serviceImpl.check((grpc.health.v1.HealthOuterClass.HealthCheckRequest) request, + (io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse>) responseObserver); + break; + case METHODID_WATCH: + serviceImpl.watch((grpc.health.v1.HealthOuterClass.HealthCheckRequest) request, + (io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse>) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver<Req> invoke( + io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class HealthBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + HealthBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return grpc.health.v1.HealthOuterClass.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Health"); + } + } + + private static final class HealthFileDescriptorSupplier + extends HealthBaseDescriptorSupplier { + HealthFileDescriptorSupplier() {} + } + + private static final class HealthMethodDescriptorSupplier + extends HealthBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + HealthMethodDescriptorSupplier(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 (HealthGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new HealthFileDescriptorSupplier()) + .addMethod(getCheckMethod()) + .addMethod(getWatchMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthOuterClass.java b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthOuterClass.java new file mode 100644 index 0000000000000000000000000000000000000000..f3a3c5a0f9b81fa06996e6de840cef2b12f2abaa --- /dev/null +++ b/src/automation/target/generated-sources/grpc/grpc/health/v1/HealthOuterClass.java @@ -0,0 +1,1294 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: health.proto + +package grpc.health.v1; + +public final class HealthOuterClass { + private HealthOuterClass() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface HealthCheckRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:grpc.health.v1.HealthCheckRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>string service = 1;</code> + * @return The service. + */ + java.lang.String getService(); + /** + * <code>string service = 1;</code> + * @return The bytes for service. + */ + com.google.protobuf.ByteString + getServiceBytes(); + } + /** + * Protobuf type {@code grpc.health.v1.HealthCheckRequest} + */ + public static final class HealthCheckRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.health.v1.HealthCheckRequest) + HealthCheckRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use HealthCheckRequest.newBuilder() to construct. + private HealthCheckRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private HealthCheckRequest() { + service_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new HealthCheckRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HealthCheckRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + service_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + grpc.health.v1.HealthOuterClass.HealthCheckRequest.class, grpc.health.v1.HealthOuterClass.HealthCheckRequest.Builder.class); + } + + public static final int SERVICE_FIELD_NUMBER = 1; + private volatile java.lang.Object service_; + /** + * <code>string service = 1;</code> + * @return The service. + */ + @java.lang.Override + public java.lang.String getService() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } + } + /** + * <code>string service = 1;</code> + * @return The bytes for service. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getServiceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, service_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getServiceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, service_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof grpc.health.v1.HealthOuterClass.HealthCheckRequest)) { + return super.equals(obj); + } + grpc.health.v1.HealthOuterClass.HealthCheckRequest other = (grpc.health.v1.HealthOuterClass.HealthCheckRequest) obj; + + if (!getService() + .equals(other.getService())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + SERVICE_FIELD_NUMBER; + hash = (53 * hash) + getService().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(grpc.health.v1.HealthOuterClass.HealthCheckRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code grpc.health.v1.HealthCheckRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:grpc.health.v1.HealthCheckRequest) + grpc.health.v1.HealthOuterClass.HealthCheckRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + grpc.health.v1.HealthOuterClass.HealthCheckRequest.class, grpc.health.v1.HealthOuterClass.HealthCheckRequest.Builder.class); + } + + // Construct using grpc.health.v1.HealthOuterClass.HealthCheckRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + service_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckRequest_descriptor; + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckRequest getDefaultInstanceForType() { + return grpc.health.v1.HealthOuterClass.HealthCheckRequest.getDefaultInstance(); + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckRequest build() { + grpc.health.v1.HealthOuterClass.HealthCheckRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckRequest buildPartial() { + grpc.health.v1.HealthOuterClass.HealthCheckRequest result = new grpc.health.v1.HealthOuterClass.HealthCheckRequest(this); + result.service_ = service_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof grpc.health.v1.HealthOuterClass.HealthCheckRequest) { + return mergeFrom((grpc.health.v1.HealthOuterClass.HealthCheckRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(grpc.health.v1.HealthOuterClass.HealthCheckRequest other) { + if (other == grpc.health.v1.HealthOuterClass.HealthCheckRequest.getDefaultInstance()) return this; + if (!other.getService().isEmpty()) { + service_ = other.service_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + grpc.health.v1.HealthOuterClass.HealthCheckRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (grpc.health.v1.HealthOuterClass.HealthCheckRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object service_ = ""; + /** + * <code>string service = 1;</code> + * @return The service. + */ + public java.lang.String getService() { + java.lang.Object ref = service_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + service_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * <code>string service = 1;</code> + * @return The bytes for service. + */ + public com.google.protobuf.ByteString + getServiceBytes() { + java.lang.Object ref = service_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + service_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * <code>string service = 1;</code> + * @param value The service to set. + * @return This builder for chaining. + */ + public Builder setService( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + service_ = value; + onChanged(); + return this; + } + /** + * <code>string service = 1;</code> + * @return This builder for chaining. + */ + public Builder clearService() { + + service_ = getDefaultInstance().getService(); + onChanged(); + return this; + } + /** + * <code>string service = 1;</code> + * @param value The bytes for service to set. + * @return This builder for chaining. + */ + public Builder setServiceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + service_ = value; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grpc.health.v1.HealthCheckRequest) + } + + // @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckRequest) + private static final grpc.health.v1.HealthOuterClass.HealthCheckRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new grpc.health.v1.HealthOuterClass.HealthCheckRequest(); + } + + public static grpc.health.v1.HealthOuterClass.HealthCheckRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<HealthCheckRequest> + PARSER = new com.google.protobuf.AbstractParser<HealthCheckRequest>() { + @java.lang.Override + public HealthCheckRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HealthCheckRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<HealthCheckRequest> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<HealthCheckRequest> getParserForType() { + return PARSER; + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HealthCheckResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:grpc.health.v1.HealthCheckResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @return The status. + */ + grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus getStatus(); + } + /** + * Protobuf type {@code grpc.health.v1.HealthCheckResponse} + */ + public static final class HealthCheckResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:grpc.health.v1.HealthCheckResponse) + HealthCheckResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use HealthCheckResponse.newBuilder() to construct. + private HealthCheckResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { + super(builder); + } + private HealthCheckResponse() { + status_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new HealthCheckResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HealthCheckResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + status_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + grpc.health.v1.HealthOuterClass.HealthCheckResponse.class, grpc.health.v1.HealthOuterClass.HealthCheckResponse.Builder.class); + } + + /** + * Protobuf enum {@code grpc.health.v1.HealthCheckResponse.ServingStatus} + */ + public enum ServingStatus + implements com.google.protobuf.ProtocolMessageEnum { + /** + * <code>UNKNOWN = 0;</code> + */ + UNKNOWN(0), + /** + * <code>SERVING = 1;</code> + */ + SERVING(1), + /** + * <code>NOT_SERVING = 2;</code> + */ + NOT_SERVING(2), + /** + * <pre> + * Used only by the Watch method. + * </pre> + * + * <code>SERVICE_UNKNOWN = 3;</code> + */ + SERVICE_UNKNOWN(3), + UNRECOGNIZED(-1), + ; + + /** + * <code>UNKNOWN = 0;</code> + */ + public static final int UNKNOWN_VALUE = 0; + /** + * <code>SERVING = 1;</code> + */ + public static final int SERVING_VALUE = 1; + /** + * <code>NOT_SERVING = 2;</code> + */ + public static final int NOT_SERVING_VALUE = 2; + /** + * <pre> + * Used only by the Watch method. + * </pre> + * + * <code>SERVICE_UNKNOWN = 3;</code> + */ + public static final int SERVICE_UNKNOWN_VALUE = 3; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ServingStatus valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ServingStatus forNumber(int value) { + switch (value) { + case 0: return UNKNOWN; + case 1: return SERVING; + case 2: return NOT_SERVING; + case 3: return SERVICE_UNKNOWN; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap<ServingStatus> + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + ServingStatus> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap<ServingStatus>() { + public ServingStatus findValueByNumber(int number) { + return ServingStatus.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return grpc.health.v1.HealthOuterClass.HealthCheckResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final ServingStatus[] VALUES = values(); + + public static ServingStatus valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ServingStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:grpc.health.v1.HealthCheckResponse.ServingStatus) + } + + public static final int STATUS_FIELD_NUMBER = 1; + private int status_; + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @return The status. + */ + @java.lang.Override public grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus getStatus() { + @SuppressWarnings("deprecation") + grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus result = grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus.valueOf(status_); + return result == null ? grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (status_ != grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus.UNKNOWN.getNumber()) { + output.writeEnum(1, status_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus.UNKNOWN.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof grpc.health.v1.HealthOuterClass.HealthCheckResponse)) { + return super.equals(obj); + } + grpc.health.v1.HealthOuterClass.HealthCheckResponse other = (grpc.health.v1.HealthOuterClass.HealthCheckResponse) obj; + + if (status_ != other.status_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(grpc.health.v1.HealthOuterClass.HealthCheckResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code grpc.health.v1.HealthCheckResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements + // @@protoc_insertion_point(builder_implements:grpc.health.v1.HealthCheckResponse) + grpc.health.v1.HealthOuterClass.HealthCheckResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + grpc.health.v1.HealthOuterClass.HealthCheckResponse.class, grpc.health.v1.HealthOuterClass.HealthCheckResponse.Builder.class); + } + + // Construct using grpc.health.v1.HealthOuterClass.HealthCheckResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + status_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return grpc.health.v1.HealthOuterClass.internal_static_grpc_health_v1_HealthCheckResponse_descriptor; + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckResponse getDefaultInstanceForType() { + return grpc.health.v1.HealthOuterClass.HealthCheckResponse.getDefaultInstance(); + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckResponse build() { + grpc.health.v1.HealthOuterClass.HealthCheckResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckResponse buildPartial() { + grpc.health.v1.HealthOuterClass.HealthCheckResponse result = new grpc.health.v1.HealthOuterClass.HealthCheckResponse(this); + result.status_ = status_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof grpc.health.v1.HealthOuterClass.HealthCheckResponse) { + return mergeFrom((grpc.health.v1.HealthOuterClass.HealthCheckResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(grpc.health.v1.HealthOuterClass.HealthCheckResponse other) { + if (other == grpc.health.v1.HealthOuterClass.HealthCheckResponse.getDefaultInstance()) return this; + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + grpc.health.v1.HealthOuterClass.HealthCheckResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (grpc.health.v1.HealthOuterClass.HealthCheckResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int status_ = 0; + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @return The status. + */ + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus getStatus() { + @SuppressWarnings("deprecation") + grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus result = grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus.valueOf(status_); + return result == null ? grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus.UNRECOGNIZED : result; + } + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(grpc.health.v1.HealthOuterClass.HealthCheckResponse.ServingStatus value) { + if (value == null) { + throw new NullPointerException(); + } + + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + * <code>.grpc.health.v1.HealthCheckResponse.ServingStatus status = 1;</code> + * @return This builder for chaining. + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:grpc.health.v1.HealthCheckResponse) + } + + // @@protoc_insertion_point(class_scope:grpc.health.v1.HealthCheckResponse) + private static final grpc.health.v1.HealthOuterClass.HealthCheckResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new grpc.health.v1.HealthOuterClass.HealthCheckResponse(); + } + + public static grpc.health.v1.HealthOuterClass.HealthCheckResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser<HealthCheckResponse> + PARSER = new com.google.protobuf.AbstractParser<HealthCheckResponse>() { + @java.lang.Override + public HealthCheckResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HealthCheckResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser<HealthCheckResponse> parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser<HealthCheckResponse> getParserForType() { + return PARSER; + } + + @java.lang.Override + public grpc.health.v1.HealthOuterClass.HealthCheckResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_health_v1_HealthCheckRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_grpc_health_v1_HealthCheckResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\014health.proto\022\016grpc.health.v1\"%\n\022Health" + + "CheckRequest\022\017\n\007service\030\001 \001(\t\"\251\001\n\023Health" + + "CheckResponse\022A\n\006status\030\001 \001(\01621.grpc.hea" + + "lth.v1.HealthCheckResponse.ServingStatus" + + "\"O\n\rServingStatus\022\013\n\007UNKNOWN\020\000\022\013\n\007SERVIN" + + "G\020\001\022\017\n\013NOT_SERVING\020\002\022\023\n\017SERVICE_UNKNOWN\020" + + "\0032\256\001\n\006Health\022P\n\005Check\022\".grpc.health.v1.H" + + "ealthCheckRequest\032#.grpc.health.v1.Healt" + + "hCheckResponse\022R\n\005Watch\022\".grpc.health.v1" + + ".HealthCheckRequest\032#.grpc.health.v1.Hea" + + "lthCheckResponse0\001b\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_grpc_health_v1_HealthCheckRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_grpc_health_v1_HealthCheckRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_health_v1_HealthCheckRequest_descriptor, + new java.lang.String[] { "Service", }); + internal_static_grpc_health_v1_HealthCheckResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_grpc_health_v1_HealthCheckResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_grpc_health_v1_HealthCheckResponse_descriptor, + new java.lang.String[] { "Status", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/automation/target/generated-sources/grpc/grpc/health/v1/MutinyHealthGrpc.java b/src/automation/target/generated-sources/grpc/grpc/health/v1/MutinyHealthGrpc.java new file mode 100644 index 0000000000000000000000000000000000000000..37361c71febb98ae5503242c15c46e00c1585015 --- /dev/null +++ b/src/automation/target/generated-sources/grpc/grpc/health/v1/MutinyHealthGrpc.java @@ -0,0 +1,144 @@ +package grpc.health.v1; + +import static grpc.health.v1.HealthGrpc.getServiceDescriptor; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; + +@javax.annotation.Generated( +value = "by Mutiny Grpc generator", +comments = "Source: health.proto") +public final class MutinyHealthGrpc implements io.quarkus.grpc.runtime.MutinyGrpc { + private MutinyHealthGrpc() {} + + public static MutinyHealthStub newMutinyStub(io.grpc.Channel channel) { + return new MutinyHealthStub(channel); + } + + + public static final class MutinyHealthStub extends io.grpc.stub.AbstractStub<MutinyHealthStub> implements io.quarkus.grpc.runtime.MutinyStub { + private HealthGrpc.HealthStub delegateStub; + + private MutinyHealthStub(io.grpc.Channel channel) { + super(channel); + delegateStub = HealthGrpc.newStub(channel); + } + + private MutinyHealthStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + delegateStub = HealthGrpc.newStub(channel).build(channel, callOptions); + } + + @Override + protected MutinyHealthStub build(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new MutinyHealthStub(channel, callOptions); + } + + + public io.smallrye.mutiny.Uni<grpc.health.v1.HealthOuterClass.HealthCheckResponse> check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToOne(request, delegateStub::check); + } + + + public io.smallrye.mutiny.Multi<grpc.health.v1.HealthOuterClass.HealthCheckResponse> watch(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + return io.quarkus.grpc.runtime.ClientCalls.oneToMany(request, delegateStub::watch); + } + + } + + + public static abstract class HealthImplBase implements io.grpc.BindableService { + + private String compression; + /** + * Set whether the server will try to use a compressed response. + * + * @param compression the compression, e.g {@code gzip} + */ + public HealthImplBase withCompression(String compression) { + this.compression = compression; + return this; + } + + + + public io.smallrye.mutiny.Uni<grpc.health.v1.HealthOuterClass.HealthCheckResponse> check(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + + public io.smallrye.mutiny.Multi<grpc.health.v1.HealthOuterClass.HealthCheckResponse> watch(grpc.health.v1.HealthOuterClass.HealthCheckRequest request) { + throw new io.grpc.StatusRuntimeException(io.grpc.Status.UNIMPLEMENTED); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + grpc.health.v1.HealthGrpc.getCheckMethod(), + asyncUnaryCall( + new MethodHandlers< + grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse>( + this, METHODID_CHECK, compression))) + .addMethod( + grpc.health.v1.HealthGrpc.getWatchMethod(), + asyncServerStreamingCall( + new MethodHandlers< + grpc.health.v1.HealthOuterClass.HealthCheckRequest, + grpc.health.v1.HealthOuterClass.HealthCheckResponse>( + this, METHODID_WATCH, compression))) + .build(); + } + } + + private static final int METHODID_CHECK = 0; + private static final int METHODID_WATCH = 1; + + private static final class MethodHandlers<Req, Resp> implements + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { + private final HealthImplBase serviceImpl; + private final int methodId; + private final String compression; + + MethodHandlers(HealthImplBase serviceImpl, int methodId, String compression) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + this.compression = compression; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + case METHODID_CHECK: + io.quarkus.grpc.runtime.ServerCalls.oneToOne((grpc.health.v1.HealthOuterClass.HealthCheckRequest) request, + (io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse>) responseObserver, + compression, + serviceImpl::check); + break; + case METHODID_WATCH: + io.quarkus.grpc.runtime.ServerCalls.oneToMany((grpc.health.v1.HealthOuterClass.HealthCheckRequest) request, + (io.grpc.stub.StreamObserver<grpc.health.v1.HealthOuterClass.HealthCheckResponse>) responseObserver, + compression, + serviceImpl::watch); + break; + default: + throw new java.lang.AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver<Req> invoke(io.grpc.stub.StreamObserver<Resp> responseObserver) { + switch (methodId) { + default: + throw new java.lang.AssertionError(); + } + } + } + +} \ No newline at end of file diff --git a/src/automation/target/kubernetes/kubernetes.yml b/src/automation/target/kubernetes/kubernetes.yml index 51af1ccf1c1eb02d23adbe2954d3cd812704cc45..94afc42e8ef49b407064357a3cd945fc1e35f030 100644 --- a/src/automation/target/kubernetes/kubernetes.yml +++ b/src/automation/target/kubernetes/kubernetes.yml @@ -3,8 +3,8 @@ apiVersion: v1 kind: Service metadata: annotations: - app.quarkus.io/commit-id: 43db942bd5641ae293df75b65cd1eefd40b8085e - app.quarkus.io/build-timestamp: 2021-11-17 - 06:42:01 +0000 + app.quarkus.io/commit-id: 0876e43968e7ac69548362469107fc2d89c9f34f + app.quarkus.io/build-timestamp: 2021-11-18 - 12:21:48 +0000 labels: app.kubernetes.io/name: automationservice app.kubernetes.io/version: 0.0.1 @@ -27,8 +27,8 @@ apiVersion: apps/v1 kind: Deployment metadata: annotations: - app.quarkus.io/commit-id: 43db942bd5641ae293df75b65cd1eefd40b8085e - app.quarkus.io/build-timestamp: 2021-11-17 - 06:42:01 +0000 + app.quarkus.io/commit-id: 0876e43968e7ac69548362469107fc2d89c9f34f + app.quarkus.io/build-timestamp: 2021-11-18 - 12:21:48 +0000 labels: app: automationservice app.kubernetes.io/name: automationservice @@ -43,8 +43,8 @@ spec: template: metadata: annotations: - app.quarkus.io/commit-id: 43db942bd5641ae293df75b65cd1eefd40b8085e - app.quarkus.io/build-timestamp: 2021-11-17 - 06:42:01 +0000 + app.quarkus.io/commit-id: 0876e43968e7ac69548362469107fc2d89c9f34f + app.quarkus.io/build-timestamp: 2021-11-18 - 12:21:48 +0000 labels: app: automationservice app.kubernetes.io/name: automationservice @@ -57,9 +57,11 @@ spec: fieldRef: fieldPath: metadata.namespace - name: CONTEXT_SERVICE_HOST - value: context + value: ContextService + - name: HEALTH_SERVICE_HOST + value: ContextService - name: DEVICE_SERVICE_HOST - value: device + value: DeviceService image: registry.gitlab.com/teraflow-h2020/controller/automation:0.0.1 imagePullPolicy: Always livenessProbe: