directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yan...@apache.org
Subject [1/2] directory-kerby git commit: add JavaDoc for zookeeper-backend
Date Mon, 24 Aug 2015 06:02:38 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 4f822df73 -> b1815d633


add JavaDoc for zookeeper-backend


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/4122f3f6
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/4122f3f6
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/4122f3f6

Branch: refs/heads/master
Commit: 4122f3f6d07873e2b7a71a57dec1af475c015c25
Parents: 1ac2d0a
Author: yaningxu <yaning0123@gmail.com>
Authored: Mon Aug 24 14:01:42 2015 +0800
Committer: yaningxu <yaning0123@gmail.com>
Committed: Mon Aug 24 14:01:42 2015 +0800

----------------------------------------------------------------------
 .../identitybackend/IdentityZNodeHelper.java    | 33 ++++++++++++++++++++
 .../kerberos/kdc/identitybackend/ZKUtil.java    | 31 ++++++++++++++++--
 .../ZookeeperIdentityBackend.java               |  2 +-
 3 files changed, 63 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/4122f3f6/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNodeHelper.java
----------------------------------------------------------------------
diff --git a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNodeHelper.java
b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNodeHelper.java
index ac59ae9..565e781 100644
--- a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNodeHelper.java
+++ b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/IdentityZNodeHelper.java
@@ -42,6 +42,7 @@ public class IdentityZNodeHelper {
 
     /**
      * Get base znode.
+     * @return Base
      */
     public static String getBaseZNode() {
       return baseZNode;
@@ -49,6 +50,7 @@ public class IdentityZNodeHelper {
 
     /**
      * Get identities znode.
+     * @return Identities.
      */
     public static String getIdentitiesZNode() {
       return ZKUtil.joinZNode(getBaseZNode(), IDENTITIES_ZNODE_NAME);
@@ -56,6 +58,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get identity znode.
+     * @param principalName Principal name
+     * @return Identity
      */
     public static String getIndentityZNode(String principalName) {
         return ZKUtil.joinZNode(getIdentitiesZNode(), principalName);
@@ -63,6 +67,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get principal name znode.
+     * @param principalName Principal name.
+     * @return Principal name
      */
     public static String getPrincipalNameZnode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), PRINCIPAL_NAME_ZNODE_NAME);
@@ -70,6 +76,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get key version znode.
+     * @param principalName Principal name.
+     * @return Key version
      */
     public static String getKeyVersionZNode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), KEY_VERSION_ZNODE_NAME);
@@ -77,6 +85,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get kdc flags znode.
+     * @param principalName Principal name.
+     * @return Kdc flags
      */
     public static String getKdcFlagsZNode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), KDC_FLAGS_ZNODE_NAME);
@@ -84,6 +94,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get disabled znode.
+     * @param principalName Principal name.
+     * @return Whether this principal's account is disabled.
      */
     public static String getDisabledZNode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), DISABLED_ZNODE_NAME);
@@ -91,6 +103,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get locked znode.
+     * @param principalName Principal name.
+     * @return Whether principal's account is locked
      */
     public static String getLockedZNode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), LOCKED_ZNODE_NAME);
@@ -98,6 +112,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get expire time znode.
+     * @param principalName Principal name.
+     * @return Expired time.
      */
     public static String getExpireTimeZNode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), EXPIRE_TIME_ZNODE_NAME);
@@ -105,6 +121,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get created time znode.
+     * @param principalName Principal name.
+     * @return Created time.
      */
     public static String getCreatedTimeZNode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), CREATED_TIME_ZNODE_NAME);
@@ -112,6 +130,8 @@ public class IdentityZNodeHelper {
 
     /**
      * Get keys znode.
+     * @param principalName Principal name.
+     * @return Key
      */
     public static String getKeysZNode(String principalName) {
         return ZKUtil.joinZNode(getIndentityZNode(principalName), KEYS_ZNODE_NAME);
@@ -119,6 +139,9 @@ public class IdentityZNodeHelper {
 
     /**
      * Get key type znode.
+     * @param principalName Principal name.
+     * @param type Key type.
+     * @return Key type.
      */
     public static String getKeyTypeZNode(String principalName, String type) {
         return ZKUtil.joinZNode(getKeysZNode(principalName), type);
@@ -126,6 +149,9 @@ public class IdentityZNodeHelper {
 
     /**
      * Get encryption key type znode.
+     * @param principalName Principal name.
+     * @param type Encryption type.
+     * @return Encryption key type
      */
     public static String getEncryptionKeyTypeZNode(String principalName, String type) {
         return ZKUtil.joinZNode(getKeyTypeZNode(principalName, type), KEY_TYPE_ZNODE_NAME);
@@ -133,6 +159,9 @@ public class IdentityZNodeHelper {
 
     /**
      * Get encryption key znode.
+     * @param principalName Principal Name.
+     * @param type Encryption type.
+     * @return Encryption key
      */
     public static String getEncryptionKeyZNode(String principalName, String type) {
         return ZKUtil.joinZNode(getKeyTypeZNode(principalName, type), KEY_ZNODE_NAME);
@@ -140,6 +169,9 @@ public class IdentityZNodeHelper {
 
     /**
      * Get encryption key kvno znode.
+     * @param principalName Principal name.
+     * @param type Key type.
+     * @return Encryption key
      */
     public static String getEncryptionKeyNoZNode(String principalName, String type) {
         return ZKUtil.joinZNode(getKeyTypeZNode(principalName, type), ENCRYPTION_KEY_NO_ZNODE_NAME);
@@ -148,6 +180,7 @@ public class IdentityZNodeHelper {
     /**
      * Get identity names.
      *
+     * @throws org.apache.zookeeper.KeeperException
      * @param zk The zookeeper
      * @return The list of principal names.
      */

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/4122f3f6/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZKUtil.java
----------------------------------------------------------------------
diff --git a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZKUtil.java
b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZKUtil.java
index 5a46920..128c59f 100644
--- a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZKUtil.java
+++ b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZKUtil.java
@@ -44,6 +44,10 @@ public class ZKUtil {
 
     /**
      * Check if the specified node exists. Sets no watches.
+     * @throws org.apache.zookeeper.KeeperException
+     * @param zk Zookeeper.
+     * @param node Node.
+     * @return The version.
      */
     public static int checkExists(ZooKeeper zk, String node)
         throws KeeperException {
@@ -60,6 +64,11 @@ public class ZKUtil {
 
     /**
      * Sets the data of the existing znode to be the specified data.
+     * @throws org.apache.zookeeper.KeeperException
+     * @param zk Zookeeper
+     * @param node Node
+     * @param data Data
+     * @return Whether the data is set or not.
      */
     public static boolean setData(ZooKeeper zk, String node, byte[] data)
         throws KeeperException {
@@ -74,6 +83,9 @@ public class ZKUtil {
     /**
      * Set data into node creating node if it doesn't yet exist.
      * Does not set watch.
+     * @param zk Zookeeper.
+     * @param node Node.
+     * @param data Data.
      */
     public static void createSetData(final ZooKeeper zk, final String node,
                                      final byte[] data)
@@ -87,6 +99,7 @@ public class ZKUtil {
 
     /**
      * Creates the specified node and all parent nodes required for it to exist.
+     * @throws org.apache.zookeeper.KeeperException
      */
     public static void createWithParents(ZooKeeper zk, String node)
         throws KeeperException {
@@ -97,6 +110,10 @@ public class ZKUtil {
      * Creates the specified node and all parent nodes required for it to exist.  The creation
of
      * parent znodes is not atomic with the leafe znode creation but the data is written
atomically
      * when the leaf node is created.
+     * @throws org.apache.zookeeper.KeeperException
+     * @param zk zookeeper.
+     * @param node node
+     * @param data data
      */
     public static void createWithParents(ZooKeeper zk, String node, byte[] data)
         throws KeeperException {
@@ -118,6 +135,9 @@ public class ZKUtil {
 
     /**
      * Returns the ACL list
+     * @param zk zookeeper
+     * @param node node
+     * @return The acl created.
      */
     private static ArrayList<ACL> createACL(ZooKeeper zk, String node) { //NOPMD
         return ZooDefs.Ids.OPEN_ACL_UNSAFE; //TODO
@@ -126,6 +146,7 @@ public class ZKUtil {
     /**
      * Returns the full path of the immediate parent of the specified node.
      * null if passed the root node or an invalid node
+     * @return index
      */
     public static String getParent(String node) {
         int idx = node.lastIndexOf(ZNODE_PATH_SEPARATOR);
@@ -134,6 +155,9 @@ public class ZKUtil {
 
     /**
      * Get znode data. Does not set a watcher.
+     * @throws org.apache.zookeeper.KeeperException
+     * @throws java.lang.InterruptedException
+     * @return Data of the node
      */
     public static byte[] getData(ZooKeeper zk, String node)
         throws KeeperException, InterruptedException {
@@ -152,6 +176,8 @@ public class ZKUtil {
     /**
      * Lists the children of the specified node without setting any watches.
      * null if parent does not exist
+     * @throws org.apache.zookeeper.KeeperException
+     * @return children
      */
     public static List<String> listChildrenNoWatch(ZooKeeper zk, String node)
             throws KeeperException {
@@ -169,11 +195,12 @@ public class ZKUtil {
 
     /**
      * Delete the specified node and all of it's children.
-     * <p/>
      * If the node does not exist, just returns.
-     * <p/>
      * Sets no watches. Throws all exceptions besides dealing with deletion of
      * children.
+     * @throws KeeperException
+     * @param zk The zookeeper.
+     * @param node The node to be deleted.
      */
     public static void deleteNodeRecursively(ZooKeeper zk, String node) throws KeeperException
{
         List<String> children = ZKUtil.listChildrenNoWatch(zk, node);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/4122f3f6/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZookeeperIdentityBackend.java
----------------------------------------------------------------------
diff --git a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZookeeperIdentityBackend.java
b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZookeeperIdentityBackend.java
index a85476f..3c91498 100644
--- a/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZookeeperIdentityBackend.java
+++ b/kerby-backend/zookeeper-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/ZookeeperIdentityBackend.java
@@ -62,7 +62,7 @@ public class ZookeeperIdentityBackend extends AbstractIdentityBackend {
     /**
      * Constructing an instance using specified config that contains anything
      * to be used to init the Zookeeper backend.
-     * @param config
+     * @param config The configuration for zookeeper identity backend.
      */
     public ZookeeperIdentityBackend(Config config) {
          setConfig(config);


Mime
View raw message