com.netflix.curator.framework
Class CuratorFrameworkFactory.Builder

java.lang.Object
  extended by com.netflix.curator.framework.CuratorFrameworkFactory.Builder
Enclosing class:
CuratorFrameworkFactory

public static class CuratorFrameworkFactory.Builder
extends Object


Method Summary
 CuratorFrameworkFactory.Builder authorization(String scheme, byte[] auth)
          Add connection authorization
 CuratorFramework build()
          Apply the current values and build a new CuratorFramework
 CuratorFrameworkFactory.Builder connectionTimeoutMs(int connectionTimeoutMs)
           
 CuratorFrameworkFactory.Builder connectString(String connectString)
           
 CuratorFrameworkFactory.Builder defaultData(byte[] defaultData)
          Sets the data to use when PathAndBytesable.forPath(String) is used.
 String getAuthScheme()
           
 byte[] getAuthValue()
           
 int getConnectionTimeoutMs()
           
 String getConnectString()
           
 byte[] getDefaultData()
           
 String getNamespace()
           
 RetryPolicy getRetryPolicy()
           
 int getSessionTimeoutMs()
           
 ThreadFactory getThreadFactory()
           
 CuratorFrameworkFactory.Builder namespace(String namespace)
          As ZooKeeper is a shared space, users of a given cluster should stay within a pre-defined namespace.
 CuratorFrameworkFactory.Builder retryPolicy(RetryPolicy retryPolicy)
           
 CuratorFrameworkFactory.Builder sessionTimeoutMs(int sessionTimeoutMs)
           
 CuratorFrameworkFactory.Builder threadFactory(ThreadFactory threadFactory)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

build

public CuratorFramework build()
                       throws IOException
Apply the current values and build a new CuratorFramework

Returns:
new CuratorFramework
Throws:
IOException - errors

authorization

public CuratorFrameworkFactory.Builder authorization(String scheme,
                                                     byte[] auth)
Add connection authorization

Parameters:
scheme - the scheme
auth - the auth bytes
Returns:
this

connectString

public CuratorFrameworkFactory.Builder connectString(String connectString)
Parameters:
connectString - list of servers to connect to
Returns:
this

defaultData

public CuratorFrameworkFactory.Builder defaultData(byte[] defaultData)
Sets the data to use when PathAndBytesable.forPath(String) is used. This is useful for debugging purposes. For example, you could set this to be the IP of the client.

Parameters:
defaultData - new default data to use
Returns:
this

namespace

public CuratorFrameworkFactory.Builder namespace(String namespace)
As ZooKeeper is a shared space, users of a given cluster should stay within a pre-defined namespace. If a namespace is set here, all paths will get pre-pended with the namespace

Parameters:
namespace - the namespace
Returns:
this

sessionTimeoutMs

public CuratorFrameworkFactory.Builder sessionTimeoutMs(int sessionTimeoutMs)
Parameters:
sessionTimeoutMs - session timeout
Returns:
this

connectionTimeoutMs

public CuratorFrameworkFactory.Builder connectionTimeoutMs(int connectionTimeoutMs)
Parameters:
connectionTimeoutMs - connection timeout
Returns:
this

retryPolicy

public CuratorFrameworkFactory.Builder retryPolicy(RetryPolicy retryPolicy)
Parameters:
retryPolicy - retry policy to use
Returns:
this

threadFactory

public CuratorFrameworkFactory.Builder threadFactory(ThreadFactory threadFactory)
Parameters:
threadFactory - thread factory used to create Executor Services
Returns:
this

getThreadFactory

public ThreadFactory getThreadFactory()

getConnectString

public String getConnectString()

getSessionTimeoutMs

public int getSessionTimeoutMs()

getConnectionTimeoutMs

public int getConnectionTimeoutMs()

getRetryPolicy

public RetryPolicy getRetryPolicy()

getNamespace

public String getNamespace()

getAuthScheme

public String getAuthScheme()

getAuthValue

public byte[] getAuthValue()

getDefaultData

public byte[] getDefaultData()


Copyright © 2012. All Rights Reserved.