voldemort.rest
Class AbstractRestRequestHandler

java.lang.Object
  extended by org.jboss.netty.channel.SimpleChannelUpstreamHandler
      extended by voldemort.rest.AbstractRestRequestHandler
All Implemented Interfaces:
org.jboss.netty.channel.ChannelHandler, org.jboss.netty.channel.ChannelUpstreamHandler
Direct Known Subclasses:
RestCoordinatorRequestHandler, RestServerRequestHandler

public abstract class AbstractRestRequestHandler
extends org.jboss.netty.channel.SimpleChannelUpstreamHandler

Class to handle a REST request and send response back to the client


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Field Summary
 org.jboss.netty.handler.codec.http.HttpRequest request
           
 
Constructor Summary
AbstractRestRequestHandler()
           
AbstractRestRequestHandler(boolean isVectorClockOptional)
           
 
Method Summary
 void exceptionCaught(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.ExceptionEvent e)
           
 void messageReceived(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent messageEvent)
           
protected abstract  void registerRequest(RestRequestValidator requestValidator, org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.MessageEvent messageEvent)
          Function used to create a valid request and pass it to the next handler in the Netty pipeline.
 
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
 

Field Detail

request

public org.jboss.netty.handler.codec.http.HttpRequest request
Constructor Detail

AbstractRestRequestHandler

public AbstractRestRequestHandler()

AbstractRestRequestHandler

public AbstractRestRequestHandler(boolean isVectorClockOptional)
Method Detail

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

registerRequest

protected abstract void registerRequest(RestRequestValidator requestValidator,
                                        org.jboss.netty.channel.ChannelHandlerContext ctx,
                                        org.jboss.netty.channel.MessageEvent messageEvent)
Function used to create a valid request and pass it to the next handler in the Netty pipeline.

Parameters:
requestValidator - The Validator object used to construct the request object
ctx - Context of the Netty channel
messageEvent - Message Event used to write the response / exception

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


Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu