org.restlet.ext.netty.internal

## Class HttpRequestHandler

- java.lang.Object
- - org.jboss.netty.channel.SimpleChannelUpstreamHandler
  - - org.restlet.ext.netty.internal.HttpRequestHandler

All Implemented Interfaces:
  org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler

    @ChannelHandler.Sharable
    public class HttpRequestHandler
    extends org.jboss.netty.channel.SimpleChannelUpstreamHandler

HTTP request handler implementation. Pass HTTP requests to Restlet and gather HTTP response from Restlet and provide it back to the client.

Author:
  Gabriel Ciuloaica (gciuloaica@gmail.com), Jerome Louvel

### Nested Class Summary

### Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler

`org.jboss.netty.channel.ChannelHandler.Sharable`

### Constructor Summary

Constructors
Constructor and Description
`HttpRequestHandler(NettyServerHelper serverHelper)` Constructor.

### Method Summary

Methods
`void` `exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e)`
`static byte[]` `longToHex(long l)` Convert a long value to hex byte array.
`void` `messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent messageEvent)`

### Methods inherited from class org.jboss.netty.channel.SimpleChannelUpstreamHandler

`channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, handleUpstream, writeComplete`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### HttpRequestHandler

    public HttpRequestHandler(NettyServerHelper serverHelper)

Constructor. Creates a new handler instance wrapping server helper.

Parameters:
  `serverHelper` - The server helper.

### Method Detail

#### exceptionCaught

    public void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx,
                       org.jboss.netty.channel.ExceptionEvent e)
                         throws java.lang.Exception

Overrides:
  `exceptionCaught` in class `org.jboss.netty.channel.SimpleChannelUpstreamHandler`
Throws:
  `java.lang.Exception`

#### messageReceived

    public void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx,
                       org.jboss.netty.channel.MessageEvent messageEvent)
                         throws java.lang.Exception

Overrides:
  `messageReceived` in class `org.jboss.netty.channel.SimpleChannelUpstreamHandler`
Throws:
  `java.lang.Exception`

#### longToHex

    public static byte[] longToHex(long l)

Convert a long value to hex byte array.

Parameters:
  `l` - - value to be converted
Returns:
  hex representation