|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.basho.riak.client.http.util.ClientHelper
public class ClientHelper
This class performs the actual HTTP requests underlying the operations in RiakClient and returns the resulting HTTP responses. It is up to RiakClient to interpret the responses and translate them into the appropriate format.
Constructor Summary | |
---|---|
ClientHelper(RiakConfig config,
String clientId)
|
Method Summary | |
---|---|
HttpResponse |
delete(String bucket,
String key,
RequestMeta meta)
Same as RiakClient , except only returning the HTTP response |
HttpResponse |
fetch(String bucket,
String key,
RequestMeta meta)
|
HttpResponse |
fetch(String bucket,
String key,
RequestMeta meta,
boolean streamResponse)
Same as RiakClient , except only returning the HTTP response and
allows the response to be streamed. |
HttpResponse |
fetchIndex(String bucket,
String indexName,
int[] values)
Perform the fetch/query on an index |
HttpResponse |
fetchIndex(String bucket,
String indexName,
String[] values)
Perform the fetch/query on an index |
HttpResponse |
fetchMeta(String bucket,
String key,
RequestMeta meta)
Same as RiakClient , except only returning the HTTP response |
HttpResponse |
getBucketSchema(String bucket,
RequestMeta meta)
Same as RiakClient.getBucketSchema(String, RequestMeta) , except
only returning the HTTP response. |
byte[] |
getClientId()
See RiakClient.getClientId() |
RiakConfig |
getConfig()
|
RiakExceptionHandler |
getExceptionHandler()
|
org.apache.http.client.HttpClient |
getHttpClient()
Return the HttpClient used to make requests, which can be
configured. |
HttpResponse |
listBucket(String bucket,
RequestMeta meta,
boolean streamResponse)
Same as RiakClient , except only returning the HTTP response, and
if streamResponse==true, the response will be streamed back, so the user
is responsible for calling HttpResponseDecorator.close() |
HttpResponse |
listBuckets()
List the buckets in Riak |
HttpResponse |
mapReduce(String job,
RequestMeta meta)
Same as RiakClient , except only returning the HTTP response |
HttpResponse |
ping()
Same as RiakClient.ping() |
HttpResponse |
setBucketSchema(String bucket,
JSONObject schema,
RequestMeta meta)
See RiakClient.setBucketSchema(String, com.basho.riak.client.http.RiakBucketInfo, RequestMeta) |
void |
setClientId(String clientId)
|
void |
setExceptionHandler(RiakExceptionHandler exceptionHandler)
Install an exception handler. |
HttpResponse |
stats()
Same as RiakClient.stats() |
HttpResponse |
store(RiakObject object,
RequestMeta meta)
Same as RiakClient , except only returning the HTTP response |
boolean |
stream(String bucket,
String key,
StreamHandler handler,
RequestMeta meta)
Same as RiakClient , except only returning the HTTP response |
HttpResponse |
toss(RiakIORuntimeException e)
Hands exception e to installed exception handler if there is
one or throw it. |
HttpResponse |
toss(RiakResponseRuntimeException e)
|
HttpResponse |
walk(String bucket,
String key,
String walkSpec,
RequestMeta meta)
Same as RiakClient , except only returning the HTTP response |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClientHelper(RiakConfig config, String clientId)
Method Detail |
---|
public byte[] getClientId()
RiakClient.getClientId()
public void setClientId(String clientId)
public HttpResponse setBucketSchema(String bucket, JSONObject schema, RequestMeta meta)
RiakClient.setBucketSchema(String, com.basho.riak.client.http.RiakBucketInfo, RequestMeta)
public HttpResponse getBucketSchema(String bucket, RequestMeta meta)
RiakClient.getBucketSchema(String, RequestMeta)
, except
only returning the HTTP response.
public HttpResponse listBuckets()
HttpResponse
whose body should be the result of asking
Riak to list buckets.public HttpResponse listBucket(String bucket, RequestMeta meta, boolean streamResponse)
RiakClient
, except only returning the HTTP response, and
if streamResponse==true, the response will be streamed back, so the user
is responsible for calling HttpResponseDecorator.close()
public HttpResponse store(RiakObject object, RequestMeta meta)
RiakClient
, except only returning the HTTP response
public HttpResponse fetchMeta(String bucket, String key, RequestMeta meta)
RiakClient
, except only returning the HTTP response
public HttpResponse fetch(String bucket, String key, RequestMeta meta, boolean streamResponse)
RiakClient
, except only returning the HTTP response and
allows the response to be streamed.
bucket
- Same as RiakClient
key
- Same as RiakClient
meta
- Same as RiakClient
streamResponse
- If true, the connection will NOT be released. Use
HttpResponse.getHttpMethod().getResponseBodyAsStream() to get
the response stream; HttpResponse.getBody() will return null.
RiakClient
public HttpResponse fetch(String bucket, String key, RequestMeta meta)
public boolean stream(String bucket, String key, StreamHandler handler, RequestMeta meta) throws IOException
RiakClient
, except only returning the HTTP response
IOException
public HttpResponse delete(String bucket, String key, RequestMeta meta)
RiakClient
, except only returning the HTTP response
public HttpResponse walk(String bucket, String key, String walkSpec, RequestMeta meta)
RiakClient
, except only returning the HTTP response
public HttpResponse mapReduce(String job, RequestMeta meta)
RiakClient
, except only returning the HTTP response
public HttpResponse fetchIndex(String bucket, String indexName, String[] values)
bucket
- the bucketindexName
- the name of the indexvalues
- an array of Strings, if only 1 long, then a value, if longer
the 1st 2 elements are treated as the bounds for a range
HttpResponse
public HttpResponse fetchIndex(String bucket, String indexName, int[] values)
bucket
- the bucketindexName
- the name of the indexvalues
- an array of ints, if only 1 long, then a value, if longer
the 1st 2 elements are treated as the bounds for a range
HttpResponse
public HttpResponse ping()
RiakClient.ping()
public RiakExceptionHandler getExceptionHandler()
public HttpResponse stats()
RiakClient.stats()
HttpResponse
whose body should be the result of asking
Riak for its stats (status).public void setExceptionHandler(RiakExceptionHandler exceptionHandler)
public HttpResponse toss(RiakIORuntimeException e)
e
to installed exception handler if there is
one or throw it.
HttpResponse
.public HttpResponse toss(RiakResponseRuntimeException e)
public org.apache.http.client.HttpClient getHttpClient()
HttpClient
used to make requests, which can be
configured.
public RiakConfig getConfig()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |