Skip to content

Commit 19a38a5

Browse files
committed
Move Http2Server(Request|Response) to impl package and rename them to HttpServer(Request|Response)Impl
1 parent fd97998 commit 19a38a5

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

vertx-core/src/main/java/io/vertx/core/http/HttpServerResponse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.vertx.core.Handler;
1717
import io.vertx.core.MultiMap;
1818
import io.vertx.core.buffer.Buffer;
19+
import io.vertx.core.http.impl.HttpServerResponseImpl;
1920
import io.vertx.core.net.HostAndPort;
2021
import io.vertx.core.streams.ReadStream;
2122
import io.vertx.core.streams.WriteStream;
@@ -41,7 +42,7 @@
4142
* serving files from the server since buffers do not have to be read one by one
4243
* from the file and written to the outgoing socket. If the developer wants to use directly a
4344
* {@link java.nio.channels.FileChannel} and manage its lifecycle use {@link #sendFile(FileChannel)}.
44-
* This is not yet supported in HTTP/2 for {@link io.vertx.core.http.impl.Http2ServerResponse}.
45+
* This is not yet supported in HTTP/2 for {@link HttpServerResponseImpl}.
4546
* <p>
4647
* It implements {@link io.vertx.core.streams.WriteStream} so it can be used with
4748
* {@link io.vertx.core.streams.Pipe} to pipe data with flow control.

vertx-core/src/main/java/io/vertx/core/http/impl/HttpServerConnectionHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import io.vertx.core.http.ServerWebSocket;
2525
import io.vertx.core.http.ServerWebSocketHandshake;
2626
import io.vertx.core.http.impl.http2.Http2ServerConnection;
27-
import io.vertx.core.http.impl.http2.Http2ServerRequest;
2827
import io.vertx.core.internal.ContextInternal;
2928

3029
import java.util.ArrayList;
@@ -100,7 +99,7 @@ public void handle(HttpServerConnection conn) {
10099
Http2ServerConnection http2Conn = (Http2ServerConnection) conn;
101100
http2Conn.streamHandler(stream -> {
102101
HttpServerOptions options = server.options;
103-
Http2ServerRequest request = new Http2ServerRequest(stream, stream.context(), options.isHandle100ContinueAutomatically(),
102+
HttpServerRequestImpl request = new HttpServerRequestImpl(stream, stream.context(), options.isHandle100ContinueAutomatically(),
104103
options.getMaxFormAttributeSize(), options.getMaxFormFields(), options.getMaxFormBufferedBytes(), serverOrigin);
105104
request.handler = requestHandler;
106105
request.init();

vertx-core/src/main/java/io/vertx/core/http/impl/http2/Http2ServerRequest.java renamed to vertx-core/src/main/java/io/vertx/core/http/impl/HttpServerRequestImpl.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
1010
*/
1111

12-
package io.vertx.core.http.impl.http2;
12+
package io.vertx.core.http.impl;
1313

1414
import io.netty.handler.codec.DecoderResult;
1515
import io.netty.handler.codec.http.*;
@@ -22,8 +22,6 @@
2222
import io.vertx.core.MultiMap;
2323
import io.vertx.core.buffer.Buffer;
2424
import io.vertx.core.http.HttpHeaders;
25-
import io.vertx.core.http.impl.*;
26-
import io.vertx.core.http.impl.HttpRequestHead;
2725
import io.vertx.core.internal.buffer.BufferInternal;
2826
import io.vertx.core.http.Cookie;
2927
import io.vertx.core.http.HttpMethod;
@@ -43,12 +41,12 @@
4341
/**
4442
* @author <a href="mailto:[email protected]">Julien Viet</a>
4543
*/
46-
public class Http2ServerRequest extends HttpServerRequestInternal {
44+
public class HttpServerRequestImpl extends HttpServerRequestInternal {
4745

4846
protected final ContextInternal context;
4947
protected final HttpServerStream stream;
5048
protected final HttpServerConnection connection;
51-
protected final Http2ServerResponse response;
49+
protected final HttpServerResponseImpl response;
5250
private final boolean handle100ContinueAutomatically;
5351
private final String serverOrigin;
5452
private final int maxFormAttributeSize;
@@ -75,17 +73,17 @@ public class Http2ServerRequest extends HttpServerRequestInternal {
7573
private boolean expectMultipart;
7674
private HttpPostRequestDecoder postRequestDecoder;
7775

78-
public Http2ServerRequest(HttpServerStream stream,
79-
ContextInternal context,
80-
boolean handle100ContinueAutomatically,
81-
int maxFormAttributeSize,
82-
int maxFormFields,
83-
int maxFormBufferedBytes,
84-
String serverOrigin) {
76+
public HttpServerRequestImpl(HttpServerStream stream,
77+
ContextInternal context,
78+
boolean handle100ContinueAutomatically,
79+
int maxFormAttributeSize,
80+
int maxFormFields,
81+
int maxFormBufferedBytes,
82+
String serverOrigin) {
8583
this.context = context;
8684
this.stream = stream;
8785
this.connection = stream.connection();
88-
this.response = new Http2ServerResponse(stream, context,false);
86+
this.response = new HttpServerResponseImpl(stream, context,false);
8987
this.serverOrigin = serverOrigin;
9088
this.handle100ContinueAutomatically = handle100ContinueAutomatically;
9189
this.maxFormAttributeSize = maxFormAttributeSize;
@@ -367,7 +365,7 @@ public long bytesRead() {
367365
}
368366

369367
@Override
370-
public Http2ServerResponse response() {
368+
public HttpServerResponseImpl response() {
371369
return response;
372370
}
373371

vertx-core/src/main/java/io/vertx/core/http/impl/http2/Http2ServerResponse.java renamed to vertx-core/src/main/java/io/vertx/core/http/impl/HttpServerResponseImpl.java

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
1010
*/
1111

12-
package io.vertx.core.http.impl.http2;
12+
package io.vertx.core.http.impl;
1313

1414
import io.netty.buffer.ByteBuf;
1515
import io.netty.handler.codec.http.HttpHeaderNames;
@@ -24,9 +24,6 @@
2424
import io.vertx.core.Promise;
2525
import io.vertx.core.buffer.Buffer;
2626
import io.vertx.core.http.*;
27-
import io.vertx.core.http.impl.*;
28-
import io.vertx.core.http.impl.HttpRequestHead;
29-
import io.vertx.core.http.impl.HttpResponseHead;
3027
import io.vertx.core.internal.ContextInternal;
3128
import io.vertx.core.net.HostAndPort;
3229
import io.vertx.core.net.NetSocket;
@@ -47,7 +44,7 @@
4744
/**
4845
* @author <a href="mailto:[email protected]">Julien Viet</a>
4946
*/
50-
public class Http2ServerResponse implements HttpServerResponse, HttpResponse {
47+
public class HttpServerResponseImpl implements HttpServerResponse, HttpResponse {
5148

5249
private final HttpServerStream stream;
5350
private final HttpServerConnection conn;
@@ -73,9 +70,9 @@ public class Http2ServerResponse implements HttpServerResponse, HttpResponse {
7370
private HostAndPort requestAuthority;
7471
private CharSequence requestCookie;
7572

76-
public Http2ServerResponse(HttpServerStream stream,
77-
ContextInternal context,
78-
boolean push) {
73+
public HttpServerResponseImpl(HttpServerStream stream,
74+
ContextInternal context,
75+
boolean push) {
7976
this.stream = stream;
8077
this.context = context;
8178
this.conn = stream.connection();
@@ -741,7 +738,7 @@ public Future<HttpServerResponse> push(HttpMethod method, HostAndPort authority,
741738
HostAndPort h = authority;
742739
Future<HttpServerStream> fut = stream.sendPush(authority, method, headers, path, stream.priority());
743740
return fut.map(pushStream -> {
744-
Http2ServerResponse response = new Http2ServerResponse(pushStream, context, true);
741+
HttpServerResponseImpl response = new HttpServerResponseImpl(pushStream, context, true);
745742
response.requestMethod = method;
746743
response.requestAuthority = h;
747744
PushStreamHandler push = new PushStreamHandler(pushStream, response, context);
@@ -754,9 +751,9 @@ private static class PushStreamHandler {
754751

755752
protected final ContextInternal context;
756753
protected final HttpServerStream stream;
757-
protected final Http2ServerResponse response;
754+
protected final HttpServerResponseImpl response;
758755

759-
public PushStreamHandler(HttpServerStream stream, Http2ServerResponse response, ContextInternal context) {
756+
public PushStreamHandler(HttpServerStream stream, HttpServerResponseImpl response, ContextInternal context) {
760757
this.context = context;
761758
this.stream = stream;
762759
this.response = response;

0 commit comments

Comments
 (0)