if(password == null)
password = "";
// For membase connectivity: http://docs.couchbase.org/membase-sdk-java-api-reference/membase-sdk-java-started.html
// And: http://code.google.com/p/spymemcached/wiki/Examples#Establishing_a_Membase_Connection
final CouchbaseConnectionFactoryBuilder factory = newCouchbaseConnectionFactoryBuilder();
factory.setOpTimeout(operationTimeout);
factory.setMaxReconnectDelay(maxReconnectDelay);
factory.setFailureMode(FailureMode.Redistribute);
return new CouchbaseClient(factory.buildCouchbaseConnection(memcachedNodesManager.getCouchbaseBucketURIs(), username, password));
} catch (final Exception e) {
throw new RuntimeException("Could not create memcached client", e);
}
}