diff --git a/src/main/java/org/project_kessel/relations/client/HealthClient.java b/src/main/java/org/project_kessel/relations/client/HealthClient.java deleted file mode 100644 index 10522cf..0000000 --- a/src/main/java/org/project_kessel/relations/client/HealthClient.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.project_kessel.relations.client; - -import java.util.logging.Logger; - -import io.grpc.Channel; -import org.project_kessel.api.relations.v1.GetLivezResponse; -import org.project_kessel.api.relations.v1.GetLivezRequest; -import org.project_kessel.api.relations.v1.GetReadyzResponse; -import org.project_kessel.api.relations.v1.GetReadyzRequest; -import org.project_kessel.api.relations.v1.KesselRelationsHealthServiceGrpc; -import org.project_kessel.clients.KesselClient; - -public class HealthClient extends KesselClient { - private static final Logger logger = Logger.getLogger(HealthClient.class.getName()); - - HealthClient(Channel channel) { - super(KesselRelationsHealthServiceGrpc.newStub(channel), KesselRelationsHealthServiceGrpc.newBlockingStub(channel)); - } - - public GetReadyzResponse readyz(GetReadyzRequest request) { - return blockingStub.getReadyz(request); - } - - public GetLivezResponse livez(GetLivezRequest request) { - return blockingStub.getLivez(request); - } -} diff --git a/src/main/java/org/project_kessel/relations/client/RelationsGrpcClientsManager.java b/src/main/java/org/project_kessel/relations/client/RelationsGrpcClientsManager.java index d28f1bc..e5a57c1 100644 --- a/src/main/java/org/project_kessel/relations/client/RelationsGrpcClientsManager.java +++ b/src/main/java/org/project_kessel/relations/client/RelationsGrpcClientsManager.java @@ -46,8 +46,4 @@ public RelationTuplesClient getRelationTuplesClient() { public LookupClient getLookupClient() { return new LookupClient(channel); } - - public HealthClient getHealthClient() { - return new HealthClient(channel); - } } diff --git a/src/main/java/org/project_kessel/relations/example/Caller.java b/src/main/java/org/project_kessel/relations/example/Caller.java index 56e32bf..d38608b 100644 --- a/src/main/java/org/project_kessel/relations/example/Caller.java +++ b/src/main/java/org/project_kessel/relations/example/Caller.java @@ -1,8 +1,6 @@ package org.project_kessel.relations.example; import org.project_kessel.api.relations.v1beta1.*; -import org.project_kessel.api.relations.v1.GetLivezRequest; -import org.project_kessel.api.relations.v1.GetReadyzRequest; import io.grpc.stub.StreamObserver; import io.smallrye.mutiny.Multi; import io.smallrye.mutiny.Uni; @@ -115,8 +113,6 @@ public void onCompleted() { }) .await().indefinitely(); - getLivezExample(); - getReadyzExample(); getRelationshipsExample(); lookupSubjectsExample(); lookupResourcesExample(); @@ -202,45 +198,6 @@ public void onCompleted() { } - public static void getLivezExample() { - var url = "localhost:9000"; - - var clientsManager = RelationsGrpcClientsManager.forInsecureClients(url); - var healthClient = clientsManager.getHealthClient(); - - var getLivezRequest = GetLivezRequest.newBuilder().build(); - - /* Blocking */ - var getLivezResponse = healthClient.livez(getLivezRequest); - var status = getLivezResponse.getStatus().equals("OK"); - - if (status) { - System.out.println("Blocking: OK"); - } else { - System.out.println("Blocking: Unavailable"); - } - } - - - public static void getReadyzExample() { - var url = "localhost:9000"; - - var clientsManager = RelationsGrpcClientsManager.forInsecureClients(url); - var healthClient = clientsManager.getHealthClient(); - - var getReadyzRequest = GetReadyzRequest.newBuilder().build(); - - /* Blocking */ - var getReadyzResponse = healthClient.readyz(getReadyzRequest); - var status = getReadyzResponse.getStatus().equals("OK"); - - if (status) { - System.out.println("Blocking: OK"); - } else { - System.out.println("Blocking: Unavailable"); - } - } - public static void lookupSubjectsExample() { var url = "localhost:9000";