@Override
    public void channelRead(ChannelHandlerContext ctx, Object msg)
            throws Exception {
        FullHttpResponse response;
        String requestUri;
        if (msg instanceof HttpRequest) {
            HttpRequest req = (HttpRequest) msg;
            boolean keepAlive = isKeepAlive(req);
            requestUri = req.getUri().toLowerCase();

            ServerRequest serverRequest = new ServerRequest(
                    ((InetSocketAddress) ctx.channel().remoteAddress())
                            .getHostString());
            dao.mergeServerRequest(serverRequest);
            if (is100ContinueExpected(req)) {
                ctx.write(new DefaultFullHttpResponse(HTTP_1_1, CONTINUE));
            }
            switch (requestUri) {
                case HELLO:

                    content = Unpooled.unreleasableBuffer(Unpooled.copiedBuffer(
                            "Hello World!", CharsetUtil.UTF_8));
                    response = new DefaultFullHttpResponse(HTTP_1_1, OK,
                            content.duplicate());

                    timer.newTimeout(new HelloWorldTimerTask(ctx, response,
                            keepAlive), 10, TimeUnit.SECONDS);
                    return;

                case STATUS:
                    content = Unpooled.unreleasableBuffer(Unpooled.copiedBuffer(
                            generateStatus(), CharsetUtil.UTF_8));
                    response = new DefaultFullHttpResponse(HTTP_1_1, OK,
                            content.duplicate());
                    writeToResponse(ctx, response, keepAlive);
                    return;
                default:

                    if (requestUri.matches(REDIRECT_REGEXP)) {
                        QueryStringDecoder qsd = new QueryStringDecoder(requestUri);
                        List<String> redirectUrl = qsd.parameters().get("url");
                        response = new DefaultFullHttpResponse(HTTP_1_1, FOUND);
                        response.headers().set(LOCATION, redirectUrl);

                        dao.mergeRedirect(new Redirect(
                                redirectUrl.get(0), 1));
                    } else {

                        response = new DefaultFullHttpResponse(HTTP_1_1, FORBIDDEN);
                    }
                    writeToResponse(ctx, response, keepAlive);
            }
        }
    }