diff --git a/src/main/generated/io/vertx/redis/client/PoolOptionsConverter.java b/src/main/generated/io/vertx/redis/client/PoolOptionsConverter.java index 653724b6..78af21c7 100644 --- a/src/main/generated/io/vertx/redis/client/PoolOptionsConverter.java +++ b/src/main/generated/io/vertx/redis/client/PoolOptionsConverter.java @@ -20,6 +20,11 @@ public class PoolOptionsConverter { public static void fromJson(Iterable> json, PoolOptions obj) { for (java.util.Map.Entry member : json) { switch (member.getKey()) { + case "name": + if (member.getValue() instanceof String) { + obj.setName((String)member.getValue()); + } + break; case "cleanerInterval": if (member.getValue() instanceof Number) { obj.setCleanerInterval(((Number)member.getValue()).intValue()); @@ -35,11 +40,6 @@ public static void fromJson(Iterable> json, obj.setMaxWaiting(((Number)member.getValue()).intValue()); } break; - case "name": - if (member.getValue() instanceof String) { - obj.setName((String)member.getValue()); - } - break; case "recycleTimeout": if (member.getValue() instanceof Number) { obj.setRecycleTimeout(((Number)member.getValue()).intValue()); @@ -54,12 +54,12 @@ public static void toJson(PoolOptions obj, JsonObject json) { } public static void toJson(PoolOptions obj, java.util.Map json) { - json.put("cleanerInterval", obj.getCleanerInterval()); - json.put("maxSize", obj.getMaxSize()); - json.put("maxWaiting", obj.getMaxWaiting()); if (obj.getName() != null) { json.put("name", obj.getName()); } + json.put("cleanerInterval", obj.getCleanerInterval()); + json.put("maxSize", obj.getMaxSize()); + json.put("maxWaiting", obj.getMaxWaiting()); json.put("recycleTimeout", obj.getRecycleTimeout()); } } diff --git a/src/main/generated/io/vertx/redis/client/RedisConnectOptionsConverter.java b/src/main/generated/io/vertx/redis/client/RedisConnectOptionsConverter.java index 154d8119..20d4f4d2 100644 --- a/src/main/generated/io/vertx/redis/client/RedisConnectOptionsConverter.java +++ b/src/main/generated/io/vertx/redis/client/RedisConnectOptionsConverter.java @@ -20,34 +20,44 @@ public class RedisConnectOptionsConverter { public static void fromJson(Iterable> json, RedisConnectOptions obj) { for (java.util.Map.Entry member : json) { switch (member.getKey()) { - case "connectionString": + case "maxNestedArrays": + if (member.getValue() instanceof Number) { + obj.setMaxNestedArrays(((Number)member.getValue()).intValue()); + } + break; + case "protocolNegotiation": + if (member.getValue() instanceof Boolean) { + obj.setProtocolNegotiation((Boolean)member.getValue()); + } + break; + case "password": if (member.getValue() instanceof String) { - obj.setConnectionString((String)member.getValue()); + obj.setPassword((String)member.getValue()); } break; - case "connectionStrings": + case "endpoints": if (member.getValue() instanceof JsonArray) { + java.util.ArrayList list = new java.util.ArrayList<>(); ((Iterable)member.getValue()).forEach( item -> { if (item instanceof String) - obj.addConnectionString((String)item); + list.add((String)item); }); + obj.setEndpoints(list); } break; case "endpoint": break; - case "endpoints": + case "connectionStrings": if (member.getValue() instanceof JsonArray) { - java.util.ArrayList list = new java.util.ArrayList<>(); ((Iterable)member.getValue()).forEach( item -> { if (item instanceof String) - list.add((String)item); + obj.addConnectionString((String)item); }); - obj.setEndpoints(list); } break; - case "maxNestedArrays": - if (member.getValue() instanceof Number) { - obj.setMaxNestedArrays(((Number)member.getValue()).intValue()); + case "connectionString": + if (member.getValue() instanceof String) { + obj.setConnectionString((String)member.getValue()); } break; case "maxWaitingHandlers": @@ -55,16 +65,6 @@ public static void fromJson(Iterable> json, obj.setMaxWaitingHandlers(((Number)member.getValue()).intValue()); } break; - case "password": - if (member.getValue() instanceof String) { - obj.setPassword((String)member.getValue()); - } - break; - case "protocolNegotiation": - if (member.getValue() instanceof Boolean) { - obj.setProtocolNegotiation((Boolean)member.getValue()); - } - break; } } } @@ -74,19 +74,19 @@ public static void toJson(RedisConnectOptions obj, JsonObject json) { } public static void toJson(RedisConnectOptions obj, java.util.Map json) { - if (obj.getEndpoint() != null) { - json.put("endpoint", obj.getEndpoint()); + json.put("maxNestedArrays", obj.getMaxNestedArrays()); + json.put("protocolNegotiation", obj.isProtocolNegotiation()); + if (obj.getPassword() != null) { + json.put("password", obj.getPassword()); } if (obj.getEndpoints() != null) { JsonArray array = new JsonArray(); obj.getEndpoints().forEach(item -> array.add(item)); json.put("endpoints", array); } - json.put("maxNestedArrays", obj.getMaxNestedArrays()); - json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers()); - if (obj.getPassword() != null) { - json.put("password", obj.getPassword()); + if (obj.getEndpoint() != null) { + json.put("endpoint", obj.getEndpoint()); } - json.put("protocolNegotiation", obj.isProtocolNegotiation()); + json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers()); } } diff --git a/src/main/generated/io/vertx/redis/client/RedisOptionsConverter.java b/src/main/generated/io/vertx/redis/client/RedisOptionsConverter.java index 7d00ea23..9ce11de8 100644 --- a/src/main/generated/io/vertx/redis/client/RedisOptionsConverter.java +++ b/src/main/generated/io/vertx/redis/client/RedisOptionsConverter.java @@ -20,17 +20,24 @@ public class RedisOptionsConverter { public static void fromJson(Iterable> json, RedisOptions obj) { for (java.util.Map.Entry member : json) { switch (member.getKey()) { - case "connectionString": + case "type": if (member.getValue() instanceof String) { - obj.setConnectionString((String)member.getValue()); + obj.setType(io.vertx.redis.client.RedisClientType.valueOf((String)member.getValue())); } break; - case "connectionStrings": + case "netClientOptions": + if (member.getValue() instanceof JsonObject) { + obj.setNetClientOptions(new io.vertx.core.net.NetClientOptions((io.vertx.core.json.JsonObject)member.getValue())); + } + break; + case "endpoints": if (member.getValue() instanceof JsonArray) { + java.util.ArrayList list = new java.util.ArrayList<>(); ((Iterable)member.getValue()).forEach( item -> { if (item instanceof String) - obj.addConnectionString((String)item); + list.add((String)item); }); + obj.setEndpoints(list); } break; case "endpoint": @@ -38,49 +45,47 @@ public static void fromJson(Iterable> json, obj.setEndpoint((String)member.getValue()); } break; - case "endpoints": + case "connectionStrings": if (member.getValue() instanceof JsonArray) { - java.util.ArrayList list = new java.util.ArrayList<>(); ((Iterable)member.getValue()).forEach( item -> { if (item instanceof String) - list.add((String)item); + obj.addConnectionString((String)item); }); - obj.setEndpoints(list); } break; - case "masterName": + case "connectionString": if (member.getValue() instanceof String) { - obj.setMasterName((String)member.getValue()); + obj.setConnectionString((String)member.getValue()); } break; - case "maxNestedArrays": + case "maxWaitingHandlers": if (member.getValue() instanceof Number) { - obj.setMaxNestedArrays(((Number)member.getValue()).intValue()); + obj.setMaxWaitingHandlers(((Number)member.getValue()).intValue()); } break; - case "maxPoolSize": - if (member.getValue() instanceof Number) { - obj.setMaxPoolSize(((Number)member.getValue()).intValue()); + case "masterName": + if (member.getValue() instanceof String) { + obj.setMasterName((String)member.getValue()); } break; - case "maxPoolWaiting": - if (member.getValue() instanceof Number) { - obj.setMaxPoolWaiting(((Number)member.getValue()).intValue()); + case "role": + if (member.getValue() instanceof String) { + obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue())); } break; - case "maxWaitingHandlers": - if (member.getValue() instanceof Number) { - obj.setMaxWaitingHandlers(((Number)member.getValue()).intValue()); + case "useReplicas": + if (member.getValue() instanceof String) { + obj.setUseReplicas(io.vertx.redis.client.RedisReplicas.valueOf((String)member.getValue())); } break; - case "netClientOptions": - if (member.getValue() instanceof JsonObject) { - obj.setNetClientOptions(new io.vertx.core.net.NetClientOptions((io.vertx.core.json.JsonObject)member.getValue())); + case "maxNestedArrays": + if (member.getValue() instanceof Number) { + obj.setMaxNestedArrays(((Number)member.getValue()).intValue()); } break; - case "password": + case "tracingPolicy": if (member.getValue() instanceof String) { - obj.setPassword((String)member.getValue()); + obj.setTracingPolicy(io.vertx.core.tracing.TracingPolicy.valueOf((String)member.getValue())); } break; case "poolCleanerInterval": @@ -88,39 +93,34 @@ public static void fromJson(Iterable> json, obj.setPoolCleanerInterval(((Number)member.getValue()).intValue()); } break; - case "poolName": - if (member.getValue() instanceof String) { - obj.setPoolName((String)member.getValue()); - } - break; - case "poolRecycleTimeout": + case "maxPoolSize": if (member.getValue() instanceof Number) { - obj.setPoolRecycleTimeout(((Number)member.getValue()).intValue()); + obj.setMaxPoolSize(((Number)member.getValue()).intValue()); } break; - case "protocolNegotiation": - if (member.getValue() instanceof Boolean) { - obj.setProtocolNegotiation((Boolean)member.getValue()); + case "maxPoolWaiting": + if (member.getValue() instanceof Number) { + obj.setMaxPoolWaiting(((Number)member.getValue()).intValue()); } break; - case "role": - if (member.getValue() instanceof String) { - obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue())); + case "poolRecycleTimeout": + if (member.getValue() instanceof Number) { + obj.setPoolRecycleTimeout(((Number)member.getValue()).intValue()); } break; - case "tracingPolicy": + case "password": if (member.getValue() instanceof String) { - obj.setTracingPolicy(io.vertx.core.tracing.TracingPolicy.valueOf((String)member.getValue())); + obj.setPassword((String)member.getValue()); } break; - case "type": - if (member.getValue() instanceof String) { - obj.setType(io.vertx.redis.client.RedisClientType.valueOf((String)member.getValue())); + case "protocolNegotiation": + if (member.getValue() instanceof Boolean) { + obj.setProtocolNegotiation((Boolean)member.getValue()); } break; - case "useReplicas": + case "poolName": if (member.getValue() instanceof String) { - obj.setUseReplicas(io.vertx.redis.client.RedisReplicas.valueOf((String)member.getValue())); + obj.setPoolName((String)member.getValue()); } break; } @@ -132,44 +132,44 @@ public static void toJson(RedisOptions obj, JsonObject json) { } public static void toJson(RedisOptions obj, java.util.Map json) { - if (obj.getEndpoint() != null) { - json.put("endpoint", obj.getEndpoint()); + if (obj.getType() != null) { + json.put("type", obj.getType().name()); + } + if (obj.getNetClientOptions() != null) { + json.put("netClientOptions", obj.getNetClientOptions().toJson()); } if (obj.getEndpoints() != null) { JsonArray array = new JsonArray(); obj.getEndpoints().forEach(item -> array.add(item)); json.put("endpoints", array); } + if (obj.getEndpoint() != null) { + json.put("endpoint", obj.getEndpoint()); + } + json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers()); if (obj.getMasterName() != null) { json.put("masterName", obj.getMasterName()); } + if (obj.getRole() != null) { + json.put("role", obj.getRole().name()); + } + if (obj.getUseReplicas() != null) { + json.put("useReplicas", obj.getUseReplicas().name()); + } json.put("maxNestedArrays", obj.getMaxNestedArrays()); + if (obj.getTracingPolicy() != null) { + json.put("tracingPolicy", obj.getTracingPolicy().name()); + } + json.put("poolCleanerInterval", obj.getPoolCleanerInterval()); json.put("maxPoolSize", obj.getMaxPoolSize()); json.put("maxPoolWaiting", obj.getMaxPoolWaiting()); - json.put("maxWaitingHandlers", obj.getMaxWaitingHandlers()); - if (obj.getNetClientOptions() != null) { - json.put("netClientOptions", obj.getNetClientOptions().toJson()); - } + json.put("poolRecycleTimeout", obj.getPoolRecycleTimeout()); if (obj.getPassword() != null) { json.put("password", obj.getPassword()); } - json.put("poolCleanerInterval", obj.getPoolCleanerInterval()); + json.put("protocolNegotiation", obj.isProtocolNegotiation()); if (obj.getPoolName() != null) { json.put("poolName", obj.getPoolName()); } - json.put("poolRecycleTimeout", obj.getPoolRecycleTimeout()); - json.put("protocolNegotiation", obj.isProtocolNegotiation()); - if (obj.getRole() != null) { - json.put("role", obj.getRole().name()); - } - if (obj.getTracingPolicy() != null) { - json.put("tracingPolicy", obj.getTracingPolicy().name()); - } - if (obj.getType() != null) { - json.put("type", obj.getType().name()); - } - if (obj.getUseReplicas() != null) { - json.put("useReplicas", obj.getUseReplicas().name()); - } } } diff --git a/src/main/generated/io/vertx/redis/client/RedisSentinelConnectOptionsConverter.java b/src/main/generated/io/vertx/redis/client/RedisSentinelConnectOptionsConverter.java index 7ef7a1b8..ccf9b0fd 100644 --- a/src/main/generated/io/vertx/redis/client/RedisSentinelConnectOptionsConverter.java +++ b/src/main/generated/io/vertx/redis/client/RedisSentinelConnectOptionsConverter.java @@ -20,14 +20,14 @@ public class RedisSentinelConnectOptionsConverter { public static void fromJson(Iterable> json, RedisSentinelConnectOptions obj) { for (java.util.Map.Entry member : json) { switch (member.getKey()) { - case "masterName": + case "role": if (member.getValue() instanceof String) { - obj.setMasterName((String)member.getValue()); + obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue())); } break; - case "role": + case "masterName": if (member.getValue() instanceof String) { - obj.setRole(io.vertx.redis.client.RedisRole.valueOf((String)member.getValue())); + obj.setMasterName((String)member.getValue()); } break; } @@ -39,11 +39,11 @@ public static void toJson(RedisSentinelConnectOptions obj, JsonObject json) { } public static void toJson(RedisSentinelConnectOptions obj, java.util.Map json) { - if (obj.getMasterName() != null) { - json.put("masterName", obj.getMasterName()); - } if (obj.getRole() != null) { json.put("role", obj.getRole().name()); } + if (obj.getMasterName() != null) { + json.put("masterName", obj.getMasterName()); + } } } diff --git a/src/main/java/io/vertx/redis/client/impl/RedisConnectionManager.java b/src/main/java/io/vertx/redis/client/impl/RedisConnectionManager.java index f95a05f4..c7a8130e 100644 --- a/src/main/java/io/vertx/redis/client/impl/RedisConnectionManager.java +++ b/src/main/java/io/vertx/redis/client/impl/RedisConnectionManager.java @@ -18,7 +18,6 @@ import io.vertx.core.Future; import io.vertx.core.Handler; import io.vertx.core.impl.ContextInternal; -import io.vertx.core.impl.EventLoopContext; import io.vertx.core.impl.VertxInternal; import io.vertx.core.impl.future.PromiseInternal; import io.vertx.core.impl.logging.Logger; @@ -141,7 +140,7 @@ public boolean isValid(RedisConnectionInternal conn) { } @Override - public Future> connect(EventLoopContext ctx, Listener listener) { + public Future> connect(ContextInternal ctx, Listener listener) { // verify if we can make this connection final boolean netClientSsl = netClientOptions.isSsl(); final boolean connectionStringSsl = redisURI.ssl(); @@ -327,9 +326,9 @@ private Future setup(ContextInternal ctx, RedisConnection connection, Requ public Future getConnection(String connectionString, Request setup) { final ContextInternal context = vertx.getOrCreateContext(); - final EventLoopContext eventLoopContext; - if (context instanceof EventLoopContext) { - eventLoopContext = (EventLoopContext) context; + final ContextInternal eventLoopContext; + if (context.isEventLoopContext()) { + eventLoopContext = context; } else { eventLoopContext = vertx.createEventLoopContext(context.nettyEventLoop(), context.workerPool(), context.classLoader()); }