diff --git a/src/main/java/org/jboss/netty/example/http/snoop/HttpClient.java b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClient.java similarity index 92% rename from src/main/java/org/jboss/netty/example/http/snoop/HttpClient.java rename to src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClient.java index baa749fe42..f610970401 100644 --- a/src/main/java/org/jboss/netty/example/http/snoop/HttpClient.java +++ b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClient.java @@ -32,13 +32,13 @@ import org.jboss.netty.handler.codec.http.HttpVersion; /** * A simple HTTP client that prints out the content of the HTTP response to - * {@link System#out} to test {@link HttpServer}. + * {@link System#out} to test {@link HttpSnoopServer}. */ -public class HttpClient { +public class HttpSnoopClient { private final URI uri; - public HttpClient(URI uri) { + public HttpSnoopClient(URI uri) { this.uri = uri; } @@ -68,7 +68,7 @@ public class HttpClient { Executors.newCachedThreadPool())); // Set up the event pipeline factory. - bootstrap.setPipelineFactory(new HttpClientPipelineFactory(ssl)); + bootstrap.setPipelineFactory(new HttpSnoopClientPipelineFactory(ssl)); // Start the connection attempt. ChannelFuture future = bootstrap.connect(new InetSocketAddress(host, port)); @@ -107,12 +107,12 @@ public class HttpClient { public static void main(String[] args) throws Exception { if (args.length != 1) { System.err.println( - "Usage: " + HttpClient.class.getSimpleName() + + "Usage: " + HttpSnoopClient.class.getSimpleName() + " "); return; } URI uri = new URI(args[0]); - new HttpClient(uri).run(); + new HttpSnoopClient(uri).run(); } } diff --git a/src/main/java/org/jboss/netty/example/http/snoop/HttpResponseHandler.java b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClientHandler.java similarity index 97% rename from src/main/java/org/jboss/netty/example/http/snoop/HttpResponseHandler.java rename to src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClientHandler.java index 2440ef3926..b0c2409706 100644 --- a/src/main/java/org/jboss/netty/example/http/snoop/HttpResponseHandler.java +++ b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClientHandler.java @@ -23,7 +23,7 @@ import org.jboss.netty.handler.codec.http.HttpChunk; import org.jboss.netty.handler.codec.http.HttpResponse; import org.jboss.netty.util.CharsetUtil; -public class HttpResponseHandler extends SimpleChannelUpstreamHandler { +public class HttpSnoopClientHandler extends SimpleChannelUpstreamHandler { private boolean readingChunks; diff --git a/src/main/java/org/jboss/netty/example/http/snoop/HttpClientPipelineFactory.java b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClientPipelineFactory.java similarity index 90% rename from src/main/java/org/jboss/netty/example/http/snoop/HttpClientPipelineFactory.java rename to src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClientPipelineFactory.java index 29a424c6b9..d5c30a5482 100644 --- a/src/main/java/org/jboss/netty/example/http/snoop/HttpClientPipelineFactory.java +++ b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopClientPipelineFactory.java @@ -26,11 +26,11 @@ import org.jboss.netty.handler.codec.http.HttpClientCodec; import org.jboss.netty.handler.codec.http.HttpContentDecompressor; import org.jboss.netty.handler.ssl.SslHandler; -public class HttpClientPipelineFactory implements ChannelPipelineFactory { +public class HttpSnoopClientPipelineFactory implements ChannelPipelineFactory { private final boolean ssl; - public HttpClientPipelineFactory(boolean ssl) { + public HttpSnoopClientPipelineFactory(boolean ssl) { this.ssl = ssl; } @@ -55,7 +55,7 @@ public class HttpClientPipelineFactory implements ChannelPipelineFactory { // Uncomment the following line if you don't want to handle HttpChunks. //pipeline.addLast("aggregator", new HttpChunkAggregator(1048576)); - pipeline.addLast("handler", new HttpResponseHandler()); + pipeline.addLast("handler", new HttpSnoopClientHandler()); return pipeline; } } diff --git a/src/main/java/org/jboss/netty/example/http/snoop/HttpServer.java b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServer.java similarity index 90% rename from src/main/java/org/jboss/netty/example/http/snoop/HttpServer.java rename to src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServer.java index 5baa197b9b..909359aeb2 100644 --- a/src/main/java/org/jboss/netty/example/http/snoop/HttpServer.java +++ b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServer.java @@ -25,11 +25,11 @@ import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory; * An HTTP server that sends back the content of the received HTTP request * in a pretty plaintext form. */ -public class HttpServer { +public class HttpSnoopServer { private final int port; - public HttpServer(int port) { + public HttpSnoopServer(int port) { this.port = port; } @@ -41,7 +41,7 @@ public class HttpServer { Executors.newCachedThreadPool())); // Set up the event pipeline factory. - bootstrap.setPipelineFactory(new HttpServerPipelineFactory()); + bootstrap.setPipelineFactory(new HttpSnoopServerPipelineFactory()); // Bind and start to accept incoming connections. bootstrap.bind(new InetSocketAddress(port)); @@ -54,7 +54,7 @@ public class HttpServer { } else { port = 8080; } - new HttpServer(port).run(); + new HttpSnoopServer(port).run(); } } diff --git a/src/main/java/org/jboss/netty/example/http/snoop/HttpRequestHandler.java b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServerHandler.java similarity index 98% rename from src/main/java/org/jboss/netty/example/http/snoop/HttpRequestHandler.java rename to src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServerHandler.java index 560ce5a8ac..058e6b3195 100644 --- a/src/main/java/org/jboss/netty/example/http/snoop/HttpRequestHandler.java +++ b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServerHandler.java @@ -44,7 +44,7 @@ import org.jboss.netty.handler.codec.http.HttpResponse; import org.jboss.netty.handler.codec.http.QueryStringDecoder; import org.jboss.netty.util.CharsetUtil; -public class HttpRequestHandler extends SimpleChannelUpstreamHandler { +public class HttpSnoopServerHandler extends SimpleChannelUpstreamHandler { private HttpRequest request; private boolean readingChunks; diff --git a/src/main/java/org/jboss/netty/example/http/snoop/HttpServerPipelineFactory.java b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServerPipelineFactory.java similarity index 92% rename from src/main/java/org/jboss/netty/example/http/snoop/HttpServerPipelineFactory.java rename to src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServerPipelineFactory.java index ace8145b1e..4f2f299c6e 100644 --- a/src/main/java/org/jboss/netty/example/http/snoop/HttpServerPipelineFactory.java +++ b/src/main/java/org/jboss/netty/example/http/snoop/HttpSnoopServerPipelineFactory.java @@ -23,7 +23,7 @@ import org.jboss.netty.handler.codec.http.HttpContentCompressor; import org.jboss.netty.handler.codec.http.HttpRequestDecoder; import org.jboss.netty.handler.codec.http.HttpResponseEncoder; -public class HttpServerPipelineFactory implements ChannelPipelineFactory { +public class HttpSnoopServerPipelineFactory implements ChannelPipelineFactory { public ChannelPipeline getPipeline() throws Exception { // Create a default pipeline implementation. ChannelPipeline pipeline = pipeline(); @@ -39,7 +39,7 @@ public class HttpServerPipelineFactory implements ChannelPipelineFactory { pipeline.addLast("encoder", new HttpResponseEncoder()); // Remove the following line if you don't want automatic content compression. pipeline.addLast("deflater", new HttpContentCompressor()); - pipeline.addLast("handler", new HttpRequestHandler()); + pipeline.addLast("handler", new HttpSnoopServerHandler()); return pipeline; } } diff --git a/src/main/java/org/jboss/netty/example/portunification/PortUnificationServerHandler.java b/src/main/java/org/jboss/netty/example/portunification/PortUnificationServerHandler.java index 0ac3c8ddb8..e30a4a5a58 100644 --- a/src/main/java/org/jboss/netty/example/portunification/PortUnificationServerHandler.java +++ b/src/main/java/org/jboss/netty/example/portunification/PortUnificationServerHandler.java @@ -24,7 +24,7 @@ import org.jboss.netty.channel.ChannelPipeline; import org.jboss.netty.example.factorial.BigIntegerDecoder; import org.jboss.netty.example.factorial.FactorialServerHandler; import org.jboss.netty.example.factorial.NumberEncoder; -import org.jboss.netty.example.http.snoop.HttpRequestHandler; +import org.jboss.netty.example.http.snoop.HttpSnoopServerHandler; import org.jboss.netty.example.securechat.SecureChatSslContextFactory; import org.jboss.netty.handler.codec.compression.ZlibDecoder; import org.jboss.netty.handler.codec.compression.ZlibEncoder; @@ -144,7 +144,7 @@ public class PortUnificationServerHandler extends FrameDecoder { p.addLast("decoder", new HttpRequestDecoder()); p.addLast("encoder", new HttpResponseEncoder()); p.addLast("deflater", new HttpContentCompressor()); - p.addLast("handler", new HttpRequestHandler()); + p.addLast("handler", new HttpSnoopServerHandler()); p.remove(this); }