directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject directory-kerby git commit: Change some java doc.
Date Mon, 04 Jul 2016 08:26:35 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/kadmin-remote 5044f4f6a -> 31b17a4cd


Change some java doc.


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

Branch: refs/heads/kadmin-remote
Commit: 31b17a4cdf0d163cbe7de19d0f539c35d7f72104
Parents: 5044f4f
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Mon Jul 4 16:31:51 2016 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Mon Jul 4 16:31:51 2016 +0800

----------------------------------------------------------------------
 .../kerb/admin/server/kadmin/AdminServer.java   |  30 +--
 .../admin/server/kadmin/AdminServerConfig.java  |   2 +-
 .../admin/server/kadmin/AdminServerHandler.java |   6 +-
 .../admin/server/kadmin/AdminServerImpl.java    | 263 -------------------
 .../admin/server/kadmin/AdminServerUtil.java    |   2 +-
 .../admin/kadmin/local/LocalKadminImpl.java     |   1 -
 .../kerb/admin/kadmin/remote/AdminClient.java   |   2 +-
 7 files changed, 21 insertions(+), 285 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31b17a4c/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServer.java
b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServer.java
index d48f1be..659750a 100644
--- a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServer.java
+++ b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServer.java
@@ -30,7 +30,7 @@ import org.apache.kerby.kerberos.kerb.server.KdcConfig;
 import java.io.File;
 
 /**
- * The implemented Kerberos admin admin API.
+ * The implemented Kerberos remote admin server API.
  * We add the KdcConfig as a member variable to AdminServer,
  * In order to make it easy to use LocalKadminImpl.
  * The Kdc Config of corresponding KDC can be read from ConfDir.
@@ -119,26 +119,26 @@ public class AdminServer {
 
     /**
      * Set Admin host.
-     * @param kdcHost The kdc host
+     * @param adminHost The kdc host
      */
-    public void setAdminHost(String kdcHost) {
-        startupOptions.add(AdminServerOption.ADMIN_HOST, kdcHost);
+    public void setAdminHost(String adminHost) {
+        startupOptions.add(AdminServerOption.ADMIN_HOST, adminHost);
     }
 
     /**
      * Set Admin port.
-     * @param kdcPort The kdc port
+     * @param adminPort The admin port
      */
-    public void setAdminServerPort(int kdcPort) {
-        startupOptions.add(AdminServerOption.ADMIN_PORT, kdcPort);
+    public void setAdminServerPort(int adminPort) {
+        startupOptions.add(AdminServerOption.ADMIN_PORT, adminPort);
     }
 
     /**
      * Set Admin tcp port.
-     * @param kdcTcpPort The kdc tcp port
+     * @param adminTcpPort The admin tcp port
      */
-    public void setAdminTcpPort(int kdcTcpPort) {
-        startupOptions.add(AdminServerOption.ADMIN_TCP_PORT, kdcTcpPort);
+    public void setAdminTcpPort(int adminTcpPort) {
+        startupOptions.add(AdminServerOption.ADMIN_TCP_PORT, adminTcpPort);
     }
 
     /**
@@ -158,10 +158,10 @@ public class AdminServer {
     }
     /**
      * Set Admin udp port. Only makes sense when allowUdp is set.
-     * @param kdcUdpPort The kdc udp port
+     * @param adminUdpPort The admin udp port
      */
-    public void setAdminUdpPort(int kdcUdpPort) {
-        startupOptions.add(AdminServerOption.ADMIN_UDP_PORT, kdcUdpPort);
+    public void setAdminUdpPort(int adminUdpPort) {
+        startupOptions.add(AdminServerOption.ADMIN_UDP_PORT, adminUdpPort);
     }
 
     /**
@@ -180,9 +180,9 @@ public class AdminServer {
     }
 
     /**
-     * Allow to hook customized kdc implementation.
+     * Allow to hook customized admin implementation.
      *
-     * @param innerAdminServerImpl The inner kdc implementation
+     * @param innerAdminServerImpl The inner admin implementation
      */
     public void setInnerAdminServerImpl(InternalAdminServer innerAdminServerImpl) {
         startupOptions.add(AdminServerOption.INNER_ADMIN_IMPL, innerAdminServerImpl);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31b17a4c/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerConfig.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerConfig.java
b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerConfig.java
index aceeb4a..97e0904 100644
--- a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerConfig.java
+++ b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerConfig.java
@@ -22,7 +22,7 @@ package org.apache.kerby.kerberos.kerb.admin.server.kadmin;
 import org.apache.kerby.kerberos.kerb.common.Krb5Conf;
 
 /**
- * Kerb KDC side configuration API.
+ * Kerb admin server side configuration API.
  */
 public class AdminServerConfig extends Krb5Conf {
     private static final String KDCDEFAULT = "kdcdefaults";

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31b17a4c/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerHandler.java
b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerHandler.java
index 6c0265e..5b85d96 100644
--- a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerHandler.java
+++ b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerHandler.java
@@ -42,16 +42,16 @@ import java.nio.ByteBuffer;
 import java.util.List;
 
 /**
- * KDC handler to process client requests. Currently only one realm is supported.
+ * admin server handler to process client acmin requests.
  */
 public class AdminServerHandler {
     private static final Logger LOG = LoggerFactory.getLogger(AdminServerHandler.class);
     private final AdminServerContext adminServerContext;
 
     /**
-     * Constructor with kdc context.
+     * Constructor with admin server context.
      *
-     * @param adminServerContext admin admin context
+     * @param adminServerContext admin admin server context
      */
     public AdminServerHandler(AdminServerContext adminServerContext) {
         this.adminServerContext = adminServerContext;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31b17a4c/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerImpl.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerImpl.java
b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerImpl.java
deleted file mode 100644
index d873323..0000000
--- a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerImpl.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/**
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *
- */
-package org.apache.kerby.kerberos.kerb.admin.server.kadmin;
-
-import org.apache.kerby.KOptions;
-import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.admin.server.kadmin.impl.DefaultInternalAdminServerImpl;
-import org.apache.kerby.kerberos.kerb.admin.server.kadmin.impl.InternalAdminServer;
-import org.apache.kerby.kerberos.kerb.identity.backend.BackendConfig;
-import org.apache.kerby.kerberos.kerb.identity.backend.IdentityBackend;
-import org.apache.kerby.kerberos.kerb.server.KdcConfig;
-import org.apache.kerby.kerberos.kerb.server.KdcServerOption;
-import org.apache.kerby.kerberos.kerb.server.KdcUtil;
-
-import java.io.File;
-
-/**
- * The implemented Kerberos Server API.
- */
-public class AdminServerImpl {
-    private final AdminServerConfig adminServerConfig;
-    private final KdcConfig kdcConfig;
-    private final BackendConfig backendConfig;
-    private final AdminServerSetting adminServerSetting;
-    private final KOptions startupOptions;
-
-    private InternalAdminServer innerKdc;
-
-    /**
-     * Constructor passing both adminServerConfig and backendConfig.
-     * @param adminServerConfig The adminServer config
-     * @param kdcConfig The kdc config
-     * @param backendConfig The backend config
-     * @throws KrbException e
-     */
-    public AdminServerImpl(AdminServerConfig adminServerConfig,
-                           KdcConfig kdcConfig,
-                           BackendConfig backendConfig) throws KrbException {
-        this.adminServerConfig = adminServerConfig;
-        this.kdcConfig = kdcConfig;
-        this.backendConfig = backendConfig;
-        startupOptions = new KOptions();
-        adminServerSetting = new AdminServerSetting(startupOptions, adminServerConfig,
-            kdcConfig, backendConfig);
-    }
-
-    /**
-     * Constructor given confDir where 'kdc.conf' and 'backend.conf' should be
-     * available.
-     * kdc.conf, that contains kdc admin related items.
-     * backend.conf, that contains identity backend related items.
-     *
-     * @param confDir The conf dir
-     * @throws KrbException e
-     */
-    public AdminServerImpl(File confDir) throws KrbException {
-        AdminServerConfig tmpAdminServerConfig = AdminServerUtil.getAdminServerConfig(confDir);
-        if (tmpAdminServerConfig == null) {
-            tmpAdminServerConfig = new AdminServerConfig();
-        }
-        this.adminServerConfig = tmpAdminServerConfig;
-
-        KdcConfig tmpKdcConfig = AdminServerUtil.getKdcConfig(confDir);
-        if (tmpKdcConfig == null) {
-            tmpKdcConfig = new KdcConfig();
-        }
-        this.kdcConfig = tmpKdcConfig;
-
-        BackendConfig tmpBackendConfig = KdcUtil.getBackendConfig(confDir);
-        if (tmpBackendConfig == null) {
-            tmpBackendConfig = new BackendConfig();
-        }
-        tmpBackendConfig.setConfDir(confDir);
-        this.backendConfig = tmpBackendConfig;
-
-        startupOptions = new KOptions();
-        adminServerSetting = new AdminServerSetting(startupOptions, adminServerConfig,
-            kdcConfig, backendConfig);
-    }
-
-    /**
-     * Default constructor.
-     */
-    public AdminServerImpl() {
-        adminServerConfig = new AdminServerConfig();
-        kdcConfig = new KdcConfig();
-        backendConfig = new BackendConfig();
-        startupOptions = new KOptions();
-        adminServerSetting = new AdminServerSetting(startupOptions, adminServerConfig,
-            kdcConfig, backendConfig);
-    }
-
-    /**
-     * Set KDC realm for ticket request
-     * @param realm The kdc realm
-     */
-    public void setKdcRealm(String realm) {
-        startupOptions.add(KdcServerOption.KDC_REALM, realm);
-    }
-
-    /**
-     * Set KDC host.
-     * @param kdcHost The kdc host
-     */
-    public void setKdcHost(String kdcHost) {
-        startupOptions.add(KdcServerOption.KDC_HOST, kdcHost);
-    }
-
-    /**
-     * Set KDC port.
-     * @param kdcPort The kdc port
-     */
-    public void setKdcPort(int kdcPort) {
-        startupOptions.add(KdcServerOption.KDC_PORT, kdcPort);
-    }
-
-    /**
-     * Set KDC tcp port.
-     * @param kdcTcpPort The kdc tcp port
-     */
-    public void setKdcTcpPort(int kdcTcpPort) {
-        startupOptions.add(KdcServerOption.KDC_TCP_PORT, kdcTcpPort);
-    }
-
-    /**
-     * Set to allow UDP or not.
-     * @param allowUdp true if allow udp
-     */
-    public void setAllowUdp(boolean allowUdp) {
-        startupOptions.add(KdcServerOption.ALLOW_UDP, allowUdp);
-    }
-
-    /**
-     * Set to allow TCP or not.
-     * @param allowTcp true if allow tcp
-     */
-    public void setAllowTcp(boolean allowTcp) {
-        startupOptions.add(KdcServerOption.ALLOW_TCP, allowTcp);
-    }
-    /**
-     * Set KDC udp port. Only makes sense when allowUdp is set.
-     * @param kdcUdpPort The kdc udp port
-     */
-    public void setKdcUdpPort(int kdcUdpPort) {
-        startupOptions.add(KdcServerOption.KDC_UDP_PORT, kdcUdpPort);
-    }
-
-    /**
-     * Set runtime folder.
-     * @param workDir The work dir
-     */
-    public void setWorkDir(File workDir) {
-        startupOptions.add(KdcServerOption.WORK_DIR, workDir);
-    }
-
-    /**
-     * Allow to debug so have more logs.
-     */
-    public void enableDebug() {
-        startupOptions.add(KdcServerOption.ENABLE_DEBUG);
-    }
-
-    /**
-     * Allow to hook customized kdc implementation.
-     *
-     * @param innerKdcImpl The inner kdc implementation
-     */
-    public void setInnerKdcImpl(InternalAdminServer innerKdcImpl) {
-        startupOptions.add(KdcServerOption.INNER_KDC_IMPL, innerKdcImpl);
-    }
-
-    /**
-     * Get KDC setting from startup options and configs.
-     * @return setting
-     */
-    public AdminServerSetting getAdminServerSetting() {
-        return adminServerSetting;
-    }
-
-    /**
-     * Get the KDC config.
-     * @return AdminServerConfig
-     */
-    public AdminServerConfig getAdminServerConfig() {
-        return adminServerConfig;
-    }
-
-    /**
-     * Get backend config.
-     *
-     * @return backend configuration
-     */
-    public BackendConfig getBackendConfig() {
-        return backendConfig;
-    }
-
-    /**
-     * Get identity service.
-     * @return IdentityService
-     */
-    public IdentityBackend getIdentityService() {
-        if (innerKdc == null) {
-            throw new RuntimeException("Not init yet");
-        }
-        return innerKdc.getIdentityBackend();
-    }
-
-    /**
-     * Initialize.
-     *
-     * @throws KrbException e.
-     */
-    public void init() throws KrbException {
-        if (startupOptions.contains(KdcServerOption.INNER_KDC_IMPL)) {
-            innerKdc = (InternalAdminServer) startupOptions.getOptionValue(
-                    KdcServerOption.INNER_KDC_IMPL);
-        } else {
-            innerKdc = new DefaultInternalAdminServerImpl(adminServerSetting);
-        }
-
-        innerKdc.init();
-    }
-
-    /**
-     * Start the KDC admin.
-     *
-     * @throws KrbException e.
-     */
-    public void start() throws KrbException {
-        if (innerKdc == null) {
-            throw new RuntimeException("Not init yet");
-        }
-        innerKdc.start();
-    }
-
-    /**
-     * Stop the KDC admin.
-     *
-     * @throws KrbException e.
-     */
-    public void stop() throws KrbException {
-        if (innerKdc != null) {
-            innerKdc.stop();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31b17a4c/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerUtil.java
b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerUtil.java
index bd70cc9..f48bf5b 100644
--- a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerUtil.java
+++ b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/kadmin/AdminServerUtil.java
@@ -31,7 +31,7 @@ import java.io.IOException;
 import java.net.InetSocketAddress;
 
 /**
- * KDC side utilities.
+ * Admin Server utilities.
  */
 public final class AdminServerUtil {
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31b17a4c/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/LocalKadminImpl.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/LocalKadminImpl.java
b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/LocalKadminImpl.java
index 70c60ff..80fc10b 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/LocalKadminImpl.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/local/LocalKadminImpl.java
@@ -112,7 +112,6 @@ public class LocalKadminImpl implements LocalKadmin {
         return KrbUtil.makeTgsPrincipal(serverSetting.getKdcRealm()).getName();
     }
 
-    // TODO: 2016/3/14 check whether it is possible to return getAdminServerRealm
     @Override
     public String getKadminPrincipal() {
         return KrbUtil.makeKadminPrincipal(serverSetting.getKdcRealm()).getName();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/31b17a4c/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminClient.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminClient.java
b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminClient.java
index ee21648..01c336d 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminClient.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminClient.java
@@ -29,7 +29,7 @@ import java.io.File;
 import java.util.List;
 
 /**
- * A Krb client API for applications to interact with KDC
+ * A Admin client API for applications to interact with Admin Server
  */
 public class AdminClient {
 


Mime
View raw message