Skip to content

Commit

Permalink
style: apply prettier format
Browse files Browse the repository at this point in the history
  • Loading branch information
jgiovaresco committed Mar 26, 2024
1 parent d988f6b commit 4d1e36f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
Expand Up @@ -68,7 +68,8 @@ public abstract class AbstractWebSocketChannel implements Channel {
private static final int PING_DELAY = 5_000;
protected final String id = UUID.randomUUID().toString();
protected final Map<String, CommandHandler<? extends Command<?>, ? extends Reply<?>>> commandHandlers = new ConcurrentHashMap<>();
protected final Map<String, CommandAdapter<? extends Command<?>, ? extends Command<?>, ? extends Reply<?>>> commandAdapters = new ConcurrentHashMap<>();
protected final Map<String, CommandAdapter<? extends Command<?>, ? extends Command<?>, ? extends Reply<?>>> commandAdapters =
new ConcurrentHashMap<>();
protected final Map<String, ReplyAdapter<? extends Reply<?>, ? extends Reply<?>>> replyAdapters = new ConcurrentHashMap<>();
protected final Vertx vertx;
protected final WebSocketBase webSocket;
Expand Down Expand Up @@ -169,9 +170,8 @@ private <C extends Command<?>> void receiveCommand(final CompletableEmitter emit
}

Single<? extends Command<?>> commandObs;
CommandAdapter<Command<?>, Command<?>, Reply<?>> commandAdapter = (CommandAdapter<Command<?>, Command<?>, Reply<?>>) commandAdapters.get(
command.getType()
);
CommandAdapter<Command<?>, Command<?>, Reply<?>> commandAdapter =
(CommandAdapter<Command<?>, Command<?>, Reply<?>>) commandAdapters.get(command.getType());
if (commandAdapter != null) {
commandObs = commandAdapter.adapt(command);
} else {
Expand Down
Expand Up @@ -62,10 +62,11 @@ protected void replyHello(
)
.subscribe();
} else if (command.getType().equals(io.gravitee.exchange.api.websocket.protocol.legacy.hello.HelloCommand.COMMAND_TYPE)) {
io.gravitee.exchange.api.websocket.protocol.legacy.hello.HelloReply helloReply = new io.gravitee.exchange.api.websocket.protocol.legacy.hello.HelloReply(
command.getId(),
new io.gravitee.exchange.api.websocket.protocol.legacy.hello.HelloReplyPayload("targetId")
);
io.gravitee.exchange.api.websocket.protocol.legacy.hello.HelloReply helloReply =
new io.gravitee.exchange.api.websocket.protocol.legacy.hello.HelloReply(
command.getId(),
new io.gravitee.exchange.api.websocket.protocol.legacy.hello.HelloReplyPayload("targetId")
);
serverWebSocket
.writeBinaryMessage(
protocolAdapter.write(
Expand Down
Expand Up @@ -45,7 +45,8 @@ public class EmbeddedChannel implements ControllerChannel, ConnectorChannel {
private final String id = UUID.randomUUID().toString();
private final String targetId;
private final Map<String, CommandHandler<? extends Command<?>, ? extends Reply<?>>> commandHandlers = new ConcurrentHashMap<>();
protected final Map<String, CommandAdapter<? extends Command<?>, ? extends Command<?>, ? extends Reply<?>>> commandAdapters = new ConcurrentHashMap<>();
protected final Map<String, CommandAdapter<? extends Command<?>, ? extends Command<?>, ? extends Reply<?>>> commandAdapters =
new ConcurrentHashMap<>();
protected final Map<String, ReplyAdapter<? extends Reply<?>, ? extends Reply<?>>> replyAdapters = new ConcurrentHashMap<>();
private boolean active = false;

Expand Down
Expand Up @@ -29,7 +29,6 @@
import io.gravitee.exchange.api.controller.ExchangeController;
import io.gravitee.exchange.api.websocket.command.ExchangeSerDe;
import io.gravitee.exchange.api.websocket.protocol.ProtocolVersion;
import io.gravitee.exchange.controller.core.channel.primary.PrimaryChannelManager;
import io.gravitee.exchange.controller.websocket.auth.WebSocketControllerAuthentication;
import io.gravitee.exchange.controller.websocket.channel.WebSocketControllerChannel;
import io.vertx.rxjava3.core.Vertx;
Expand Down Expand Up @@ -66,17 +65,12 @@ public void handle(final RoutingContext routingContext) {
request
.toWebSocket()
.flatMapCompletable(webSocket -> {
List<CommandHandler<? extends Command<?>, ? extends Reply<?>>> commandHandlers = controllerCommandHandlersFactory.buildCommandHandlers(
controllerContext
);
List<CommandAdapter<? extends Command<?>, ? extends Command<?>, ? extends Reply<?>>> commandAdapters = controllerCommandHandlersFactory.buildCommandAdapters(
controllerContext,
protocolVersion
);
List<ReplyAdapter<? extends Reply<?>, ? extends Reply<?>>> replyAdapters = controllerCommandHandlersFactory.buildReplyAdapters(
controllerContext,
protocolVersion
);
List<CommandHandler<? extends Command<?>, ? extends Reply<?>>> commandHandlers =
controllerCommandHandlersFactory.buildCommandHandlers(controllerContext);
List<CommandAdapter<? extends Command<?>, ? extends Command<?>, ? extends Reply<?>>> commandAdapters =
controllerCommandHandlersFactory.buildCommandAdapters(controllerContext, protocolVersion);
List<ReplyAdapter<? extends Reply<?>, ? extends Reply<?>>> replyAdapters =
controllerCommandHandlersFactory.buildReplyAdapters(controllerContext, protocolVersion);

ControllerChannel websocketControllerChannel = new WebSocketControllerChannel(
commandHandlers,
Expand Down

0 comments on commit 4d1e36f

Please sign in to comment.