public class HttpUploadServerHandler extends SimpleChannelUpstreamHandler
ChannelHandler.Sharable| Modifier and Type | Field and Description |
|---|---|
private HttpPostRequestDecoder |
decoder |
private static HttpDataFactory |
factory |
private boolean |
readingChunks |
private HttpRequest |
request |
private java.lang.StringBuilder |
responseContent |
| Constructor and Description |
|---|
HttpUploadServerHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
channelClosed(ChannelHandlerContext ctx,
ChannelStateEvent e)
Invoked when a
Channel was closed and all its related resources
were released. |
void |
exceptionCaught(ChannelHandlerContext ctx,
ExceptionEvent e)
Invoked when an exception was raised by an I/O thread or a
ChannelHandler. |
void |
messageReceived(ChannelHandlerContext ctx,
MessageEvent e)
Invoked when a message object (e.g:
ChannelBuffer) was received
from a remote peer. |
private void |
readHttpDataAllReceive(Channel channel)
Example of reading all InterfaceHttpData from finished transfer
|
private void |
readHttpDataChunkByChunk()
Example of reading request by chunk and getting values from chunk to
chunk
|
private void |
writeHttpData(InterfaceHttpData data) |
private void |
writeMenu(MessageEvent e) |
private void |
writeResponse(Channel channel) |
channelBound, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeCompleteprivate static final HttpDataFactory factory
private final java.lang.StringBuilder responseContent
private HttpPostRequestDecoder decoder
private HttpRequest request
private boolean readingChunks
public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e)
SimpleChannelUpstreamHandlerChannel was closed and all its related resources
were released.channelClosed in class SimpleChannelUpstreamHandlerpublic void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws java.lang.Exception
SimpleChannelUpstreamHandlerChannelBuffer) was received
from a remote peer.messageReceived in class SimpleChannelUpstreamHandlerjava.lang.Exceptionprivate void readHttpDataAllReceive(Channel channel)
private void readHttpDataChunkByChunk()
private void writeHttpData(InterfaceHttpData data)
private void writeResponse(Channel channel)
private void writeMenu(MessageEvent e)
public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e)
SimpleChannelUpstreamHandlerChannelHandler.exceptionCaught in class SimpleChannelUpstreamHandler