static void toJson(HttpServerOptions obj, java.util.Map<String, Object> json) { json.put("acceptUnmaskedFrames", obj.isAcceptUnmaskedFrames()); if (obj.getAlpnVersions() != null) { JsonArray array = new JsonArray(); obj.getAlpnVersions().forEach(item -> array.add(item.name())); json.put("alpnVersions", array); } json.put("compressionLevel", obj.getCompressionLevel()); json.put("compressionSupported", obj.isCompressionSupported()); json.put("decoderInitialBufferSize", obj.getDecoderInitialBufferSize()); json.put("decompressionSupported", obj.isDecompressionSupported()); json.put("handle100ContinueAutomatically", obj.isHandle100ContinueAutomatically()); json.put("http2ConnectionWindowSize", obj.getHttp2ConnectionWindowSize()); if (obj.getInitialSettings() != null) { json.put("initialSettings", obj.getInitialSettings().toJson()); } json.put("maxChunkSize", obj.getMaxChunkSize()); json.put("maxHeaderSize", obj.getMaxHeaderSize()); json.put("maxInitialLineLength", obj.getMaxInitialLineLength()); json.put("maxWebsocketFrameSize", obj.getMaxWebsocketFrameSize()); json.put("maxWebsocketMessageSize", obj.getMaxWebsocketMessageSize()); json.put("websocketAllowServerNoContext", obj.getWebsocketAllowServerNoContext()); json.put("websocketPreferredClientNoContext", obj.getWebsocketPreferredClientNoContext()); if (obj.getWebsocketSubProtocols() != null) { json.put("websocketSubProtocols", obj.getWebsocketSubProtocols()); } } }
((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof String) list.add(io.vertx.core.http.HttpVersion.valueOf((String)item)); }); obj.setAlpnVersions(list);
result = 31 * result + defaultHost.hashCode(); result = 31 * result + defaultPort; result = 31 * result + protocolVersion.hashCode(); result = 31 * result + maxChunkSize; result = 31 * result + maxWaitQueueSize;
int maxInitialLineLength = rand.nextInt(10000); int maxHeaderSize = rand.nextInt(10000); HttpVersion enabledProtocol = HttpVersion.values()[rand.nextInt(HttpVersion.values().length)]; Http2Settings initialSettings = TestUtils.randomHttp2Settings(); boolean useAlpn = TestUtils.randomBoolean(); int http2ConnectionWindowSize = TestUtils.randomInt(); String sslEngine = TestUtils.randomBoolean() ? "jdkSslEngineOptions" : "openSslEngineOptions"; List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean openSslSessionCacheEnabled = TestUtils.randomBoolean(); boolean decompressionSupported = TestUtils.randomBoolean(); .put("maxInitialLineLength", maxInitialLineLength) .put("maxHeaderSize", maxHeaderSize) .put("enabledProtocols", new JsonArray().add(enabledProtocol.name())) .put("initialSettings", new JsonObject() .put("pushEnabled", initialSettings.isPushEnabled()) .put("http2ConnectionWindowSize", http2ConnectionWindowSize) .put(sslEngine, new JsonObject()) .put("alpnVersions", new JsonArray().add(alpnVersions.get(0).name())) .put("openSslSessionCacheEnabled", openSslSessionCacheEnabled) .put("decompressionSupported", decompressionSupported)
boolean openSslSessionCacheEnabled = rand.nextBoolean(); SSLEngineOptions sslEngine = TestUtils.randomBoolean() ? new JdkSSLEngineOptions() : new OpenSSLEngineOptions(); List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean decompressionSupported = rand.nextBoolean(); boolean acceptUnmaskedFrames = rand.nextBoolean();
boolean useAlpn = TestUtils.randomBoolean(); String sslEngine = TestUtils.randomBoolean() ? "jdkSslEngineOptions" : "openSslEngineOptions"; List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean h2cUpgrade = rand.nextBoolean(); boolean openSslSessionCacheEnabled = rand.nextBoolean(); .put("http2ConnectionWindowSize", http2ConnectionWindowSize) .put("tryUseCompression", tryUseCompression) .put("protocolVersion", protocolVersion.name()) .put("maxChunkSize", maxChunkSize) .put("maxInitialLineLength", maxInitialLineLength) .put("useAlpn", useAlpn) .put(sslEngine, new JsonObject()) .put("alpnVersions", new JsonArray().add(alpnVersions.get(0).name())) .put("http2ClearTextUpgrade", h2cUpgrade) .put("openSslSessionCacheEnabled", openSslSessionCacheEnabled)
boolean useAlpn = TestUtils.randomBoolean(); SSLEngineOptions sslEngine = TestUtils.randomBoolean() ? new JdkSSLEngineOptions() : new OpenSSLEngineOptions(); List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean h2cUpgrade = TestUtils.randomBoolean(); boolean openSslSessionCacheEnabled = rand.nextBoolean();
static void toJson(HttpClientOptions obj, java.util.Map<String, Object> json) { if (obj.getAlpnVersions() != null) { JsonArray array = new JsonArray(); obj.getAlpnVersions().forEach(item -> array.add(item.name())); json.put("alpnVersions", array); json.put("poolCleanerPeriod", obj.getPoolCleanerPeriod()); if (obj.getProtocolVersion() != null) { json.put("protocolVersion", obj.getProtocolVersion().name());
int maxInitialLineLength = rand.nextInt(10000); int maxHeaderSize = rand.nextInt(10000); HttpVersion enabledProtocol = HttpVersion.values()[rand.nextInt(HttpVersion.values().length)]; Http2Settings initialSettings = TestUtils.randomHttp2Settings(); boolean useAlpn = TestUtils.randomBoolean(); int http2ConnectionWindowSize = TestUtils.randomInt(); String sslEngine = TestUtils.randomBoolean() ? "jdkSslEngineOptions" : "openSslEngineOptions"; List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean openSslSessionCacheEnabled = TestUtils.randomBoolean(); boolean decompressionSupported = TestUtils.randomBoolean(); .put("maxInitialLineLength", maxInitialLineLength) .put("maxHeaderSize", maxHeaderSize) .put("enabledProtocols", new JsonArray().add(enabledProtocol.name())) .put("initialSettings", new JsonObject() .put("pushEnabled", initialSettings.isPushEnabled()) .put("http2ConnectionWindowSize", http2ConnectionWindowSize) .put(sslEngine, new JsonObject()) .put("alpnVersions", new JsonArray().add(alpnVersions.get(0).name())) .put("openSslSessionCacheEnabled", openSslSessionCacheEnabled) .put("decompressionSupported", decompressionSupported)
((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof String) list.add(io.vertx.core.http.HttpVersion.valueOf((String)item)); }); obj.setAlpnVersions(list); case "protocolVersion": if (member.getValue() instanceof String) { obj.setProtocolVersion(io.vertx.core.http.HttpVersion.valueOf((String)member.getValue()));
boolean openSslSessionCacheEnabled = rand.nextBoolean(); SSLEngineOptions sslEngine = TestUtils.randomBoolean() ? new JdkSSLEngineOptions() : new OpenSSLEngineOptions(); List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean decompressionSupported = rand.nextBoolean(); boolean acceptUnmaskedFrames = rand.nextBoolean();
result = 31 * result + defaultHost.hashCode(); result = 31 * result + defaultPort; result = 31 * result + protocolVersion.hashCode(); result = 31 * result + maxChunkSize; result = 31 * result + maxWaitQueueSize;
@Override public HttpVersion version() { return HttpVersion.valueOf(httpServerRequest.version().name()); }
boolean useAlpn = TestUtils.randomBoolean(); String sslEngine = TestUtils.randomBoolean() ? "jdkSslEngineOptions" : "openSslEngineOptions"; List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean h2cUpgrade = rand.nextBoolean(); boolean openSslSessionCacheEnabled = rand.nextBoolean(); .put("http2ConnectionWindowSize", http2ConnectionWindowSize) .put("tryUseCompression", tryUseCompression) .put("protocolVersion", protocolVersion.name()) .put("maxChunkSize", maxChunkSize) .put("maxInitialLineLength", maxInitialLineLength) .put("useAlpn", useAlpn) .put(sslEngine, new JsonObject()) .put("alpnVersions", new JsonArray().add(alpnVersions.get(0).name())) .put("http2ClearTextUpgrade", h2cUpgrade) .put("openSslSessionCacheEnabled", openSslSessionCacheEnabled)
public HttpVersion getHttpVersion() { DynamicStringProperty property = DynamicPropertyFactory.getInstance() .getStringProperty("servicecomb.service.registry.client.httpVersion", "HTTP_1_1"); return HttpVersion.valueOf(property.get()); }
boolean useAlpn = TestUtils.randomBoolean(); SSLEngineOptions sslEngine = TestUtils.randomBoolean() ? new JdkSSLEngineOptions() : new OpenSSLEngineOptions(); List<HttpVersion> alpnVersions = Collections.singletonList(HttpVersion.values()[TestUtils.randomPositiveInt() % 3]); boolean h2cUpgrade = TestUtils.randomBoolean(); boolean openSslSessionCacheEnabled = rand.nextBoolean();
static void toJson(HttpServerOptions obj, java.util.Map<String, Object> json) { json.put("acceptUnmaskedFrames", obj.isAcceptUnmaskedFrames()); if (obj.getAlpnVersions() != null) { JsonArray array = new JsonArray(); obj.getAlpnVersions().forEach(item -> array.add(item.name())); json.put("alpnVersions", array); } json.put("compressionLevel", obj.getCompressionLevel()); json.put("compressionSupported", obj.isCompressionSupported()); json.put("decoderInitialBufferSize", obj.getDecoderInitialBufferSize()); json.put("decompressionSupported", obj.isDecompressionSupported()); json.put("handle100ContinueAutomatically", obj.isHandle100ContinueAutomatically()); json.put("http2ConnectionWindowSize", obj.getHttp2ConnectionWindowSize()); if (obj.getInitialSettings() != null) { json.put("initialSettings", obj.getInitialSettings().toJson()); } json.put("maxChunkSize", obj.getMaxChunkSize()); json.put("maxHeaderSize", obj.getMaxHeaderSize()); json.put("maxInitialLineLength", obj.getMaxInitialLineLength()); json.put("maxWebsocketFrameSize", obj.getMaxWebsocketFrameSize()); json.put("maxWebsocketMessageSize", obj.getMaxWebsocketMessageSize()); json.put("websocketAllowServerNoContext", obj.getWebsocketAllowServerNoContext()); json.put("websocketPreferredClientNoContext", obj.getWebsocketPreferredClientNoContext()); if (obj.getWebsocketSubProtocols() != null) { json.put("websocketSubProtocols", obj.getWebsocketSubProtocols()); } } }
((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof String) list.add(io.vertx.core.http.HttpVersion.valueOf((String)item)); }); obj.setAlpnVersions(list);
static void toJson(HttpClientOptions obj, java.util.Map<String, Object> json) { if (obj.getAlpnVersions() != null) { JsonArray array = new JsonArray(); obj.getAlpnVersions().forEach(item -> array.add(item.name())); json.put("alpnVersions", array); json.put("poolCleanerPeriod", obj.getPoolCleanerPeriod()); if (obj.getProtocolVersion() != null) { json.put("protocolVersion", obj.getProtocolVersion().name());
((Iterable<Object>)member.getValue()).forEach( item -> { if (item instanceof String) list.add(io.vertx.core.http.HttpVersion.valueOf((String)item)); }); obj.setAlpnVersions(list); case "protocolVersion": if (member.getValue() instanceof String) { obj.setProtocolVersion(io.vertx.core.http.HttpVersion.valueOf((String)member.getValue()));