Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
558 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/main/generated/io/vertx/core/http/Http2SettingsConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,70 @@ | |||
/* | |||
* Copyright 2014 Red Hat, Inc. | |||
* | |||
* Red Hat licenses this file to you under the Apache License, version 2.0 | |||
* (the "License"); you may not use this file except in compliance with the | |||
* License. You may obtain a copy of the License at: | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |||
* License for the specific language governing permissions and limitations | |||
* under the License. | |||
*/ | |||
|
|||
package io.vertx.core.http; | |||
|
|||
import io.vertx.core.json.JsonObject; | |||
import io.vertx.core.json.JsonArray; | |||
|
|||
/** | |||
* Converter for {@link io.vertx.core.http.Http2Settings}. | |||
* | |||
* NOTE: This class has been automatically generated from the {@link io.vertx.core.http.Http2Settings} original class using Vert.x codegen. | |||
*/ | |||
public class Http2SettingsConverter { | |||
|
|||
public static void fromJson(JsonObject json, Http2Settings obj) { | |||
if (json.getValue("enablePush") instanceof Boolean) { | |||
obj.setEnablePush((Boolean)json.getValue("enablePush")); | |||
} | |||
if (json.getValue("headerTableSize") instanceof Number) { | |||
obj.setHeaderTableSize(((Number)json.getValue("headerTableSize")).intValue()); | |||
} | |||
if (json.getValue("initialWindowSize") instanceof Number) { | |||
obj.setInitialWindowSize(((Number)json.getValue("initialWindowSize")).intValue()); | |||
} | |||
if (json.getValue("maxConcurrentStreams") instanceof Number) { | |||
obj.setMaxConcurrentStreams(((Number)json.getValue("maxConcurrentStreams")).longValue()); | |||
} | |||
if (json.getValue("maxFrameSize") instanceof Number) { | |||
obj.setMaxFrameSize(((Number)json.getValue("maxFrameSize")).intValue()); | |||
} | |||
if (json.getValue("maxHeaderListSize") instanceof Number) { | |||
obj.setMaxHeaderListSize(((Number)json.getValue("maxHeaderListSize")).intValue()); | |||
} | |||
} | |||
|
|||
public static void toJson(Http2Settings obj, JsonObject json) { | |||
if (obj.getEnablePush() != null) { | |||
json.put("enablePush", obj.getEnablePush()); | |||
} | |||
if (obj.getHeaderTableSize() != null) { | |||
json.put("headerTableSize", obj.getHeaderTableSize()); | |||
} | |||
if (obj.getInitialWindowSize() != null) { | |||
json.put("initialWindowSize", obj.getInitialWindowSize()); | |||
} | |||
if (obj.getMaxConcurrentStreams() != null) { | |||
json.put("maxConcurrentStreams", obj.getMaxConcurrentStreams()); | |||
} | |||
if (obj.getMaxFrameSize() != null) { | |||
json.put("maxFrameSize", obj.getMaxFrameSize()); | |||
} | |||
if (obj.getMaxHeaderListSize() != null) { | |||
json.put("maxHeaderListSize", obj.getMaxHeaderListSize()); | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,134 @@ | |||
/* | |||
* Copyright (c) 2011-2013 The original author or authors | |||
* ------------------------------------------------------ | |||
* All rights reserved. This program and the accompanying materials | |||
* are made available under the terms of the Eclipse Public License v1.0 | |||
* and Apache License v2.0 which accompanies this distribution. | |||
* | |||
* The Eclipse Public License is available at | |||
* http://www.eclipse.org/legal/epl-v10.html | |||
* | |||
* The Apache License v2.0 is available at | |||
* http://www.opensource.org/licenses/apache2.0.php | |||
* | |||
* You may elect to redistribute this code under either of these licenses. | |||
*/ | |||
|
|||
package io.vertx.core.http; | |||
|
|||
import io.netty.handler.codec.http2.Http2CodecUtil; | |||
import io.vertx.codegen.annotations.DataObject; | |||
import io.vertx.core.impl.Arguments; | |||
import io.vertx.core.json.JsonObject; | |||
|
|||
/** | |||
* HTTP2 settings. | |||
* | |||
* @author <a href="mailto:julien@julienviet.com">Julien Viet</a> | |||
*/ | |||
@DataObject(generateConverter = true) | |||
public class Http2Settings { | |||
|
|||
private Integer headerTableSize; | |||
private Boolean enablePush; | |||
private Long maxConcurrentStreams; | |||
private Integer initialWindowSize; | |||
private Integer maxFrameSize; | |||
private Integer maxHeaderListSize; | |||
|
|||
public Http2Settings() { | |||
} | |||
|
|||
public Http2Settings(JsonObject json) { | |||
Http2SettingsConverter.fromJson(json, this); | |||
} | |||
|
|||
public Http2Settings(Http2Settings that) { | |||
headerTableSize = that.headerTableSize; | |||
enablePush = that.enablePush; | |||
maxConcurrentStreams = that.maxConcurrentStreams; | |||
initialWindowSize = that.initialWindowSize; | |||
maxFrameSize = that.maxFrameSize; | |||
maxHeaderListSize = that.maxHeaderListSize; | |||
} | |||
|
|||
public Integer getHeaderTableSize() { | |||
return headerTableSize; | |||
} | |||
|
|||
public Http2Settings setHeaderTableSize(Integer headerTableSize) { | |||
Arguments.require(headerTableSize == null || headerTableSize >= Http2CodecUtil.MIN_HEADER_TABLE_SIZE, | |||
"headerTableSize must be >= " + Http2CodecUtil.MIN_HEADER_TABLE_SIZE); | |||
Arguments.require(headerTableSize == null || headerTableSize < Http2CodecUtil.MAX_HEADER_TABLE_SIZE, | |||
"headerTableSize must be <= " + Http2CodecUtil.MAX_HEADER_TABLE_SIZE); | |||
this.headerTableSize = headerTableSize; | |||
return this; | |||
} | |||
|
|||
public Boolean getEnablePush() { | |||
return enablePush; | |||
} | |||
|
|||
public Http2Settings setEnablePush(Boolean enablePush) { | |||
this.enablePush = enablePush; | |||
return this; | |||
} | |||
|
|||
public Long getMaxConcurrentStreams() { | |||
return maxConcurrentStreams; | |||
} | |||
|
|||
public Http2Settings setMaxConcurrentStreams(Long maxConcurrentStreams) { | |||
Arguments.require(maxConcurrentStreams == null || maxConcurrentStreams >= Http2CodecUtil.MIN_CONCURRENT_STREAMS, | |||
"maxConcurrentStreams must be >= " + Http2CodecUtil.MIN_CONCURRENT_STREAMS); | |||
Arguments.require(maxConcurrentStreams == null || maxConcurrentStreams <= Http2CodecUtil.MAX_CONCURRENT_STREAMS, | |||
"maxConcurrentStreams must be < " + Http2CodecUtil.MAX_CONCURRENT_STREAMS); | |||
this.maxConcurrentStreams = maxConcurrentStreams; | |||
return this; | |||
} | |||
|
|||
public Integer getInitialWindowSize() { | |||
return initialWindowSize; | |||
} | |||
|
|||
public Http2Settings setInitialWindowSize(Integer initialWindowSize) { | |||
Arguments.require(initialWindowSize == null || initialWindowSize >= Http2CodecUtil.MIN_INITIAL_WINDOW_SIZE, | |||
"initialWindowSize must be >= " + Http2CodecUtil.MIN_INITIAL_WINDOW_SIZE); | |||
Arguments.require(initialWindowSize == null || initialWindowSize < Http2CodecUtil.MAX_INITIAL_WINDOW_SIZE, | |||
"initialWindowSize must be < " + Http2CodecUtil.MAX_INITIAL_WINDOW_SIZE); | |||
this.initialWindowSize = initialWindowSize; | |||
return this; | |||
} | |||
|
|||
public Integer getMaxFrameSize() { | |||
return maxFrameSize; | |||
} | |||
|
|||
public Http2Settings setMaxFrameSize(Integer maxFrameSize) { | |||
Arguments.require(maxFrameSize == null || maxFrameSize >= Http2CodecUtil.MAX_FRAME_SIZE_LOWER_BOUND, | |||
"maxFrameSize must be >= " + Http2CodecUtil.MAX_FRAME_SIZE_LOWER_BOUND); | |||
Arguments.require(maxFrameSize == null || maxFrameSize <= Http2CodecUtil.MAX_FRAME_SIZE_UPPER_BOUND, | |||
"maxFrameSize must be <= " + Http2CodecUtil.MAX_FRAME_SIZE_UPPER_BOUND); | |||
this.maxFrameSize = maxFrameSize; | |||
return this; | |||
} | |||
|
|||
public Integer getMaxHeaderListSize() { | |||
return maxHeaderListSize; | |||
} | |||
|
|||
public Http2Settings setMaxHeaderListSize(Integer maxHeaderListSize) { | |||
Arguments.require(maxHeaderListSize == null || maxHeaderListSize >= Http2CodecUtil.MIN_HEADER_LIST_SIZE, | |||
"maxHeaderListSize must be >= " + Http2CodecUtil.MIN_HEADER_LIST_SIZE); | |||
Arguments.require(maxHeaderListSize == null || maxHeaderListSize <= Http2CodecUtil.MAX_HEADER_LIST_SIZE, | |||
"maxHeaderListSize must be <= " + Http2CodecUtil.MAX_HEADER_LIST_SIZE); | |||
this.maxHeaderListSize = maxHeaderListSize; | |||
return this; | |||
} | |||
|
|||
public JsonObject toJson() { | |||
JsonObject json = new JsonObject(); | |||
Http2SettingsConverter.toJson(this, json); | |||
return json; | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.