voldemort.server.rest
Class RestServerPutRequestValidator

java.lang.Object
  extended by voldemort.server.rest.RestServerRequestValidator
      extended by voldemort.server.rest.RestServerPutRequestValidator

public class RestServerPutRequestValidator
extends RestServerRequestValidator

This class is used to parse an incoming put request. Parses and validates the REST Request and constructs a CompositeVoldemortRequestObject. Also Handles exceptions specific to put operation.


Field Summary
 
Fields inherited from class voldemort.server.rest.RestServerRequestValidator
logger, messageEvent, parsedKeys, parsedOperationType, parsedRequestOriginTimeInMs, parsedRoutingType, parsedTimeoutInMs, parsedValue, parsedVectorClock, request, requestObject, storeName, storeRepository
 
Constructor Summary
RestServerPutRequestValidator(org.jboss.netty.handler.codec.http.HttpRequest request, org.jboss.netty.channel.MessageEvent messageEvent, StoreRepository storeRepository)
           
 
Method Summary
 CompositeVoldemortRequest<ByteArray,byte[]> constructCompositeVoldemortRequestObject()
           
protected  boolean hasContentLength()
          Retrieves and validates the content length from the REST request.
protected  boolean hasContentType()
          Retrieves and validates the content type from the REST request TODO REST-Server Should check for valid content type (only binary allowed)
 boolean parseAndValidateRequest()
          Validations specific to PUT
 
Methods inherited from class voldemort.server.rest.RestServerRequestValidator
getParsedRoutingType, getStoreName, hasKey, hasRoutingCodeHeader, hasTimeOutHeader, hasTimeStampHeader, hasVectorClock, isStoreValid, parseKeys, parseStoreName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestServerPutRequestValidator

public RestServerPutRequestValidator(org.jboss.netty.handler.codec.http.HttpRequest request,
                                     org.jboss.netty.channel.MessageEvent messageEvent,
                                     StoreRepository storeRepository)
Method Detail

constructCompositeVoldemortRequestObject

public CompositeVoldemortRequest<ByteArray,byte[]> constructCompositeVoldemortRequestObject()
Specified by:
constructCompositeVoldemortRequestObject in class RestServerRequestValidator

parseAndValidateRequest

public boolean parseAndValidateRequest()
Validations specific to PUT

Overrides:
parseAndValidateRequest in class RestServerRequestValidator
Returns:
true if request is valid else false

hasContentLength

protected boolean hasContentLength()
Retrieves and validates the content length from the REST request.

Returns:
true if has content length

hasContentType

protected boolean hasContentType()
Retrieves and validates the content type from the REST request TODO REST-Server Should check for valid content type (only binary allowed)

Returns:
true if has content type.


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