@Test public void testGetNamespace() throws Exception { CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1)); CuratorFramework client2 = CuratorFrameworkFactory.builder().namespace("snafu").retryPolicy(new RetryOneTime(1)).connectString("foo").build(); try { client.start(); CuratorFramework fooClient = client.usingNamespace("foo"); CuratorFramework barClient = client.usingNamespace("bar"); Assert.assertEquals(client.getNamespace(), ""); Assert.assertEquals(client2.getNamespace(), "snafu"); Assert.assertEquals(fooClient.getNamespace(), "foo"); Assert.assertEquals(barClient.getNamespace(), "bar"); } finally { CloseableUtils.closeQuietly(client2); CloseableUtils.closeQuietly(client); } }
@Override public String getNamespace() { return namespace.getNamespace(); }
NamespaceFacade extends CuratorFrameworkImpl { @Override public String getNamespace() { return namespace.getNamespace(); } }
NamespaceFacade extends CuratorFrameworkImpl { @Override public String getNamespace() { return namespace.getNamespace(); } NamespaceFacade(CuratorFrameworkImpl client, String namespace); }
NamespaceFacade extends CuratorFrameworkImpl { @Override public String getNamespace() { return namespace.getNamespace(); } NamespaceFacade(CuratorFrameworkImpl client, String namespace); @Override CuratorFramework nonNamespaceView(); @Override CuratorFramework usingNamespace(String newNamespace); @Override String getNamespace(); @Override void start(); @Override void close(); @Override Listenable<ConnectionStateListener> getConnectionStateListenable(); @Override Listenable<CuratorListener> getCuratorListenable(); @Override Listenable<UnhandledErrorListener> getUnhandledErrorListenable(); @Override void sync(String path, Object context); @Override CuratorZookeeperClient getZookeeperClient(); @Override EnsurePath newNamespaceAwareEnsurePath(String path); }
NamespaceFacade extends CuratorFrameworkImpl { @Override public String getNamespace() { return namespace.getNamespace(); } NamespaceFacade(CuratorFrameworkImpl client, String namespace); @Override CuratorFramework nonNamespaceView(); @Override CuratorFramework usingNamespace(String newNamespace); @Override String getNamespace(); @Override void start(); @Override void close(); @Override Listenable<ConnectionStateListener> getConnectionStateListenable(); @Override Listenable<CuratorListener> getCuratorListenable(); @Override Listenable<UnhandledErrorListener> getUnhandledErrorListenable(); @Override void sync(String path, Object context); @Override CuratorZookeeperClient getZookeeperClient(); @Override EnsurePath newNamespaceAwareEnsurePath(String path);  }