org.elasticsearch.http.netty
Class NettyHttpRequest

java.lang.Object
  extended by org.elasticsearch.rest.support.AbstractRestRequest
      extended by org.elasticsearch.http.netty.NettyHttpRequest
All Implemented Interfaces:
ToXContent.Params, HttpRequest, RestRequest

public class NettyHttpRequest
extends AbstractRestRequest
implements HttpRequest


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.elasticsearch.rest.RestRequest
RestRequest.Method
 
Constructor Summary
NettyHttpRequest(org.elasticsearch.common.netty.handler.codec.http.HttpRequest request)
           
 
Method Summary
 java.lang.String contentAsString()
           
 byte[] contentByteArray()
           
 int contentByteArrayOffset()
           
 int contentLength()
           
 boolean contentUnsafe()
          Is the byte array content safe or unsafe for usage on other threads
 java.lang.String cookie()
           
 boolean hasContent()
           
 boolean hasParam(java.lang.String key)
           
 java.lang.String header(java.lang.String name)
           
 java.util.Set<java.lang.String> headerNames()
           
 RestRequest.Method method()
           
 java.lang.String param(java.lang.String key)
           
 java.lang.String param(java.lang.String key, java.lang.String defaultValue)
           
 java.util.Map<java.lang.String,java.lang.String> params()
           
 java.lang.String path()
          The path part of the URI (without the query string).
 java.lang.String uri()
          The uri of the rest request, with the query string.
 
Methods inherited from class org.elasticsearch.rest.support.AbstractRestRequest
paramAsBoolean, paramAsBoolean, paramAsFloat, paramAsInt, paramAsSize, paramAsStringArray, paramAsTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.elasticsearch.rest.RestRequest
paramAsBoolean, paramAsBoolean, paramAsFloat, paramAsInt, paramAsSize, paramAsStringArray, paramAsTime
 

Constructor Detail

NettyHttpRequest

public NettyHttpRequest(org.elasticsearch.common.netty.handler.codec.http.HttpRequest request)
Method Detail

method

public RestRequest.Method method()
Specified by:
method in interface RestRequest

uri

public java.lang.String uri()
Description copied from interface: RestRequest
The uri of the rest request, with the query string.

Specified by:
uri in interface RestRequest

path

public java.lang.String path()
Description copied from interface: RestRequest
The path part of the URI (without the query string).

Specified by:
path in interface RestRequest

params

public java.util.Map<java.lang.String,java.lang.String> params()
Specified by:
params in interface RestRequest

hasContent

public boolean hasContent()
Specified by:
hasContent in interface RestRequest

contentLength

public int contentLength()
Specified by:
contentLength in interface RestRequest

contentUnsafe

public boolean contentUnsafe()
Description copied from interface: RestRequest
Is the byte array content safe or unsafe for usage on other threads

Specified by:
contentUnsafe in interface RestRequest

contentByteArray

public byte[] contentByteArray()
Specified by:
contentByteArray in interface RestRequest

contentByteArrayOffset

public int contentByteArrayOffset()
Specified by:
contentByteArrayOffset in interface RestRequest

contentAsString

public java.lang.String contentAsString()
Specified by:
contentAsString in interface RestRequest

headerNames

public java.util.Set<java.lang.String> headerNames()
Specified by:
headerNames in interface RestRequest

header

public java.lang.String header(java.lang.String name)
Specified by:
header in interface RestRequest

cookie

public java.lang.String cookie()
Specified by:
cookie in interface RestRequest

hasParam

public boolean hasParam(java.lang.String key)
Specified by:
hasParam in interface RestRequest

param

public java.lang.String param(java.lang.String key)
Specified by:
param in interface ToXContent.Params
Specified by:
param in interface RestRequest

param

public java.lang.String param(java.lang.String key,
                              java.lang.String defaultValue)
Specified by:
param in interface ToXContent.Params