|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.hadoop.hbase.rest.client.Client
@InterfaceAudience.Public @InterfaceStability.Stable public class Client
A wrapper around HttpClient which provides some useful function and semantics for interacting with the REST gateway.
| Field Summary | |
|---|---|
static org.apache.commons.httpclient.Header[] |
EMPTY_HEADER_ARRAY
|
| Constructor Summary | |
|---|---|
Client()
Default Constructor |
|
Client(Cluster cluster)
Constructor |
|
| Method Summary | |
|---|---|
void |
addExtraHeader(String name,
String value)
Add extra headers. |
Response |
delete(Cluster cluster,
String path)
Send a DELETE request |
Response |
delete(String path)
Send a DELETE request |
int |
execute(Cluster cluster,
org.apache.commons.httpclient.HttpMethod method,
org.apache.commons.httpclient.Header[] headers,
String path)
Execute a transaction method. |
int |
executePathOnly(Cluster cluster,
org.apache.commons.httpclient.HttpMethod method,
org.apache.commons.httpclient.Header[] headers,
String path)
Execute a transaction method given only the path. |
int |
executeURI(org.apache.commons.httpclient.HttpMethod method,
org.apache.commons.httpclient.Header[] headers,
String uri)
Execute a transaction method given a complete URI. |
Response |
get(Cluster cluster,
String path)
Send a GET request |
Response |
get(Cluster c,
String path,
org.apache.commons.httpclient.Header[] headers)
Send a GET request |
Response |
get(Cluster cluster,
String path,
String accept)
Send a GET request |
Response |
get(String path)
Send a GET request |
Response |
get(String path,
org.apache.commons.httpclient.Header[] headers)
Send a GET request |
Response |
get(String path,
String accept)
Send a GET request |
Cluster |
getCluster()
|
String |
getExtraHeader(String name)
Get an extra header value. |
Map<String,String> |
getExtraHeaders()
Get all extra headers (read-only). |
org.apache.commons.httpclient.HttpClient |
getHttpClient()
|
Response |
head(Cluster cluster,
String path,
org.apache.commons.httpclient.Header[] headers)
Send a HEAD request |
Response |
head(String path)
Send a HEAD request |
Response |
post(Cluster cluster,
String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
Send a POST request |
Response |
post(Cluster cluster,
String path,
String contentType,
byte[] content)
Send a POST request |
Response |
post(String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
Send a POST request |
Response |
post(String path,
String contentType,
byte[] content)
Send a POST request |
Response |
put(Cluster cluster,
String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
Send a PUT request |
Response |
put(Cluster cluster,
String path,
String contentType,
byte[] content)
Send a PUT request |
Response |
put(String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
Send a PUT request |
Response |
put(String path,
String contentType,
byte[] content)
Send a PUT request |
void |
removeExtraHeader(String name)
Remove an extra header. |
void |
setCluster(Cluster cluster)
|
void |
shutdown()
Shut down the client. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final org.apache.commons.httpclient.Header[] EMPTY_HEADER_ARRAY
| Constructor Detail |
|---|
public Client()
public Client(Cluster cluster)
cluster - the cluster definition| Method Detail |
|---|
public void shutdown()
public org.apache.commons.httpclient.HttpClient getHttpClient()
public void addExtraHeader(String name,
String value)
public String getExtraHeader(String name)
public Map<String,String> getExtraHeaders()
public void removeExtraHeader(String name)
public int executePathOnly(Cluster cluster,
org.apache.commons.httpclient.HttpMethod method,
org.apache.commons.httpclient.Header[] headers,
String path)
throws IOException
cluster - the cluster definitionmethod - the transaction methodheaders - HTTP header values to sendpath - the properly urlencoded path
IOException
public int executeURI(org.apache.commons.httpclient.HttpMethod method,
org.apache.commons.httpclient.Header[] headers,
String uri)
throws IOException
method - the transaction methodheaders - HTTP header values to senduri - a properly urlencoded URI
IOException
public int execute(Cluster cluster,
org.apache.commons.httpclient.HttpMethod method,
org.apache.commons.httpclient.Header[] headers,
String path)
throws IOException
cluster - the cluster definitionmethod - the HTTP methodheaders - HTTP header values to sendpath - the properly urlencoded path or URI
IOExceptionpublic Cluster getCluster()
public void setCluster(Cluster cluster)
cluster - the cluster definition
public Response head(String path)
throws IOException
path - the path or URI
IOException
public Response head(Cluster cluster,
String path,
org.apache.commons.httpclient.Header[] headers)
throws IOException
cluster - the cluster definitionpath - the path or URIheaders - the HTTP headers to include in the request
IOException
public Response get(String path)
throws IOException
path - the path or URI
IOException
public Response get(Cluster cluster,
String path)
throws IOException
cluster - the cluster definitionpath - the path or URI
IOException
public Response get(String path,
String accept)
throws IOException
path - the path or URIaccept - Accept header value
IOException
public Response get(Cluster cluster,
String path,
String accept)
throws IOException
cluster - the cluster definitionpath - the path or URIaccept - Accept header value
IOException
public Response get(String path,
org.apache.commons.httpclient.Header[] headers)
throws IOException
path - the path or URIheaders - the HTTP headers to include in the request,
Accept must be supplied
IOException
public Response get(Cluster c,
String path,
org.apache.commons.httpclient.Header[] headers)
throws IOException
c - the cluster definitionpath - the path or URIheaders - the HTTP headers to include in the request
IOException
public Response put(String path,
String contentType,
byte[] content)
throws IOException
path - the path or URIcontentType - the content MIME typecontent - the content bytes
IOException
public Response put(Cluster cluster,
String path,
String contentType,
byte[] content)
throws IOException
cluster - the cluster definitionpath - the path or URIcontentType - the content MIME typecontent - the content bytes
IOException
public Response put(String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
throws IOException
path - the path or URIheaders - the HTTP headers to include, Content-Type must be
suppliedcontent - the content bytes
IOException
public Response put(Cluster cluster,
String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
throws IOException
cluster - the cluster definitionpath - the path or URIheaders - the HTTP headers to include, Content-Type must be
suppliedcontent - the content bytes
IOException
public Response post(String path,
String contentType,
byte[] content)
throws IOException
path - the path or URIcontentType - the content MIME typecontent - the content bytes
IOException
public Response post(Cluster cluster,
String path,
String contentType,
byte[] content)
throws IOException
cluster - the cluster definitionpath - the path or URIcontentType - the content MIME typecontent - the content bytes
IOException
public Response post(String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
throws IOException
path - the path or URIheaders - the HTTP headers to include, Content-Type must be
suppliedcontent - the content bytes
IOException
public Response post(Cluster cluster,
String path,
org.apache.commons.httpclient.Header[] headers,
byte[] content)
throws IOException
cluster - the cluster definitionpath - the path or URIheaders - the HTTP headers to include, Content-Type must be
suppliedcontent - the content bytes
IOException
public Response delete(String path)
throws IOException
path - the path or URI
IOException
public Response delete(Cluster cluster,
String path)
throws IOException
cluster - the cluster definitionpath - the path or URI
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||