From 5ba29ef4b307e3badeadc80e22283e6738e81266 Mon Sep 17 00:00:00 2001 From: Thomas Jaeckle Date: Mon, 27 Jun 2022 11:16:36 +0200 Subject: [PATCH] review: renamed ProxyActor in gateway to GatewayProxyActor Signed-off-by: Thomas Jaeckle --- .../{ProxyActor.java => GatewayProxyActor.java} | 13 +++++++------ .../proxy/actors/QueryThingsPerRequestActor.java | 3 ++- .../gateway/service/starter/GatewayRootActor.java | 6 +++--- 3 files changed, 12 insertions(+), 10 deletions(-) rename gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/{ProxyActor.java => GatewayProxyActor.java} (92%) diff --git a/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/ProxyActor.java b/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/GatewayProxyActor.java similarity index 92% rename from gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/ProxyActor.java rename to gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/GatewayProxyActor.java index 3593082b65..356ed808c6 100644 --- a/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/ProxyActor.java +++ b/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/GatewayProxyActor.java @@ -38,9 +38,9 @@ import akka.japi.pf.ReceiveBuilder; /** - * Abstract base implementation for a command proxy. + * A command proxy for the Ditto gateway. */ -public final class ProxyActor extends AbstractActor { +public final class GatewayProxyActor extends AbstractActor { /** * The name of this Actor in the ActorSystem. @@ -55,7 +55,8 @@ public final class ProxyActor extends AbstractActor { private final ActorRef statisticsActor; - ProxyActor(final ActorRef pubSubMediator, + @SuppressWarnings("unused") + private GatewayProxyActor(final ActorRef pubSubMediator, final ActorSelection devOpsCommandsActor, final ActorRef edgeCommandForwarder) { this.pubSubMediator = pubSubMediator; @@ -65,7 +66,7 @@ public final class ProxyActor extends AbstractActor { } /** - * Creates Akka configuration object Props for this ProxyActor. + * Creates Akka configuration object Props for this GatewayProxyActor. * * @param pubSubMediator the Pub/Sub mediator to use for subscribing for events. * @param devOpsCommandsActor the Actor ref to the local DevOpsCommandsActor. @@ -76,7 +77,7 @@ public static Props props(final ActorRef pubSubMediator, final ActorSelection devOpsCommandsActor, final ActorRef edgeCommandForwarder) { - return Props.create(ProxyActor.class, pubSubMediator, devOpsCommandsActor, edgeCommandForwarder); + return Props.create(GatewayProxyActor.class, pubSubMediator, devOpsCommandsActor, edgeCommandForwarder); } static boolean isLiveCommandOrEvent(final Signal signal) { @@ -129,7 +130,7 @@ public Receive createReceive() { .match(Command.class, this::forwardToCommandForwarder) /* Live Signals */ - .match(Signal.class, ProxyActor::isLiveCommandOrEvent, this::forwardToCommandForwarder) + .match(Signal.class, GatewayProxyActor::isLiveCommandOrEvent, this::forwardToCommandForwarder) .match(Status.Failure.class, failure -> { Throwable cause = failure.cause(); if (cause instanceof JsonRuntimeException) { diff --git a/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/QueryThingsPerRequestActor.java b/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/QueryThingsPerRequestActor.java index ee7f3a1b89..54a3a9ff2c 100644 --- a/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/QueryThingsPerRequestActor.java +++ b/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/proxy/actors/QueryThingsPerRequestActor.java @@ -131,7 +131,8 @@ public Receive createReceive() { .dittoHeaders(qtr.getDittoHeaders().toBuilder().responseRequired(true).build()) .selectedFields(selectedFieldsWithThingId) .build(); - // delegate to the ThingsAggregatorProxyActor which receives the results via a cluster stream: + // delegate to the ThingsAggregatorProxyActor via the command forwarder - + // which receives the results via a cluster stream: commandForwarderActor.tell(retrieveThings, getSelf()); } }) diff --git a/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/starter/GatewayRootActor.java b/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/starter/GatewayRootActor.java index 576782262b..1e41f592d7 100755 --- a/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/starter/GatewayRootActor.java +++ b/gateway/service/src/main/java/org/eclipse/ditto/gateway/service/starter/GatewayRootActor.java @@ -47,7 +47,7 @@ import org.eclipse.ditto.gateway.service.health.DittoStatusAndHealthProviderFactory; import org.eclipse.ditto.gateway.service.health.GatewayHttpReadinessCheck; import org.eclipse.ditto.gateway.service.health.StatusAndHealthProvider; -import org.eclipse.ditto.gateway.service.proxy.actors.ProxyActor; +import org.eclipse.ditto.gateway.service.proxy.actors.GatewayProxyActor; import org.eclipse.ditto.gateway.service.security.authentication.jwt.JwtAuthenticationFactory; import org.eclipse.ditto.gateway.service.security.authentication.jwt.JwtAuthenticationResultProvider; import org.eclipse.ditto.gateway.service.streaming.actors.StreamingActor; @@ -311,8 +311,8 @@ private ActorRef startProxyActor(final ActorRefFactory actorSystem, final ActorR final ActorSelection devOpsCommandsActor = actorSystem.actorSelection(DevOpsRoute.DEVOPS_COMMANDS_ACTOR_SELECTION); - return startChildActor(ProxyActor.ACTOR_NAME, - ProxyActor.props(pubSubMediator, devOpsCommandsActor, edgeCommandForwarder)); + return startChildActor(GatewayProxyActor.ACTOR_NAME, + GatewayProxyActor.props(pubSubMediator, devOpsCommandsActor, edgeCommandForwarder)); }