Class ZooAuthenticationKeyDistributor
- java.lang.Object
-
- org.apache.accumulo.server.security.delegation.ZooAuthenticationKeyDistributor
-
public class ZooAuthenticationKeyDistributor extends Object
Class that manages distribution ofAuthenticationKeys, Accumulo's secret in the delegation token model, to other Accumulo nodes via ZooKeeper.
-
-
Constructor Summary
Constructors Constructor Description ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvertise(AuthenticationKey newKey)Add the givenAuthenticationKeyto ZooKeeper.List<AuthenticationKey>getCurrentKeys()Fetch allAuthenticationKeys currently stored in ZooKeeper beneath the configuredbaseNode.voidinitialize()Ensures that ZooKeeper is in a correct state to perform distribution ofAuthenticationKeys.voidremove(AuthenticationKey key)Remove the givenAuthenticationKeyfrom ZooKeeper.
-
-
-
Constructor Detail
-
ZooAuthenticationKeyDistributor
public ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode)
-
-
Method Detail
-
initialize
public void initialize() throws org.apache.zookeeper.KeeperException, InterruptedExceptionEnsures that ZooKeeper is in a correct state to perform distribution ofAuthenticationKeys.- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
getCurrentKeys
public List<AuthenticationKey> getCurrentKeys() throws org.apache.zookeeper.KeeperException, InterruptedException
Fetch allAuthenticationKeys currently stored in ZooKeeper beneath the configuredbaseNode.- Returns:
- A list of
AuthenticationKeys - Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
advertise
public void advertise(AuthenticationKey newKey) throws org.apache.zookeeper.KeeperException, InterruptedException
Add the givenAuthenticationKeyto ZooKeeper.- Parameters:
newKey- The key to add to ZooKeeper- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
remove
public void remove(AuthenticationKey key) throws org.apache.zookeeper.KeeperException, InterruptedException
Remove the givenAuthenticationKeyfrom ZooKeeper. If the node for the providedkeydoesn't exist in ZooKeeper, a warning is printed but an error is not thrown. Since there is only a single process managing ZooKeeper at one time, any inconsistencies should be client error.- Parameters:
key- The key to remove from ZooKeeper- Throws:
org.apache.zookeeper.KeeperExceptionInterruptedException
-
-