Class ZooAuthenticationKeyDistributor
- java.lang.Object
-
- org.apache.accumulo.server.security.delegation.ZooAuthenticationKeyDistributor
-
public class ZooAuthenticationKeyDistributor extends Object
Class that manages distribution ofAuthenticationKey
s, 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 void
advertise(AuthenticationKey newKey)
Add the givenAuthenticationKey
to ZooKeeper.List<AuthenticationKey>
getCurrentKeys()
Fetch allAuthenticationKey
s currently stored in ZooKeeper beneath the configuredbaseNode
.void
initialize()
Ensures that ZooKeeper is in a correct state to perform distribution ofAuthenticationKey
s.void
remove(AuthenticationKey key)
Remove the givenAuthenticationKey
from ZooKeeper.
-
-
-
Constructor Detail
-
ZooAuthenticationKeyDistributor
public ZooAuthenticationKeyDistributor(ZooReaderWriter zk, String baseNode)
-
-
Method Detail
-
initialize
public void initialize() throws org.apache.zookeeper.KeeperException, InterruptedException
Ensures that ZooKeeper is in a correct state to perform distribution ofAuthenticationKey
s.- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
getCurrentKeys
public List<AuthenticationKey> getCurrentKeys() throws org.apache.zookeeper.KeeperException, InterruptedException
Fetch allAuthenticationKey
s currently stored in ZooKeeper beneath the configuredbaseNode
.- Returns:
- A list of
AuthenticationKey
s - Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
advertise
public void advertise(AuthenticationKey newKey) throws org.apache.zookeeper.KeeperException, InterruptedException
Add the givenAuthenticationKey
to ZooKeeper.- Parameters:
newKey
- The key to add to ZooKeeper- Throws:
org.apache.zookeeper.KeeperException
InterruptedException
-
remove
public void remove(AuthenticationKey key) throws org.apache.zookeeper.KeeperException, InterruptedException
Remove the givenAuthenticationKey
from ZooKeeper. If the node for the providedkey
doesn'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.KeeperException
InterruptedException
-
-