@Test(expected = IllegalStateException.class) public void testInitializedNotCalledRemove() throws Exception { ZooAuthenticationKeyDistributor distributor = new ZooAuthenticationKeyDistributor(zrw, baseNode); distributor.remove(new AuthenticationKey(1, 0L, 5L, keyGen.generateKey())); }
public synchronized void remove(AuthenticationKey key) throws KeeperException, InterruptedException { checkState(initialized.get(), "Not initialized"); requireNonNull(key); String path = qualifyPath(key); if (!zk.exists(path)) { log.warn("AuthenticationKey with ID '{}' doesn't exist in ZooKeeper", key.getKeyId()); return; } log.debug("Removing AuthenticationKey with keyId {} from ZooKeeper at {}", key.getKeyId(), path); zk.delete(path, -1); }
ZooAuthenticationKeyDistributor { public synchronized void remove(AuthenticationKey key) throws KeeperException, InterruptedException { checkState(initialized.get(), "Not initialized"); requireNonNull(key); String path = qualifyPath(key); if (!zk.exists(path)) { log.warn("AuthenticationKey with ID '{}' doesn't exist in ZooKeeper", key.getKeyId()); return; } log.debug("Removing AuthenticationKey with keyId {} from ZooKeeper at {}", key.getKeyId(), path); zk.delete(path, -1); } }
ZooAuthenticationKeyDistributor { public synchronized void remove(AuthenticationKey key) throws KeeperException, InterruptedException { checkState(initialized.get(), "Not initialized"); requireNonNull(key); String path = qualifyPath(key); if (!zk.exists(path)) { log.warn("AuthenticationKey with ID '{}' doesn't exist in ZooKeeper", key.getKeyId()); return; } log.debug("Removing AuthenticationKey with keyId {} from ZooKeeper at {}", key.getKeyId(), path); zk.delete(path, -1); } ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode); }
ZooAuthenticationKeyDistributor { public synchronized void remove(AuthenticationKey key) throws KeeperException, InterruptedException { checkState(initialized.get(), "Not initialized"); requireNonNull(key); String path = qualifyPath(key); if (!zk.exists(path)) { log.warn("AuthenticationKey with ID '{}' doesn't exist in ZooKeeper", key.getKeyId()); return; } log.debug("Removing AuthenticationKey with keyId {} from ZooKeeper at {}", key.getKeyId(), path); zk.delete(path, -1); } ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode); synchronized void initialize(); List<AuthenticationKey> getCurrentKeys(); synchronized void advertise(AuthenticationKey newKey); synchronized void remove(AuthenticationKey key); }
ZooAuthenticationKeyDistributor { public synchronized void remove(AuthenticationKey key) throws KeeperException, InterruptedException { checkState(initialized.get(), "Not initialized"); requireNonNull(key); String path = qualifyPath(key); if (!zk.exists(path)) { log.warn("AuthenticationKey with ID '{}' doesn't exist in ZooKeeper", key.getKeyId()); return; } log.debug("Removing AuthenticationKey with keyId {} from ZooKeeper at {}", key.getKeyId(), path); zk.delete(path, -1); } ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode); synchronized void initialize(); List<AuthenticationKey> getCurrentKeys(); synchronized void advertise(AuthenticationKey newKey); synchronized void remove(AuthenticationKey key);  }