From a2e5cd94bebc4e917401e87fecb5bc14de489c6f Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 11 Feb 2013 19:42:23 +0900 Subject: [PATCH] Prettify APIviz / Tighten visibility / Move subclasses to top level / Remove unused UnknownSocksMessage --- .../codec/http/QueryStringDecoder.java | 2 +- .../codec/http/QueryStringEncoder.java | 4 +- .../websocketx/WebSocket00FrameDecoder.java | 3 - .../websocketx/WebSocket00FrameEncoder.java | 3 - .../websocketx/WebSocket08FrameDecoder.java | 2 +- .../WebSocketClientHandshakerFactory.java | 5 +- .../WebSocketServerHandshakerFactory.java | 6 +- .../codec/http/websocketx/package-info.java | 6 +- .../handler/codec/spdy/SpdyOrHttpChooser.java | 33 +-- .../handler/codec/socks/SocksAddressType.java | 44 ++++ .../handler/codec/socks/SocksAuthRequest.java | 4 +- .../codec/socks/SocksAuthRequestDecoder.java | 6 +- .../codec/socks/SocksAuthResponse.java | 16 +- .../codec/socks/SocksAuthResponseDecoder.java | 12 +- .../handler/codec/socks/SocksAuthScheme.java | 44 ++++ .../handler/codec/socks/SocksAuthStatus.java | 42 ++++ .../handler/codec/socks/SocksCmdRequest.java | 32 +-- .../codec/socks/SocksCmdRequestDecoder.java | 14 +- .../handler/codec/socks/SocksCmdResponse.java | 24 +- .../codec/socks/SocksCmdResponseDecoder.java | 16 +- .../handler/codec/socks/SocksCmdStatus.java | 49 +++++ .../handler/codec/socks/SocksCmdType.java | 44 ++++ .../handler/codec/socks/SocksInitRequest.java | 16 +- .../codec/socks/SocksInitRequestDecoder.java | 10 +- .../codec/socks/SocksInitResponse.java | 14 +- .../codec/socks/SocksInitResponseDecoder.java | 12 +- .../handler/codec/socks/SocksMessage.java | 207 +----------------- .../handler/codec/socks/SocksMessageType.java | 23 ++ .../codec/socks/SocksProtocolVersion.java | 42 ++++ .../handler/codec/socks/SocksRequest.java | 12 +- ...ocksMessage.java => SocksRequestType.java} | 25 +-- .../handler/codec/socks/SocksResponse.java | 12 +- .../codec/socks/SocksResponseType.java | 27 +++ .../socks/SocksSubnegotiationVersion.java | 42 ++++ .../handler/codec/socks/package-info.java | 3 + .../socks/SocksAuthResponseDecoderTest.java | 4 +- .../socks/SocksCmdRequestDecoderTest.java | 20 +- .../codec/socks/SocksCmdRequestTest.java | 19 +- .../socks/SocksCmdResponseDecoderTest.java | 8 +- .../codec/socks/SocksCmdResponseTest.java | 7 +- .../codec/serialization/ClassResolvers.java | 4 + .../codec/serialization/SoftReferenceMap.java | 2 +- .../codec/serialization/WeakReferenceMap.java | 2 +- .../main/java/io/netty/util/AttributeMap.java | 2 + .../io/netty/util/ResourceLeakDetector.java | 3 + .../main/java/io/netty/util/package-info.java | 2 +- .../socksproxy/SocksServerConnectHandler.java | 7 +- .../socksproxy/SocksServerHandler.java | 12 +- 48 files changed, 552 insertions(+), 396 deletions(-) create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAddressType.java create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthScheme.java create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthStatus.java create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdStatus.java create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksCmdType.java create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksMessageType.java create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksProtocolVersion.java rename codec-socks/src/main/java/io/netty/handler/codec/socks/{UnknownSocksMessage.java => SocksRequestType.java} (62%) create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksResponseType.java create mode 100644 codec-socks/src/main/java/io/netty/handler/codec/socks/SocksSubnegotiationVersion.java diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java index 1e4ef0dd7d..841a6ca9c4 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java @@ -54,7 +54,7 @@ import java.util.Map; * @see QueryStringEncoder * * @apiviz.stereotype utility - * @apiviz.has io.netty.handler.codec.http.FullHttpRequest oneway - - decodes + * @apiviz.has io.netty.handler.codec.http.HttpRequest oneway - - decodes URI */ public class QueryStringDecoder { diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java index 6c2e216984..4ee29d8eda 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringEncoder.java @@ -36,7 +36,7 @@ import java.util.List; * @see QueryStringDecoder * * @apiviz.stereotype utility - * @apiviz.has io.netty.handler.codec.http.FullHttpRequest oneway - - encodes + * @apiviz.has io.netty.handler.codec.http.HttpRequest oneway - - encodes URI */ public class QueryStringEncoder { @@ -116,7 +116,7 @@ public class QueryStringEncoder { private static String encodeComponent(String s, Charset charset) { try { - return URLEncoder.encode(s, charset.name()).replaceAll("\\+", "%20"); + return URLEncoder.encode(s, charset.name()).replace("+", "%20"); } catch (UnsupportedEncodingException e) { throw new UnsupportedCharsetException(charset.name()); } diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java index 7660381728..fef523db5d 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameDecoder.java @@ -25,9 +25,6 @@ import io.netty.handler.codec.TooLongFrameException; *

* For the detailed instruction on adding add Web Socket support to your HTTP server, take a look into the * WebSocketServer example located in the {@code io.netty.example.http.websocket} package. - * - * @apiviz.landmark - * @apiviz.uses io.netty.handler.codec.http.websocket.WebSocketFrame */ public class WebSocket00FrameDecoder extends ReplayingDecoder { diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameEncoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameEncoder.java index 3f827a0e15..5508fdd510 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameEncoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket00FrameEncoder.java @@ -25,9 +25,6 @@ import io.netty.handler.codec.MessageToByteEncoder; *

* For the detailed instruction on adding add Web Socket support to your HTTP server, take a look into the * WebSocketServer example located in the {@code io.netty.example.http.websocket} package. - * - * @apiviz.landmark - * @apiviz.uses io.netty.handler.codec.http.websocket.WebSocketFrame */ @Sharable public class WebSocket00FrameEncoder extends MessageToByteEncoder { diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java index d96cbc6c79..7e96962473 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java @@ -93,7 +93,7 @@ public class WebSocket08FrameDecoder extends ReplayingDecoder * - * @apiviz.exclude OneToOne(Encoder|Decoder)$ - * @apiviz.exclude \.codec\.replay\. - * @apiviz.exclude \.Default + * @apiviz.exclude [0-9][0-9] + * @apiviz.exclude Exception$ + * @apiviz.exclude Version$ */ package io.netty.handler.codec.http.websocketx; diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyOrHttpChooser.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyOrHttpChooser.java index e8f070782f..96de62d889 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyOrHttpChooser.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyOrHttpChooser.java @@ -33,16 +33,17 @@ import javax.net.ssl.SSLEngine; * {@link ChannelInboundByteHandler} which is responsible to setup the {@link ChannelPipeline} either for * HTTP or SPDY. This offers an easy way for users to support both at the same time while not care to * much about the low-level details. - * */ public abstract class SpdyOrHttpChooser extends ChannelDuplexHandler implements ChannelInboundByteHandler { + // TODO: Replace with generic NPN handler + public enum SelectedProtocol { - SpdyVersion2, - SpdyVersion3, - HttpVersion1_1, - HttpVersion1_0, - None + SPDY_2, + SPDY_3, + HTTP_1_1, + HTTP_1_0, + UNKNOWN } private final int maxSpdyContentLength; @@ -55,7 +56,7 @@ public abstract class SpdyOrHttpChooser extends ChannelDuplexHandler implements /** * Return the {@link SelectedProtocol} for the {@link SSLEngine}. If its not known yet implementations - * MUST return {@link SelectedProtocol#None}. + * MUST return {@link SelectedProtocol#UNKNOWN}. * */ protected abstract SelectedProtocol getProtocol(SSLEngine engine); @@ -98,17 +99,17 @@ public abstract class SpdyOrHttpChooser extends ChannelDuplexHandler implements SelectedProtocol protocol = getProtocol(handler.engine()); switch (protocol) { - case None: + case UNKNOWN: // Not done with choosing the protocol, so just return here for now, return false; - case SpdyVersion2: + case SPDY_2: addSpdyHandlers(ctx, 2); break; - case SpdyVersion3: + case SPDY_3: addSpdyHandlers(ctx, 3); break; - case HttpVersion1_0: - case HttpVersion1_1: + case HTTP_1_0: + case HTTP_1_1: addHttpHandlers(ctx); break; default: @@ -144,15 +145,15 @@ public abstract class SpdyOrHttpChooser extends ChannelDuplexHandler implements /** * Create the {@link ChannelInboundMessageHandler} that is responsible for handling the http requests - * when the {@link SelectedProtocol} was {@link SelectedProtocol#HttpVersion1_0} or - * {@link SelectedProtocol#HttpVersion1_1} + * when the {@link SelectedProtocol} was {@link SelectedProtocol#HTTP_1_0} or + * {@link SelectedProtocol#HTTP_1_1} */ protected abstract ChannelInboundMessageHandler createHttpRequestHandlerForHttp(); /** * Create the {@link ChannelInboundMessageHandler} that is responsible for handling the http responses - * when the {@link SelectedProtocol} was {@link SelectedProtocol#SpdyVersion2} or - * {@link SelectedProtocol#SpdyVersion3}. + * when the {@link SelectedProtocol} was {@link SelectedProtocol#SPDY_2} or + * {@link SelectedProtocol#SPDY_3}. * * Bye default this getMethod will just delecate to {@link #createHttpRequestHandlerForHttp()}, but * sub-classes may override this to change the behaviour. diff --git a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAddressType.java b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAddressType.java new file mode 100644 index 0000000000..5eb157befd --- /dev/null +++ b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAddressType.java @@ -0,0 +1,44 @@ +/* + * Copyright 2013 The Netty Project + * + * The Netty Project 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.netty.handler.codec.socks; + +public enum SocksAddressType { + IPv4((byte) 0x01), + DOMAIN((byte) 0x03), + IPv6((byte) 0x04), + UNKNOWN((byte) 0xff); + + private final byte b; + + SocksAddressType(byte b) { + this.b = b; + } + + public static SocksAddressType fromByte(byte b) { + for (SocksAddressType code : values()) { + if (code.b == b) { + return code; + } + } + return UNKNOWN; + } + + public byte byteValue() { + return b; + } +} + diff --git a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequest.java b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequest.java index a8431a0763..0bad2a85e4 100644 --- a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequest.java +++ b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequest.java @@ -28,7 +28,7 @@ import java.nio.charset.CharsetEncoder; */ public final class SocksAuthRequest extends SocksRequest { private static final CharsetEncoder asciiEncoder = CharsetUtil.getEncoder(CharsetUtil.US_ASCII); - private static final SubnegotiationVersion SUBNEGOTIATION_VERSION = SubnegotiationVersion.AUTH_PASSWORD; + private static final SocksSubnegotiationVersion SUBNEGOTIATION_VERSION = SocksSubnegotiationVersion.AUTH_PASSWORD; private final String username; private final String password; @@ -74,7 +74,7 @@ public final class SocksAuthRequest extends SocksRequest { @Override public void encodeAsByteBuf(ByteBuf byteBuf) { - byteBuf.writeByte(SUBNEGOTIATION_VERSION.getByteValue()); + byteBuf.writeByte(SUBNEGOTIATION_VERSION.byteValue()); byteBuf.writeByte(username.length()); byteBuf.writeBytes(username.getBytes(CharsetUtil.US_ASCII)); byteBuf.writeByte(password.length()); diff --git a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequestDecoder.java b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequestDecoder.java index 7485b37f3c..60bb857a6a 100644 --- a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequestDecoder.java +++ b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksAuthRequestDecoder.java @@ -31,7 +31,7 @@ public class SocksAuthRequestDecoder extends ReplayingDecoder authSchemes; + private final List authSchemes; - public SocksInitRequest(List authSchemes) { + public SocksInitRequest(List authSchemes) { super(SocksRequestType.INIT); if (authSchemes == null) { throw new NullPointerException("authSchemes"); @@ -38,20 +38,20 @@ public final class SocksInitRequest extends SocksRequest { } /** - * Returns the List<{@link AuthScheme}> of this {@link SocksInitRequest} + * Returns the List<{@link SocksAuthScheme}> of this {@link SocksInitRequest} * - * @return The List<{@link AuthScheme}> of this {@link SocksInitRequest} + * @return The List<{@link SocksAuthScheme}> of this {@link SocksInitRequest} */ - public List authSchemes() { + public List authSchemes() { return Collections.unmodifiableList(authSchemes); } @Override public void encodeAsByteBuf(ByteBuf byteBuf) { - byteBuf.writeByte(protocolVersion().getByteValue()); + byteBuf.writeByte(protocolVersion().byteValue()); byteBuf.writeByte(authSchemes.size()); - for (AuthScheme authScheme : authSchemes) { - byteBuf.writeByte(authScheme.getByteValue()); + for (SocksAuthScheme authScheme : authSchemes) { + byteBuf.writeByte(authScheme.byteValue()); } } } diff --git a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksInitRequestDecoder.java b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksInitRequestDecoder.java index e69794d03c..7f56c504f0 100644 --- a/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksInitRequestDecoder.java +++ b/codec-socks/src/main/java/io/netty/handler/codec/socks/SocksInitRequestDecoder.java @@ -33,8 +33,8 @@ public class SocksInitRequestDecoder extends ReplayingDecoder authSchemes = new ArrayList(); - private SocksMessage.ProtocolVersion version; + private final List authSchemes = new ArrayList(); + private SocksProtocolVersion version; private byte authSchemeNum; private SocksRequest msg = SocksCommonUtils.UNKNOWN_SOCKS_REQUEST; @@ -46,8 +46,8 @@ public class SocksInitRequestDecoder extends ReplayingDecoder extends ReferenceMap { +final class SoftReferenceMap extends ReferenceMap { public SoftReferenceMap(Map> delegate) { super(delegate); diff --git a/codec/src/main/java/io/netty/handler/codec/serialization/WeakReferenceMap.java b/codec/src/main/java/io/netty/handler/codec/serialization/WeakReferenceMap.java index d4fe985b46..94ecc17ed8 100644 --- a/codec/src/main/java/io/netty/handler/codec/serialization/WeakReferenceMap.java +++ b/codec/src/main/java/io/netty/handler/codec/serialization/WeakReferenceMap.java @@ -19,7 +19,7 @@ import java.lang.ref.Reference; import java.lang.ref.WeakReference; import java.util.Map; -public class WeakReferenceMap extends ReferenceMap { +final class WeakReferenceMap extends ReferenceMap { public WeakReferenceMap(Map> delegate) { super(delegate); diff --git a/common/src/main/java/io/netty/util/AttributeMap.java b/common/src/main/java/io/netty/util/AttributeMap.java index baa06a5a31..224baeb6d2 100644 --- a/common/src/main/java/io/netty/util/AttributeMap.java +++ b/common/src/main/java/io/netty/util/AttributeMap.java @@ -19,6 +19,8 @@ package io.netty.util; * Holds {@link Attribute}s which can be accessed via {@link AttributeKey}. * * Implementations must be Thread-safe. + * + * @apiviz.composedOf io.netty.util.Attribute oneway - - creates */ public interface AttributeMap { /** diff --git a/common/src/main/java/io/netty/util/ResourceLeakDetector.java b/common/src/main/java/io/netty/util/ResourceLeakDetector.java index 8987e323c9..bcd285f18b 100644 --- a/common/src/main/java/io/netty/util/ResourceLeakDetector.java +++ b/common/src/main/java/io/netty/util/ResourceLeakDetector.java @@ -26,6 +26,9 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicBoolean; +/** + * @apiviz.has io.netty.util.ResourceLeak oneway - - creates + */ public final class ResourceLeakDetector { private static final boolean ENABLED = SystemPropertyUtil.getBoolean("io.netty.resourceLeakDetection", false); diff --git a/common/src/main/java/io/netty/util/package-info.java b/common/src/main/java/io/netty/util/package-info.java index 1e33c17c8b..c5be16798a 100644 --- a/common/src/main/java/io/netty/util/package-info.java +++ b/common/src/main/java/io/netty/util/package-info.java @@ -21,6 +21,6 @@ * @apiviz.exclude ^java\.(lang|util)\. * @apiviz.exclude \.netty\.(?!util)[a-z0-9]+\. * @apiviz.exclude Util$ - * @apiviz.exclude \.EstimatableObjectWrapper$ + * @apiviz.exclude Exception$ */ package io.netty.util; diff --git a/example/src/main/java/io/netty/example/socksproxy/SocksServerConnectHandler.java b/example/src/main/java/io/netty/example/socksproxy/SocksServerConnectHandler.java index 5615e84236..f65dcf8008 100644 --- a/example/src/main/java/io/netty/example/socksproxy/SocksServerConnectHandler.java +++ b/example/src/main/java/io/netty/example/socksproxy/SocksServerConnectHandler.java @@ -26,8 +26,7 @@ import io.netty.channel.ChannelOption; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.socks.SocksCmdRequest; import io.netty.handler.codec.socks.SocksCmdResponse; -import io.netty.handler.codec.socks.SocksMessage; - +import io.netty.handler.codec.socks.SocksCmdStatus; @ChannelHandler.Sharable public final class SocksServerConnectHandler extends ChannelInboundMessageHandlerAdapter { @@ -44,7 +43,7 @@ public final class SocksServerConnectHandler extends ChannelInboundMessageHandle CallbackNotifier cb = new CallbackNotifier() { @Override public void onSuccess(final ChannelHandlerContext outboundCtx) { - ctx.channel().write(new SocksCmdResponse(SocksMessage.CmdStatus.SUCCESS, request.addressType())) + ctx.channel().write(new SocksCmdResponse(SocksCmdStatus.SUCCESS, request.addressType())) .addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture channelFuture) throws Exception { @@ -57,7 +56,7 @@ public final class SocksServerConnectHandler extends ChannelInboundMessageHandle @Override public void onFailure(ChannelHandlerContext outboundCtx, Throwable cause) { - ctx.channel().write(new SocksCmdResponse(SocksMessage.CmdStatus.FAILURE, request.addressType())); + ctx.channel().write(new SocksCmdResponse(SocksCmdStatus.FAILURE, request.addressType())); SocksServerUtils.closeOnFlush(ctx.channel()); } }; diff --git a/example/src/main/java/io/netty/example/socksproxy/SocksServerHandler.java b/example/src/main/java/io/netty/example/socksproxy/SocksServerHandler.java index 15fba05512..3f144de079 100644 --- a/example/src/main/java/io/netty/example/socksproxy/SocksServerHandler.java +++ b/example/src/main/java/io/netty/example/socksproxy/SocksServerHandler.java @@ -19,10 +19,12 @@ import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundMessageHandlerAdapter; import io.netty.handler.codec.socks.SocksAuthResponse; +import io.netty.handler.codec.socks.SocksAuthScheme; +import io.netty.handler.codec.socks.SocksAuthStatus; import io.netty.handler.codec.socks.SocksCmdRequest; import io.netty.handler.codec.socks.SocksCmdRequestDecoder; +import io.netty.handler.codec.socks.SocksCmdType; import io.netty.handler.codec.socks.SocksInitResponse; -import io.netty.handler.codec.socks.SocksMessage; import io.netty.handler.codec.socks.SocksRequest; @@ -40,18 +42,18 @@ public final class SocksServerHandler extends ChannelInboundMessageHandlerAdapte case INIT: { // auth support example // ctx.pipeline().addFirst("socksAuthRequestDecoder",new SocksAuthRequestDecoder()); -// ctx.write(new SocksInitResponse(SocksMessage.AuthScheme.AUTH_PASSWORD)); +// ctx.write(new SocksInitResponse(SocksMessage.SocksAuthScheme.AUTH_PASSWORD)); ctx.pipeline().addFirst(SocksCmdRequestDecoder.getName(), new SocksCmdRequestDecoder()); - ctx.write(new SocksInitResponse(SocksMessage.AuthScheme.NO_AUTH)); + ctx.write(new SocksInitResponse(SocksAuthScheme.NO_AUTH)); break; } case AUTH: ctx.pipeline().addFirst(SocksCmdRequestDecoder.getName(), new SocksCmdRequestDecoder()); - ctx.write(new SocksAuthResponse(SocksMessage.AuthStatus.SUCCESS)); + ctx.write(new SocksAuthResponse(SocksAuthStatus.SUCCESS)); break; case CMD: SocksCmdRequest req = (SocksCmdRequest) socksRequest; - if (req.cmdType() == SocksMessage.CmdType.CONNECT) { + if (req.cmdType() == SocksCmdType.CONNECT) { ctx.pipeline().addLast(SocksServerConnectHandler.getName(), new SocksServerConnectHandler()); ctx.pipeline().remove(this); ctx.nextInboundMessageBuffer().add(socksRequest);