diff --git a/src/main/generated/io/vertx/mqtt/MqttClientOptionsConverter.java b/src/main/generated/io/vertx/mqtt/MqttClientOptionsConverter.java index 63eb15b0..cdab40ac 100644 --- a/src/main/generated/io/vertx/mqtt/MqttClientOptionsConverter.java +++ b/src/main/generated/io/vertx/mqtt/MqttClientOptionsConverter.java @@ -20,34 +20,24 @@ public class MqttClientOptionsConverter { static void fromJson(Iterable> json, MqttClientOptions obj) { for (java.util.Map.Entry member : json) { switch (member.getKey()) { - case "ackTimeout": - if (member.getValue() instanceof Number) { - obj.setAckTimeout(((Number)member.getValue()).intValue()); - } - break; - case "autoAck": - if (member.getValue() instanceof Boolean) { - obj.setAutoAck((Boolean)member.getValue()); - } - break; - case "autoGeneratedClientId": + case "cleanSession": if (member.getValue() instanceof Boolean) { - obj.setAutoGeneratedClientId((Boolean)member.getValue()); + obj.setCleanSession((Boolean)member.getValue()); } break; - case "autoKeepAlive": + case "willFlag": if (member.getValue() instanceof Boolean) { - obj.setAutoKeepAlive((Boolean)member.getValue()); + obj.setWillFlag((Boolean)member.getValue()); } break; - case "cleanSession": + case "willRetain": if (member.getValue() instanceof Boolean) { - obj.setCleanSession((Boolean)member.getValue()); + obj.setWillRetain((Boolean)member.getValue()); } break; - case "clientId": - if (member.getValue() instanceof String) { - obj.setClientId((String)member.getValue()); + case "willQoS": + if (member.getValue() instanceof Number) { + obj.setWillQoS(((Number)member.getValue()).intValue()); } break; case "keepAliveInterval": @@ -55,14 +45,9 @@ static void fromJson(Iterable> json, MqttCli obj.setKeepAliveInterval(((Number)member.getValue()).intValue()); } break; - case "maxInflightQueue": - if (member.getValue() instanceof Number) { - obj.setMaxInflightQueue(((Number)member.getValue()).intValue()); - } - break; - case "maxMessageSize": - if (member.getValue() instanceof Number) { - obj.setMaxMessageSize(((Number)member.getValue()).intValue()); + case "username": + if (member.getValue() instanceof String) { + obj.setUsername((String)member.getValue()); } break; case "password": @@ -70,14 +55,14 @@ static void fromJson(Iterable> json, MqttCli obj.setPassword((String)member.getValue()); } break; - case "username": + case "clientId": if (member.getValue() instanceof String) { - obj.setUsername((String)member.getValue()); + obj.setClientId((String)member.getValue()); } break; - case "willFlag": - if (member.getValue() instanceof Boolean) { - obj.setWillFlag((Boolean)member.getValue()); + case "willTopic": + if (member.getValue() instanceof String) { + obj.setWillTopic((String)member.getValue()); } break; case "willMessage": @@ -85,19 +70,34 @@ static void fromJson(Iterable> json, MqttCli obj.setWillMessage((String)member.getValue()); } break; - case "willQoS": + case "ackTimeout": if (member.getValue() instanceof Number) { - obj.setWillQoS(((Number)member.getValue()).intValue()); + obj.setAckTimeout(((Number)member.getValue()).intValue()); } break; - case "willRetain": + case "maxInflightQueue": + if (member.getValue() instanceof Number) { + obj.setMaxInflightQueue(((Number)member.getValue()).intValue()); + } + break; + case "autoKeepAlive": if (member.getValue() instanceof Boolean) { - obj.setWillRetain((Boolean)member.getValue()); + obj.setAutoKeepAlive((Boolean)member.getValue()); } break; - case "willTopic": - if (member.getValue() instanceof String) { - obj.setWillTopic((String)member.getValue()); + case "autoGeneratedClientId": + if (member.getValue() instanceof Boolean) { + obj.setAutoGeneratedClientId((Boolean)member.getValue()); + } + break; + case "autoAck": + if (member.getValue() instanceof Boolean) { + obj.setAutoAck((Boolean)member.getValue()); + } + break; + case "maxMessageSize": + if (member.getValue() instanceof Number) { + obj.setMaxMessageSize(((Number)member.getValue()).intValue()); } break; } @@ -109,31 +109,31 @@ static void toJson(MqttClientOptions obj, JsonObject json) { } static void toJson(MqttClientOptions obj, java.util.Map json) { - json.put("ackTimeout", obj.getAckTimeout()); - json.put("autoAck", obj.isAutoAck()); - json.put("autoGeneratedClientId", obj.isAutoGeneratedClientId()); - json.put("autoKeepAlive", obj.isAutoKeepAlive()); json.put("cleanSession", obj.isCleanSession()); - if (obj.getClientId() != null) { - json.put("clientId", obj.getClientId()); - } + json.put("willFlag", obj.isWillFlag()); + json.put("willRetain", obj.isWillRetain()); + json.put("willQoS", obj.getWillQoS()); json.put("keepAliveInterval", obj.getKeepAliveInterval()); - json.put("maxInflightQueue", obj.getMaxInflightQueue()); - json.put("maxMessageSize", obj.getMaxMessageSize()); - if (obj.getPassword() != null) { - json.put("password", obj.getPassword()); - } if (obj.getUsername() != null) { json.put("username", obj.getUsername()); } - json.put("willFlag", obj.isWillFlag()); - if (obj.getWillMessage() != null) { - json.put("willMessage", obj.getWillMessage()); + if (obj.getPassword() != null) { + json.put("password", obj.getPassword()); + } + if (obj.getClientId() != null) { + json.put("clientId", obj.getClientId()); } - json.put("willQoS", obj.getWillQoS()); - json.put("willRetain", obj.isWillRetain()); if (obj.getWillTopic() != null) { json.put("willTopic", obj.getWillTopic()); } + if (obj.getWillMessage() != null) { + json.put("willMessage", obj.getWillMessage()); + } + json.put("ackTimeout", obj.getAckTimeout()); + json.put("maxInflightQueue", obj.getMaxInflightQueue()); + json.put("autoKeepAlive", obj.isAutoKeepAlive()); + json.put("autoGeneratedClientId", obj.isAutoGeneratedClientId()); + json.put("autoAck", obj.isAutoAck()); + json.put("maxMessageSize", obj.getMaxMessageSize()); } } diff --git a/src/main/generated/io/vertx/mqtt/MqttServerOptionsConverter.java b/src/main/generated/io/vertx/mqtt/MqttServerOptionsConverter.java index 3522f720..b1a898bb 100644 --- a/src/main/generated/io/vertx/mqtt/MqttServerOptionsConverter.java +++ b/src/main/generated/io/vertx/mqtt/MqttServerOptionsConverter.java @@ -20,6 +20,11 @@ public class MqttServerOptionsConverter { static void fromJson(Iterable> json, MqttServerOptions obj) { for (java.util.Map.Entry member : json) { switch (member.getKey()) { + case "maxMessageSize": + if (member.getValue() instanceof Number) { + obj.setMaxMessageSize(((Number)member.getValue()).intValue()); + } + break; case "autoClientId": if (member.getValue() instanceof Boolean) { obj.setAutoClientId((Boolean)member.getValue()); @@ -30,34 +35,29 @@ static void fromJson(Iterable> json, MqttSer obj.setMaxClientIdLength(((Number)member.getValue()).intValue()); } break; - case "maxMessageSize": + case "timeoutOnConnect": if (member.getValue() instanceof Number) { - obj.setMaxMessageSize(((Number)member.getValue()).intValue()); - } - break; - case "perFrameWebSocketCompressionSupported": - if (member.getValue() instanceof Boolean) { - obj.setPerFrameWebSocketCompressionSupported((Boolean)member.getValue()); + obj.setTimeoutOnConnect(((Number)member.getValue()).intValue()); } break; - case "perMessageWebSocketCompressionSupported": + case "useWebSocket": if (member.getValue() instanceof Boolean) { - obj.setPerMessageWebSocketCompressionSupported((Boolean)member.getValue()); + obj.setUseWebSocket((Boolean)member.getValue()); } break; - case "timeoutOnConnect": + case "webSocketMaxFrameSize": if (member.getValue() instanceof Number) { - obj.setTimeoutOnConnect(((Number)member.getValue()).intValue()); + obj.setWebSocketMaxFrameSize(((Number)member.getValue()).intValue()); } break; - case "useWebSocket": + case "perFrameWebSocketCompressionSupported": if (member.getValue() instanceof Boolean) { - obj.setUseWebSocket((Boolean)member.getValue()); + obj.setPerFrameWebSocketCompressionSupported((Boolean)member.getValue()); } break; - case "webSocketAllowServerNoContext": + case "perMessageWebSocketCompressionSupported": if (member.getValue() instanceof Boolean) { - obj.setWebSocketAllowServerNoContext((Boolean)member.getValue()); + obj.setPerMessageWebSocketCompressionSupported((Boolean)member.getValue()); } break; case "webSocketCompressionLevel": @@ -65,9 +65,9 @@ static void fromJson(Iterable> json, MqttSer obj.setWebSocketCompressionLevel(((Number)member.getValue()).intValue()); } break; - case "webSocketMaxFrameSize": - if (member.getValue() instanceof Number) { - obj.setWebSocketMaxFrameSize(((Number)member.getValue()).intValue()); + case "webSocketAllowServerNoContext": + if (member.getValue() instanceof Boolean) { + obj.setWebSocketAllowServerNoContext((Boolean)member.getValue()); } break; case "webSocketPreferredClientNoContext": @@ -84,15 +84,15 @@ static void toJson(MqttServerOptions obj, JsonObject json) { } static void toJson(MqttServerOptions obj, java.util.Map json) { + json.put("maxMessageSize", obj.getMaxMessageSize()); json.put("autoClientId", obj.isAutoClientId()); json.put("maxClientIdLength", obj.getMaxClientIdLength()); - json.put("maxMessageSize", obj.getMaxMessageSize()); + json.put("useWebSocket", obj.isUseWebSocket()); + json.put("webSocketMaxFrameSize", obj.getWebSocketMaxFrameSize()); json.put("perFrameWebSocketCompressionSupported", obj.isPerFrameWebSocketCompressionSupported()); json.put("perMessageWebSocketCompressionSupported", obj.isPerMessageWebSocketCompressionSupported()); - json.put("useWebSocket", obj.isUseWebSocket()); - json.put("webSocketAllowServerNoContext", obj.isWebSocketAllowServerNoContext()); json.put("webSocketCompressionLevel", obj.getWebSocketCompressionLevel()); - json.put("webSocketMaxFrameSize", obj.getWebSocketMaxFrameSize()); + json.put("webSocketAllowServerNoContext", obj.isWebSocketAllowServerNoContext()); json.put("webSocketPreferredClientNoContext", obj.isWebSocketPreferredClientNoContext()); } } diff --git a/src/test/java/io/vertx/mqtt/test/server/MqttServerWebSocketPermessageDeflateTest.java b/src/test/java/io/vertx/mqtt/test/server/MqttServerWebSocketPermessageDeflateTest.java index adbde27d..f5938a53 100644 --- a/src/test/java/io/vertx/mqtt/test/server/MqttServerWebSocketPermessageDeflateTest.java +++ b/src/test/java/io/vertx/mqtt/test/server/MqttServerWebSocketPermessageDeflateTest.java @@ -47,8 +47,8 @@ public void testPermessageDeflate(TestContext context) { server.listen().onComplete(context.asyncAssertSuccess(s -> listen.complete())); listen.awaitSuccess(15_000); - vertx.createHttpClient() - .webSocket(new WebSocketConnectOptions() + vertx.createWebSocketClient() + .connect(new WebSocketConnectOptions() .setPort(MQTT_SERVER_PORT) .setHost(MQTT_SERVER_HOST) .setURI("/mqtt")