Class ZooAuthenticationKeyDistributor
java.lang.Object
org.apache.accumulo.server.security.delegation.ZooAuthenticationKeyDistributor
Class that manages distribution of
AuthenticationKey
s, Accumulo's secret in the
delegation token model, to other Accumulo nodes via ZooKeeper.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
advertise
(AuthenticationKey newKey) Add the givenAuthenticationKey
to ZooKeeper.Fetch allAuthenticationKey
s currently stored in ZooKeeper beneath the configuredbaseNode
.void
Ensures that ZooKeeper is in a correct state to perform distribution ofAuthenticationKey
s.void
remove
(AuthenticationKey key) Remove the givenAuthenticationKey
from ZooKeeper.
-
Constructor Details
-
ZooAuthenticationKeyDistributor
-
-
Method Details
-
initialize
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, InterruptedExceptionFetch 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
-