@Test(dataProvider = "getInputData") public void testRegister(String testSiteId, String uri, Class expectedException) throws Exception { try { InetSocketAddress gondolaAddress = new InetSocketAddress(1234); String hostId = registryClient.register(testSiteId, gondolaAddress, URI.create(uri)); RegistryClient.Entry entry = objectMapper.readValue(client.getData().forPath(ZookeeperRegistryClient.GONDOLA_HOSTS + "/" + hostId), RegistryClient.Entry.class); assertNotNull(entry); assertEquals(hostId, entry.hostId); assertEquals(testSiteId, config.getSiteIdForHost(entry.hostId)); assertEquals(gondolaAddress, entry.gondolaAddress); } catch (IOException e) { assertTrue(e.getClass().equals(expectedException)); } }
@Override public String register(String siteId, InetSocketAddress gondolaAddress, URI serviceUri) throws IOException { try { return registerHostIdOnZookeeper(siteId, gondolaAddress); } catch (Exception e) { throw new IOException(e); } }
ZookeeperRegistryClient implements RegistryClient { @Override public String register(String siteId, InetSocketAddress gondolaAddress, URI serviceUri) throws IOException { try { return registerHostIdOnZookeeper(siteId, gondolaAddress); } catch (Exception e) { throw new IOException(e); } } }
ZookeeperRegistryClient implements RegistryClient { @Override public String register(String siteId, InetSocketAddress gondolaAddress, URI serviceUri) throws IOException { try { return registerHostIdOnZookeeper(siteId, gondolaAddress); } catch (Exception e) { throw new IOException(e); } } protected  ZookeeperRegistryClient(CuratorFramework curatorFramework, ObjectMapper objectMapper, Config config); }
ZookeeperRegistryClient implements RegistryClient { @Override public String register(String siteId, InetSocketAddress gondolaAddress, URI serviceUri) throws IOException { try { return registerHostIdOnZookeeper(siteId, gondolaAddress); } catch (Exception e) { throw new IOException(e); } } protected  ZookeeperRegistryClient(CuratorFramework curatorFramework, ObjectMapper objectMapper, Config config); @Override String register(String siteId, InetSocketAddress gondolaAddress, URI serviceUri); @Override void addListener(Consumer<Entry> listener); @Override Map<String, Entry> getEntries(); @Override boolean waitForClusterComplete(int timeoutMs); }
ZookeeperRegistryClient implements RegistryClient { @Override public String register(String siteId, InetSocketAddress gondolaAddress, URI serviceUri) throws IOException { try { return registerHostIdOnZookeeper(siteId, gondolaAddress); } catch (Exception e) { throw new IOException(e); } } protected  ZookeeperRegistryClient(CuratorFramework curatorFramework, ObjectMapper objectMapper, Config config); @Override String register(String siteId, InetSocketAddress gondolaAddress, URI serviceUri); @Override void addListener(Consumer<Entry> listener); @Override Map<String, Entry> getEntries(); @Override boolean waitForClusterComplete(int timeoutMs); static final String GONDOLA_HOSTS; }