diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java index 45e889797bd..31c1214f034 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/http/netty4/Netty4HttpServerTransport.java @@ -56,6 +56,7 @@ import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.XContentParser; +import org.elasticsearch.http.AbstractHttpServerTransport; import org.elasticsearch.http.BindHttpException; import org.elasticsearch.http.HttpHandlingSettings; import org.elasticsearch.http.HttpStats; diff --git a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerTransportTests.java b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerTransportTests.java index 96b436ce7de..5b22409b92d 100644 --- a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerTransportTests.java +++ b/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpServerTransportTests.java @@ -273,7 +273,7 @@ public class Netty4HttpServerTransportTests extends ESTestCase { try (Netty4HttpServerTransport transport = new Netty4HttpServerTransport(settings, networkService, bigArrays, threadPool, xContentRegistry(), dispatcher)) { transport.start(); - final TransportAddress remoteAddress = randomFrom(transport.boundAddress.boundAddresses()); + final TransportAddress remoteAddress = randomFrom(transport.boundAddress().boundAddresses()); try (Netty4HttpClient client = new Netty4HttpClient()) { final String url = "/" + new String(new byte[maxInitialLineLength], Charset.forName("UTF-8")); @@ -352,7 +352,7 @@ public class Netty4HttpServerTransportTests extends ESTestCase { try (Netty4HttpServerTransport transport = new Netty4HttpServerTransport(settings, networkService, bigArrays, threadPool, xContentRegistry(), dispatcher)) { transport.start(); - final TransportAddress remoteAddress = randomFrom(transport.boundAddress.boundAddresses()); + final TransportAddress remoteAddress = randomFrom(transport.boundAddress().boundAddresses()); AtomicBoolean channelClosed = new AtomicBoolean(false); diff --git a/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java b/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java index 825a023bd51..de5c166de3f 100644 --- a/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java +++ b/plugins/transport-nio/src/main/java/org/elasticsearch/http/nio/NioHttpServerTransport.java @@ -42,7 +42,7 @@ import org.elasticsearch.http.BindHttpException; import org.elasticsearch.http.HttpHandlingSettings; import org.elasticsearch.http.HttpServerTransport; import org.elasticsearch.http.HttpStats; -import org.elasticsearch.http.netty4.AbstractHttpServerTransport; +import org.elasticsearch.http.AbstractHttpServerTransport; import org.elasticsearch.nio.AcceptingSelector; import org.elasticsearch.nio.AcceptorEventHandler; import org.elasticsearch.nio.BytesChannelContext; diff --git a/server/src/main/java/org/elasticsearch/http/netty4/AbstractHttpServerTransport.java b/server/src/main/java/org/elasticsearch/http/AbstractHttpServerTransport.java similarity index 98% rename from server/src/main/java/org/elasticsearch/http/netty4/AbstractHttpServerTransport.java rename to server/src/main/java/org/elasticsearch/http/AbstractHttpServerTransport.java index a0b3632310b..c75754bde58 100644 --- a/server/src/main/java/org/elasticsearch/http/netty4/AbstractHttpServerTransport.java +++ b/server/src/main/java/org/elasticsearch/http/AbstractHttpServerTransport.java @@ -17,7 +17,7 @@ * under the License. */ -package org.elasticsearch.http.netty4; +package org.elasticsearch.http; import com.carrotsearch.hppc.IntHashSet; import com.carrotsearch.hppc.IntSet; @@ -30,8 +30,6 @@ import org.elasticsearch.common.transport.PortsRange; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.http.BindHttpException; -import org.elasticsearch.http.HttpInfo; import org.elasticsearch.rest.RestChannel; import org.elasticsearch.rest.RestRequest; import org.elasticsearch.threadpool.ThreadPool; diff --git a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpPublishPortTests.java b/server/src/test/java/org/elasticsearch/http/AbstractHttpServerTransportTests.java similarity index 93% rename from modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpPublishPortTests.java rename to server/src/test/java/org/elasticsearch/http/AbstractHttpServerTransportTests.java index afa513275ea..ee74d98002f 100644 --- a/modules/transport-netty4/src/test/java/org/elasticsearch/http/netty4/Netty4HttpPublishPortTests.java +++ b/server/src/test/java/org/elasticsearch/http/AbstractHttpServerTransportTests.java @@ -17,13 +17,11 @@ * under the License. */ -package org.elasticsearch.http.netty4; +package org.elasticsearch.http; import org.elasticsearch.common.network.NetworkUtils; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; -import org.elasticsearch.http.BindHttpException; -import org.elasticsearch.http.HttpTransportSettings; import org.elasticsearch.test.ESTestCase; import java.net.UnknownHostException; @@ -32,11 +30,11 @@ import java.util.List; import static java.net.InetAddress.getByName; import static java.util.Arrays.asList; -import static org.elasticsearch.http.netty4.Netty4HttpServerTransport.resolvePublishPort; +import static org.elasticsearch.http.AbstractHttpServerTransport.resolvePublishPort; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.equalTo; -public class Netty4HttpPublishPortTests extends ESTestCase { +public class AbstractHttpServerTransportTests extends ESTestCase { public void testHttpPublishPort() throws Exception { int boundPort = randomIntBetween(9000, 9100); @@ -88,5 +86,4 @@ public class Netty4HttpPublishPortTests extends ESTestCase { } return addresses; } - }