Skip to content

Commit

Permalink
Adapt to latest WebSocket changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Sep 18, 2023
1 parent 0fb6d39 commit bf8134d
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 80 deletions.
112 changes: 56 additions & 56 deletions src/main/generated/io/vertx/mqtt/MqttClientOptionsConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,84 +20,84 @@ public class MqttClientOptionsConverter {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, MqttClientOptions obj) {
for (java.util.Map.Entry<String, Object> 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":
if (member.getValue() instanceof Number) {
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":
if (member.getValue() instanceof String) {
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":
if (member.getValue() instanceof String) {
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;
}
Expand All @@ -109,31 +109,31 @@ static void toJson(MqttClientOptions obj, JsonObject json) {
}

static void toJson(MqttClientOptions obj, java.util.Map<String, Object> 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());
}
}
44 changes: 22 additions & 22 deletions src/main/generated/io/vertx/mqtt/MqttServerOptionsConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public class MqttServerOptionsConverter {
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, MqttServerOptions obj) {
for (java.util.Map.Entry<String, Object> 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());
Expand All @@ -30,44 +35,39 @@ static void fromJson(Iterable<java.util.Map.Entry<String, Object>> 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":
if (member.getValue() instanceof Number) {
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":
Expand All @@ -84,15 +84,15 @@ static void toJson(MqttServerOptions obj, JsonObject json) {
}

static void toJson(MqttServerOptions obj, java.util.Map<String, Object> 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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit bf8134d

Please sign in to comment.