public class PortUnificationServerHandler extends FrameDecoder
ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private boolean |
detectGzip |
private boolean |
detectSsl |
private SslContext |
sslCtx |
cumulation, DEFAULT_MAX_COMPOSITEBUFFER_COMPONENTS| Modifier | Constructor and Description |
|---|---|
|
PortUnificationServerHandler(SslContext sslCtx) |
private |
PortUnificationServerHandler(SslContext sslCtx,
boolean detectSsl,
boolean detectGzip) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.Object |
decode(ChannelHandlerContext ctx,
Channel channel,
ChannelBuffer buffer)
Decodes the received packets so far into a frame.
|
private void |
enableGzip(ChannelHandlerContext ctx) |
private void |
enableSsl(ChannelHandlerContext ctx) |
private static boolean |
isFactorial(int magic1) |
private boolean |
isGzip(int magic1,
int magic2) |
private static boolean |
isHttp(int magic1,
int magic2) |
private boolean |
isSsl(ChannelBuffer buffer) |
private void |
switchToFactorial(ChannelHandlerContext ctx) |
private void |
switchToHttp(ChannelHandlerContext ctx) |
actualReadableBytes, afterAdd, afterRemove, appendToCumulation, beforeAdd, beforeRemove, channelClosed, channelDisconnected, cleanup, decodeLast, exceptionCaught, extractFrame, getMaxCumulationBufferCapacity, getMaxCumulationBufferComponents, internalBuffer, isUnfold, messageReceived, newCumulationBuffer, replace, setMaxCumulationBufferCapacity, setMaxCumulationBufferComponents, setUnfold, unfoldAndFireMessageReceived, updateCumulationchannelBound, channelConnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeCompleteprivate final SslContext sslCtx
private final boolean detectSsl
private final boolean detectGzip
public PortUnificationServerHandler(SslContext sslCtx)
private PortUnificationServerHandler(SslContext sslCtx, boolean detectSsl, boolean detectGzip)
protected java.lang.Object decode(ChannelHandlerContext ctx, Channel channel, ChannelBuffer buffer)
FrameDecoderFrameDecoder.extractFrame(ChannelBuffer, int, int) method,
to make optimizations easier later.decode in class FrameDecoderctx - the context of this handlerchannel - the current channelbuffer - the cumulative buffer of received packets so far.
Note that the buffer might be empty, which means you
should not make an assumption that the buffer contains
at least one byte in your decoder implementation.null if there's not enough data in the buffer to decode a frame.private boolean isSsl(ChannelBuffer buffer)
private boolean isGzip(int magic1,
int magic2)
private static boolean isHttp(int magic1,
int magic2)
private static boolean isFactorial(int magic1)
private void enableSsl(ChannelHandlerContext ctx)
private void enableGzip(ChannelHandlerContext ctx)
private void switchToHttp(ChannelHandlerContext ctx)
private void switchToFactorial(ChannelHandlerContext ctx)