com.basho.riak.client
Class RiakConfig

java.lang.Object
  extended by com.basho.riak.client.RiakConfig

public class RiakConfig
extends java.lang.Object

Configuration settings for connecting to a Riak instance such as the base Riak URL and HttpClient settings. A pre-constructed HttpClient can also be provided.


Field Summary
static java.util.regex.Pattern BASE_URL_PATTERN
           
 
Constructor Summary
RiakConfig()
           
RiakConfig(java.lang.String url)
           
RiakConfig(java.lang.String ip, java.lang.String port, java.lang.String prefix)
           
RiakConfig(java.net.URL url)
           
 
Method Summary
 java.lang.String getBaseUrl()
          The host and port of the Riak server, which is extracted from the specified Riak URL.
 org.apache.commons.httpclient.HttpClient getHttpClient()
          The pre-constructed HttpClient for a client to use if one was provided
 java.lang.String getMapReducePath()
          The path to the Riak map reduce resource, which defaults to /mapred
 java.lang.String getMapReduceUrl()
          The full URL of Riak map reduce resource, which is calculated by combining the host and port from the Riak URL and the map reduce path.
 java.lang.Integer getMaxConnections()
           
 org.apache.commons.httpclient.HttpMethodRetryHandler getRetryHandler()
          Value to set for the HttpClientParams.RETRY_HANDLER property: the default retry handler for requests.
 java.lang.Integer getTimeout()
           
 java.lang.String getUrl()
          The base URL used by a client to construct object URLs
 void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
          Provide a pre-constructed HttpClient for clients to use to connect to Riak
 void setMapReducePath(java.lang.String path)
           
 void setMaxConnections(java.lang.Integer maxConnections)
          Value to set for the HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS property: overall maximum number of connections used by the HttpClient.
 void setRetryHandler(org.apache.commons.httpclient.HttpMethodRetryHandler retryHandler)
           
 void setTimeout(java.lang.Integer timeout)
          Value to set for the properties: HttpClientParams.CONNECTION_MANAGER_TIMEOUT, HttpMethodParams.SO_TIMEOUT, HttpConnectionParams.CONNECTION_TIMEOUT which sets the timeout milliseconds for retrieving an HTTP connection and data over the connection.
 void setUrl(java.lang.String url)
          Set the base URL that clients should use to construct object URLs (e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_URL_PATTERN

public static java.util.regex.Pattern BASE_URL_PATTERN
Constructor Detail

RiakConfig

public RiakConfig()

RiakConfig

public RiakConfig(java.lang.String url)

RiakConfig

public RiakConfig(java.net.URL url)

RiakConfig

public RiakConfig(java.lang.String ip,
                  java.lang.String port,
                  java.lang.String prefix)
Method Detail

getUrl

public java.lang.String getUrl()
The base URL used by a client to construct object URLs


setUrl

public void setUrl(java.lang.String url)
Set the base URL that clients should use to construct object URLs (e.g. http://localhost:8098/riak).


getMapReduceUrl

public java.lang.String getMapReduceUrl()
The full URL of Riak map reduce resource, which is calculated by combining the host and port from the Riak URL and the map reduce path.


getBaseUrl

public java.lang.String getBaseUrl()
The host and port of the Riak server, which is extracted from the specified Riak URL.


getMapReducePath

public java.lang.String getMapReducePath()
The path to the Riak map reduce resource, which defaults to /mapred


setMapReducePath

public void setMapReducePath(java.lang.String path)

getHttpClient

public org.apache.commons.httpclient.HttpClient getHttpClient()
The pre-constructed HttpClient for a client to use if one was provided


setHttpClient

public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
Provide a pre-constructed HttpClient for clients to use to connect to Riak


setTimeout

public void setTimeout(java.lang.Integer timeout)
Value to set for the properties: HttpClientParams.CONNECTION_MANAGER_TIMEOUT, HttpMethodParams.SO_TIMEOUT, HttpConnectionParams.CONNECTION_TIMEOUT which sets the timeout milliseconds for retrieving an HTTP connection and data over the connection. Null for default.


getTimeout

public java.lang.Integer getTimeout()

setMaxConnections

public void setMaxConnections(java.lang.Integer maxConnections)
Value to set for the HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS property: overall maximum number of connections used by the HttpClient.


getMaxConnections

public java.lang.Integer getMaxConnections()

getRetryHandler

public org.apache.commons.httpclient.HttpMethodRetryHandler getRetryHandler()
Value to set for the HttpClientParams.RETRY_HANDLER property: the default retry handler for requests.

See Also:
DefaultHttpMethodRetryHandler

setRetryHandler

public void setRetryHandler(org.apache.commons.httpclient.HttpMethodRetryHandler retryHandler)


Copyright © 2010. All Rights Reserved.