org.apache.hadoop.hbase.rest.client
Class Response

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.client.Response

public class Response
extends Object

The HTTP result code, response headers, and body of a HTTP response.


Constructor Summary
Response(int code)
          Constructor
Response(int code, org.apache.commons.httpclient.Header[] headers)
          Constructor
Response(int code, org.apache.commons.httpclient.Header[] headers, byte[] body)
          Constructor
 
Method Summary
 byte[] getBody()
           
 int getCode()
           
 String getHeader(String key)
           
 org.apache.commons.httpclient.Header[] getHeaders()
           
 String getLocation()
           
 boolean hasBody()
           
 void setBody(byte[] body)
           
 void setCode(int code)
           
 void setHeaders(org.apache.commons.httpclient.Header[] headers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response

public Response(int code)
Constructor

Parameters:
code - the HTTP response code

Response

public Response(int code,
                org.apache.commons.httpclient.Header[] headers)
Constructor

Parameters:
code - the HTTP response code
headers - the HTTP response headers

Response

public Response(int code,
                org.apache.commons.httpclient.Header[] headers,
                byte[] body)
Constructor

Parameters:
code - the HTTP response code
headers - the HTTP response headers
body - the response body, can be null
Method Detail

getCode

public int getCode()
Returns:
the HTTP response code

getHeaders

public org.apache.commons.httpclient.Header[] getHeaders()
Returns:
the HTTP response headers

getHeader

public String getHeader(String key)

getLocation

public String getLocation()
Returns:
the value of the Location header

hasBody

public boolean hasBody()
Returns:
true if a response body was sent

getBody

public byte[] getBody()
Returns:
the HTTP response body

setCode

public void setCode(int code)
Parameters:
code - the HTTP response code

setHeaders

public void setHeaders(org.apache.commons.httpclient.Header[] headers)
Parameters:
headers - the HTTP response headers

setBody

public void setBody(byte[] body)
Parameters:
body - the response body


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.