com.basho.riak.client.util
Class ClientHelper

java.lang.Object
  extended by com.basho.riak.client.util.ClientHelper

Deprecated. with the addition of a protocol buffers client in 0.14 all the existing REST client code should be in client.http.* this class has therefore been moved. Please use com.basho.riak.client.http.util.ClientHelper instead.

WARNING: This class will be REMOVED in the next version.

@Deprecated
public class ClientHelper
extends Object

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.

See Also:
ClientHelper

Constructor Summary
ClientHelper(RiakConfig config, String clientId)
          Deprecated.  
 
Method Summary
 HttpResponse delete(String bucket, String key, RequestMeta meta)
          Deprecated. Same as RiakClient, except only returning the HTTP response
 HttpResponse fetch(String bucket, String key, RequestMeta meta)
          Deprecated.  
 HttpResponse fetch(String bucket, String key, RequestMeta meta, boolean streamResponse)
          Deprecated. Same as RiakClient, except only returning the HTTP response and allows the response to be streamed.
 HttpResponse fetchMeta(String bucket, String key, RequestMeta meta)
          Deprecated. Same as RiakClient, except only returning the HTTP response
 HttpResponse getBucketSchema(String bucket, RequestMeta meta)
          Deprecated. Same as RiakClient.getBucketSchema(String, RequestMeta), except only returning the HTTP response.
 byte[] getClientId()
          Deprecated. See RiakClient.getClientId()
 RiakConfig getConfig()
          Deprecated.  
 RiakExceptionHandler getExceptionHandler()
          Deprecated.  
 org.apache.http.client.HttpClient getHttpClient()
          Deprecated. Return the HttpClient used to make requests, which can be configured.
 HttpResponse listBucket(String bucket, RequestMeta meta, boolean streamResponse)
          Deprecated. 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()
          Deprecated. List the buckets in Riak
 HttpResponse mapReduce(String job, RequestMeta meta)
          Deprecated. Same as RiakClient, except only returning the HTTP response
 HttpResponse setBucketSchema(String bucket, JSONObject schema, RequestMeta meta)
          Deprecated. See RiakClient#setBucketSchema(String, com.basho.riak.client.http.RiakBucketInfo, RequestMeta)
 void setClientId(String clientId)
          Deprecated.  
 void setExceptionHandler(RiakExceptionHandler exceptionHandler)
          Deprecated. Install an exception handler.
 HttpResponse store(RiakObject object, RequestMeta meta)
          Deprecated. Same as RiakClient, except only returning the HTTP response
 boolean stream(String bucket, String key, StreamHandler handler, RequestMeta meta)
          Deprecated. Same as RiakClient, except only returning the HTTP response
 HttpResponse toss(RiakIORuntimeException e)
          Deprecated. Hands exception e to installed exception handler if there is one or throw it.
 HttpResponse toss(RiakResponseRuntimeException e)
          Deprecated.  
 HttpResponse walk(String bucket, String key, String walkSpec, RequestMeta meta)
          Deprecated. 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

ClientHelper

public ClientHelper(RiakConfig config,
                    String clientId)
Deprecated. 
Method Detail

getClientId

public byte[] getClientId()
Deprecated. 
See RiakClient.getClientId()


setClientId

public void setClientId(String clientId)
Deprecated. 

setBucketSchema

public HttpResponse setBucketSchema(String bucket,
                                    JSONObject schema,
                                    RequestMeta meta)
Deprecated. 
See RiakClient#setBucketSchema(String, com.basho.riak.client.http.RiakBucketInfo, RequestMeta)


getBucketSchema

public HttpResponse getBucketSchema(String bucket,
                                    RequestMeta meta)
Deprecated. 
Same as RiakClient.getBucketSchema(String, RequestMeta), except only returning the HTTP response.


listBuckets

public HttpResponse listBuckets()
Deprecated. 
List the buckets in Riak

Returns:
an HttpResponse whose body should be the result of asking Riak to list buckets.

listBucket

public HttpResponse listBucket(String bucket,
                               RequestMeta meta,
                               boolean streamResponse)
Deprecated. 
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()


store

public HttpResponse store(RiakObject object,
                          RequestMeta meta)
Deprecated. 
Same as RiakClient, except only returning the HTTP response


fetchMeta

public HttpResponse fetchMeta(String bucket,
                              String key,
                              RequestMeta meta)
Deprecated. 
Same as RiakClient, except only returning the HTTP response


fetch

public HttpResponse fetch(String bucket,
                          String key,
                          RequestMeta meta,
                          boolean streamResponse)
Deprecated. 
Same as RiakClient, except only returning the HTTP response and allows the response to be streamed.

Parameters:
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.
Returns:
Same as RiakClient

fetch

public HttpResponse fetch(String bucket,
                          String key,
                          RequestMeta meta)
Deprecated. 

stream

public boolean stream(String bucket,
                      String key,
                      StreamHandler handler,
                      RequestMeta meta)
               throws IOException
Deprecated. 
Same as RiakClient, except only returning the HTTP response

Throws:
IOException

delete

public HttpResponse delete(String bucket,
                           String key,
                           RequestMeta meta)
Deprecated. 
Same as RiakClient, except only returning the HTTP response


walk

public HttpResponse walk(String bucket,
                         String key,
                         String walkSpec,
                         RequestMeta meta)
Deprecated. 
Same as RiakClient, except only returning the HTTP response


mapReduce

public HttpResponse mapReduce(String job,
                              RequestMeta meta)
Deprecated. 
Same as RiakClient, except only returning the HTTP response


getExceptionHandler

public RiakExceptionHandler getExceptionHandler()
Deprecated. 
Returns:
the installed exception handler or null if not installed

setExceptionHandler

public void setExceptionHandler(RiakExceptionHandler exceptionHandler)
Deprecated. 
Install an exception handler. If an exception handler is provided, then the Riak client will hand exceptions to the handler rather than throwing them.


toss

public HttpResponse toss(RiakIORuntimeException e)
Deprecated. 
Hands exception e to installed exception handler if there is one or throw it.

Returns:
A 0-status HttpResponse.

toss

public HttpResponse toss(RiakResponseRuntimeException e)
Deprecated. 

getHttpClient

public org.apache.http.client.HttpClient getHttpClient()
Deprecated. 
Return the HttpClient used to make requests, which can be configured.


getConfig

public RiakConfig getConfig()
Deprecated. 
Returns:
The config used to construct the HttpClient connecting to Riak.


Copyright © 2012. All Rights Reserved.