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: Rename the package.
Date Fri, 01 Jul 2016 02:30:31 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/kadmin-remote ebc221de2 -> 5044f4f6a


Rename the package.


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

Branch: refs/heads/kadmin-remote
Commit: 5044f4f6a7ed023be61915e67fcedb9c08f69969
Parents: ebc221d
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri Jul 1 10:35:59 2016 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri Jul 1 10:35:59 2016 +0800

----------------------------------------------------------------------
 .../kerb/admin/server/KerbyAdminServer.java     |  4 +-
 .../admin/server/kadmin/AdminServerHandler.java | 16 ++--
 .../kerb/admin/RemoteAdminClientTool.java       |  4 +-
 .../kerb/admin/kadmin/remote/AdminHandler.java  |  8 +-
 .../remote/request/AddPrincipalRequest.java     |  6 +-
 .../kadmin/remote/request/AdminRequest.java     |  2 +-
 .../remote/request/DeletePrincipalRequest.java  |  6 +-
 .../kadmin/remote/request/GetprincsRequest.java |  6 +-
 .../remote/request/RenamePrincipalRequest.java  |  6 +-
 .../kerb/admin/message/AddPrincipalRep.java     | 30 +++++++
 .../kerb/admin/message/AddPrincipalReq.java     | 30 +++++++
 .../kerb/admin/message/AdminMessage.java        | 56 ++++++++++++
 .../kerb/admin/message/AdminMessageCode.java    | 90 ++++++++++++++++++++
 .../kerb/admin/message/AdminMessageEnum.java    | 41 +++++++++
 .../kerb/admin/message/AdminMessageType.java    | 73 ++++++++++++++++
 .../kerberos/kerb/admin/message/AdminRep.java   | 33 +++++++
 .../kerberos/kerb/admin/message/AdminReq.java   | 34 ++++++++
 .../kerb/admin/message/DeletePrincipalRep.java  | 30 +++++++
 .../kerb/admin/message/DeletePrincipalReq.java  | 30 +++++++
 .../kerb/admin/message/GetprincsRep.java        | 26 ++++++
 .../kerb/admin/message/GetprincsReq.java        | 26 ++++++
 .../kerberos/kerb/admin/message/KadminCode.java | 63 ++++++++++++++
 .../kerb/admin/message/RenamePrincipalRep.java  | 29 +++++++
 .../kerb/admin/message/RenamePrincipalReq.java  | 29 +++++++
 .../kerb/admin/tool/AddPrincipalRep.java        | 30 -------
 .../kerb/admin/tool/AddPrincipalReq.java        | 30 -------
 .../kerberos/kerb/admin/tool/AdminMessage.java  | 56 ------------
 .../kerb/admin/tool/AdminMessageCode.java       | 90 --------------------
 .../kerb/admin/tool/AdminMessageEnum.java       | 41 ---------
 .../kerb/admin/tool/AdminMessageType.java       | 73 ----------------
 .../kerberos/kerb/admin/tool/AdminRep.java      | 33 -------
 .../kerberos/kerb/admin/tool/AdminReq.java      | 34 --------
 .../kerb/admin/tool/DeletePrincipalRep.java     | 30 -------
 .../kerb/admin/tool/DeletePrincipalReq.java     | 30 -------
 .../kerberos/kerb/admin/tool/GetprincsRep.java  | 26 ------
 .../kerberos/kerb/admin/tool/GetprincsReq.java  | 26 ------
 .../kerberos/kerb/admin/tool/KadminCode.java    | 63 --------------
 .../kerb/admin/tool/RenamePrincipalRep.java     | 29 -------
 .../kerb/admin/tool/RenamePrincipalReq.java     | 29 -------
 39 files changed, 649 insertions(+), 649 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/KerbyAdminServer.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/KerbyAdminServer.java b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/KerbyAdminServer.java
index f77ea89..50e59e3 100644
--- a/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/KerbyAdminServer.java
+++ b/kerby-kerb/kerb-admin-server/src/main/java/org/apache/kerby/kerberos/kerb/admin/server/KerbyAdminServer.java
@@ -33,12 +33,12 @@ import java.io.IOException;
 
 public class KerbyAdminServer {
     private static final String USAGE = (OSUtil.isWindows()
-        ? "Usage: bin\\adminServer.cmd" : "Usage: sh bin/adminServer.sh")
+        ? "Usage: bin\\admin-server.cmd" : "Usage: sh bin/admin-server.sh")
         + " <conf-file>\n"
         + "\tExample:\n"
         + "\t\t"
         + (OSUtil.isWindows()
-        ? "bin\\adminServer.cmd" : "sh bin/adminServer.sh")
+        ? "bin\\admin-server.cmd" : "sh bin/admin-server.sh")
         + " conf\n";
 
     public static void main(String[] args) throws Exception {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/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 e0e6393..6c0265e 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
@@ -22,14 +22,14 @@ package org.apache.kerby.kerberos.kerb.admin.server.kadmin;
 import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.admin.kadmin.local.LocalKadmin;
 import org.apache.kerby.kerberos.kerb.admin.kadmin.local.LocalKadminImpl;
-import org.apache.kerby.kerberos.kerb.admin.tool.AddPrincipalRep;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessage;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageCode;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageType;
-import org.apache.kerby.kerberos.kerb.admin.tool.DeletePrincipalRep;
-import org.apache.kerby.kerberos.kerb.admin.tool.GetprincsRep;
-import org.apache.kerby.kerberos.kerb.admin.tool.KadminCode;
-import org.apache.kerby.kerberos.kerb.admin.tool.RenamePrincipalRep;
+import org.apache.kerby.kerberos.kerb.admin.message.AddPrincipalRep;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessage;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageCode;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageType;
+import org.apache.kerby.kerberos.kerb.admin.message.DeletePrincipalRep;
+import org.apache.kerby.kerberos.kerb.admin.message.GetprincsRep;
+import org.apache.kerby.kerberos.kerb.admin.message.KadminCode;
+import org.apache.kerby.kerberos.kerb.admin.message.RenamePrincipalRep;
 import org.apache.kerby.xdr.XdrDataType;
 import org.apache.kerby.xdr.XdrFieldInfo;
 import org.apache.kerby.xdr.type.XdrStructType;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/RemoteAdminClientTool.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/RemoteAdminClientTool.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/RemoteAdminClientTool.java
index f8a09eb..27a8da2 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/RemoteAdminClientTool.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/RemoteAdminClientTool.java
@@ -58,12 +58,12 @@ public class RemoteAdminClientTool {
     private static KrbTransport transport;
     private static final String PROMPT = RemoteAdminClientTool.class.getSimpleName() + ".local:";
     private static final String USAGE = (OSUtil.isWindows()
-        ? "Usage: bin\\remoteAdmin.cmd" : "Usage: sh bin/remoteAdmin.sh")
+        ? "Usage: bin\\remote-admin-client.cmd" : "Usage: sh bin/remote-admin-client.sh")
         + " <conf-file>\n"
         + "\tExample:\n"
         + "\t\t"
         + (OSUtil.isWindows()
-        ? "bin\\remoteAdmin.cmd" : "sh bin/remoteAdmin.sh")
+        ? "bin\\remote-admin-client.cmd" : "sh bin/remote-admin-client.sh")
         + " conf\n";
 
     private static final String LEGAL_COMMANDS = "Available commands are: "

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminHandler.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminHandler.java
index 0db757c..9debfdd 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminHandler.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/AdminHandler.java
@@ -21,10 +21,10 @@ package org.apache.kerby.kerberos.kerb.admin.kadmin.remote;
 
 import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.admin.kadmin.remote.request.AdminRequest;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageCode;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageType;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminReq;
-import org.apache.kerby.kerberos.kerb.admin.tool.KadminCode;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageCode;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageType;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminReq;
+import org.apache.kerby.kerberos.kerb.admin.message.KadminCode;
 import org.apache.kerby.xdr.XdrFieldInfo;
 import org.apache.kerby.xdr.type.XdrStructType;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AddPrincipalRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AddPrincipalRequest.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AddPrincipalRequest.java
index 4977d9e..96622bc 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AddPrincipalRequest.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AddPrincipalRequest.java
@@ -21,9 +21,9 @@ package org.apache.kerby.kerberos.kerb.admin.kadmin.remote.request;
 
 import org.apache.kerby.KOptions;
 import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.admin.tool.AddPrincipalReq;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageCode;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageType;
+import org.apache.kerby.kerberos.kerb.admin.message.AddPrincipalReq;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageCode;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageType;
 import org.apache.kerby.xdr.XdrDataType;
 import org.apache.kerby.xdr.XdrFieldInfo;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AdminRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AdminRequest.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AdminRequest.java
index b42a07e..7c8d152 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AdminRequest.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/AdminRequest.java
@@ -21,7 +21,7 @@ package org.apache.kerby.kerberos.kerb.admin.kadmin.remote.request;
 
 import org.apache.kerby.kerberos.kerb.KrbException;
 import org.apache.kerby.kerberos.kerb.transport.KrbTransport;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminReq;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminReq;
 
 public class AdminRequest {
     private String principal;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/DeletePrincipalRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/DeletePrincipalRequest.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/DeletePrincipalRequest.java
index a07229d..929f324 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/DeletePrincipalRequest.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/DeletePrincipalRequest.java
@@ -20,9 +20,9 @@
 package org.apache.kerby.kerberos.kerb.admin.kadmin.remote.request;
 
 import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageCode;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageType;
-import org.apache.kerby.kerberos.kerb.admin.tool.DeletePrincipalReq;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageCode;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageType;
+import org.apache.kerby.kerberos.kerb.admin.message.DeletePrincipalReq;
 import org.apache.kerby.xdr.XdrDataType;
 import org.apache.kerby.xdr.XdrFieldInfo;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/GetprincsRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/GetprincsRequest.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/GetprincsRequest.java
index 2154170..2794010 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/GetprincsRequest.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/GetprincsRequest.java
@@ -20,9 +20,9 @@
 package org.apache.kerby.kerberos.kerb.admin.kadmin.remote.request;
 
 import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageCode;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageType;
-import org.apache.kerby.kerberos.kerb.admin.tool.GetprincsReq;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageCode;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageType;
+import org.apache.kerby.kerberos.kerb.admin.message.GetprincsReq;
 import org.apache.kerby.xdr.XdrDataType;
 import org.apache.kerby.xdr.XdrFieldInfo;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/RenamePrincipalRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/RenamePrincipalRequest.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/RenamePrincipalRequest.java
index b7b9eec..a7cfcc2 100644
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/RenamePrincipalRequest.java
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/kadmin/remote/request/RenamePrincipalRequest.java
@@ -20,9 +20,9 @@
 package org.apache.kerby.kerberos.kerb.admin.kadmin.remote.request;
 
 import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageCode;
-import org.apache.kerby.kerberos.kerb.admin.tool.AdminMessageType;
-import org.apache.kerby.kerberos.kerb.admin.tool.RenamePrincipalReq;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageCode;
+import org.apache.kerby.kerberos.kerb.admin.message.AdminMessageType;
+import org.apache.kerby.kerberos.kerb.admin.message.RenamePrincipalReq;
 import org.apache.kerby.xdr.XdrDataType;
 import org.apache.kerby.xdr.XdrFieldInfo;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalRep.java
new file mode 100644
index 0000000..3c52ab0
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalRep.java
@@ -0,0 +1,30 @@
+/**
+ *  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.message;
+
+
+/**
+ * Add principal reply, to general admin message
+ */
+public class AddPrincipalRep extends AdminRep {
+    public AddPrincipalRep() {
+        super(AdminMessageType.ADD_PRINCIPAL_REP);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalReq.java
new file mode 100644
index 0000000..0450a0e
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AddPrincipalReq.java
@@ -0,0 +1,30 @@
+/**
+ *  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.message;
+
+
+/**
+ * Add principal request, to general admin message
+ */
+public class AddPrincipalReq extends AdminReq {
+    public AddPrincipalReq() {
+      super(AdminMessageType.ADD_PRINCIPAL_REQ);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessage.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessage.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessage.java
new file mode 100644
index 0000000..ec21f91
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessage.java
@@ -0,0 +1,56 @@
+/**
+ *  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.message;
+
+import java.nio.ByteBuffer;
+
+/**
+ * Deal with messages sent and received between Kadmin and Kadmin Server.
+ *       (MSB)                   (LSB)
+ *      +-------+-------+-------+-------+
+ *      |msg_type |para_num |prin_name |...(koptions, password) |
+ *      +-------+-------+-------+-------+
+ */
+public class AdminMessage {
+    private AdminMessageType adminMessageType;
+    private ByteBuffer messageBuffer;
+
+    public AdminMessage(AdminMessageType adminMessageType) {
+        this.adminMessageType = adminMessageType;
+    }
+
+    public AdminMessageType getAdminMessageType() {
+        return adminMessageType;
+    }
+
+    public void setMessageBuffer(ByteBuffer messageBuffer) {
+        this.messageBuffer = messageBuffer;
+    }
+
+    public ByteBuffer getMessageBuffer() {
+        return messageBuffer;
+    }
+
+    public int encodingLength() {
+        return messageBuffer.limit(); // no + 4 is the length of whole message
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageCode.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageCode.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageCode.java
new file mode 100644
index 0000000..016d577
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageCode.java
@@ -0,0 +1,90 @@
+/**
+ *  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.message;
+
+import org.apache.kerby.KOptions;
+import org.apache.kerby.xdr.XdrDataType;
+import org.apache.kerby.xdr.XdrFieldInfo;
+import org.apache.kerby.xdr.type.AbstractXdrType;
+import org.apache.kerby.xdr.type.XdrInteger;
+import org.apache.kerby.xdr.type.XdrString;
+import org.apache.kerby.xdr.type.XdrStructType;
+import org.apache.kerby.xdr.type.XdrType;
+
+/**
+ * An extend XdrStructType to encode and decode AdminMessage.
+ */
+public class AdminMessageCode extends XdrStructType {
+    public AdminMessageCode() {
+        super(XdrDataType.STRUCT);
+    }
+
+    public AdminMessageCode(XdrFieldInfo[] fieldInfos) {
+        super(XdrDataType.STRUCT, fieldInfos);
+    }
+
+    protected  void getStructTypeInstance(final XdrType[] fields, final XdrFieldInfo[] fieldInfos) {
+        for (int i = 0; i < fieldInfos.length; i++) {
+            switch (fieldInfos[i].getDataType()) {
+                case INTEGER:
+                    fields[i] = new XdrInteger((Integer) fieldInfos[i].getValue());
+                    break;
+                case ENUM:
+                    fields[i] = new AdminMessageEnum((AdminMessageType) fieldInfos[i].getValue());
+                    break;
+                case STRING:
+                    fields[i] = new XdrString((String) fieldInfos[i].getValue());
+                    break;
+                default:
+                    fields[i] = null;
+            }
+
+        }
+    }
+
+    @Override
+    protected XdrStructType fieldsToValues(AbstractXdrType[] fields) {
+        int paramNum = (int) fields[1].getValue();
+        XdrFieldInfo[] xdrFieldInfos = new XdrFieldInfo[paramNum + 2];
+        xdrFieldInfos[0] = new XdrFieldInfo(0, XdrDataType.ENUM, fields[0].getValue());
+        xdrFieldInfos[1] = new XdrFieldInfo(1, XdrDataType.INTEGER, fields[1].getValue());
+        xdrFieldInfos[2] = new XdrFieldInfo(2, XdrDataType.STRING, fields[2].getValue());
+        if (paramNum == 2 && fields[3].getValue() instanceof KOptions) {
+            xdrFieldInfos[3] = new XdrFieldInfo(3, XdrDataType.STRUCT, fields[3].getValue()); /////koption
+        } else if (paramNum == 2 && fields[3].getValue() instanceof String) {
+            xdrFieldInfos[3] = new XdrFieldInfo(3, XdrDataType.STRING, fields[3].getValue());
+        } else if (paramNum == 3) {
+            xdrFieldInfos[3] = new XdrFieldInfo(3, XdrDataType.STRUCT, fields[3].getValue()); ////koption
+            xdrFieldInfos[4] = new XdrFieldInfo(4, XdrDataType.STRING, fields[4].getValue());
+        }
+        return new AdminMessageCode(xdrFieldInfos);
+    }
+
+    @Override
+    protected AbstractXdrType[] getAllFields() {
+        AbstractXdrType[] fields = new AbstractXdrType[5];
+        fields[0] = new AdminMessageEnum();
+        fields[1] = new XdrInteger();
+        fields[2] = new XdrString();
+        fields[3] = new XdrString(); //suppose it is string
+        fields[4] = null; // kOptions is not supported.
+        return fields;
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageEnum.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageEnum.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageEnum.java
new file mode 100644
index 0000000..2ea60b8
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageEnum.java
@@ -0,0 +1,41 @@
+/**
+ *  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.message;
+
+import org.apache.kerby.xdr.EnumType;
+import org.apache.kerby.xdr.type.XdrEnumerated;
+
+/**
+ * An extend XdrEnumerate to encode and decode AdminMessageType.
+ */
+public class AdminMessageEnum extends XdrEnumerated<AdminMessageType> {
+    public AdminMessageEnum() {
+        super(null);
+    }
+
+    public AdminMessageEnum(AdminMessageType value) {
+        super(value);
+    }
+    @Override
+    protected EnumType[] getAllEnumValues() {
+        return AdminMessageType.values();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageType.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageType.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageType.java
new file mode 100644
index 0000000..f44187e
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminMessageType.java
@@ -0,0 +1,73 @@
+/**
+ *  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.message;
+
+import org.apache.kerby.xdr.EnumType;
+
+/**
+ * Type of Admin Message:
+ * NONE(-1)
+ * ADD_PRINCIPAL_REQ(0) add principal request
+ * ADD_PRINCIPAL_REP(1) add principal reply
+ * DELETE_PRINCIPAL_REQ(2),
+ * DELETE_PRINCIPAL_REP(3);
+ * RENAME_PRINCIPAL_REQ(4),
+ * RENAME_PRINCIPAL_REP(5);
+ *
+ */
+
+public enum AdminMessageType implements EnumType {
+    NONE(-1),
+    ADD_PRINCIPAL_REQ(0),
+    ADD_PRINCIPAL_REP(1),
+    DELETE_PRINCIPAL_REQ(2),
+    DELETE_PRINCIPAL_REP(3),
+    RENAME_PRINCIPAL_REQ(4),
+    RENAME_PRINCIPAL_REP(5),
+    GET_PRINCS_REQ(6),
+    GET_PRINCS_REP(7);
+
+    private int value;
+
+    AdminMessageType(int value) {
+        this.value = value;
+    }
+
+    @Override
+    public int getValue() {
+        return value;
+    }
+
+    @Override
+    public String getName() {
+        return name();
+    }
+
+    public static AdminMessageType findType(int value) {
+        if (value >= 0) {
+            for (EnumType e : values()) {
+                if (e.getValue() == value) {
+                    return (AdminMessageType) e;
+                }
+            }
+        }
+        return NONE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminRep.java
new file mode 100644
index 0000000..a26cd6b
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminRep.java
@@ -0,0 +1,33 @@
+/**
+ *  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.message;
+
+
+/**
+ * Use to construct Admin message.
+ * Probably two kinds of reply.
+ * add principal -- AdRep
+ * change password? -- chRep
+ */
+public class AdminRep extends AdminMessage {
+    public AdminRep(AdminMessageType messageType) {
+      super(messageType);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminReq.java
new file mode 100644
index 0000000..c69218f
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/AdminReq.java
@@ -0,0 +1,34 @@
+/**
+ *  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.message;
+
+
+/**
+ * Use to construct Admin message.
+ * Probably two kinds of request.
+ * add principal -- AdReq
+ * change password? -- chReq
+ */
+public class AdminReq extends AdminMessage {
+  public AdminReq(AdminMessageType messageType) {
+    super(messageType);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalRep.java
new file mode 100644
index 0000000..35b1f6e
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalRep.java
@@ -0,0 +1,30 @@
+/**
+ *  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.message;
+
+
+/**
+ * Delete principal reply, to general admin message
+ */
+public class DeletePrincipalRep extends AdminRep {
+    public DeletePrincipalRep() {
+        super(AdminMessageType.DELETE_PRINCIPAL_REP);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalReq.java
new file mode 100644
index 0000000..ad3b320
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/DeletePrincipalReq.java
@@ -0,0 +1,30 @@
+/**
+ *  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.message;
+
+
+/**
+ * Delete principal request, to general admin message
+ */
+public class DeletePrincipalReq extends AdminReq {
+    public DeletePrincipalReq() {
+        super(AdminMessageType.DELETE_PRINCIPAL_REQ);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsRep.java
new file mode 100644
index 0000000..2a6364a
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsRep.java
@@ -0,0 +1,26 @@
+/**
+ *  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.message;
+
+public class GetprincsRep extends AdminRep {
+    public GetprincsRep() {
+        super(AdminMessageType.GET_PRINCS_REP);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsReq.java
new file mode 100644
index 0000000..75e819b
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/GetprincsReq.java
@@ -0,0 +1,26 @@
+/**
+ *  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.message;
+
+public class GetprincsReq extends AdminReq {
+    public GetprincsReq() {
+        super(AdminMessageType.GET_PRINCS_REQ);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/KadminCode.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/KadminCode.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/KadminCode.java
new file mode 100644
index 0000000..c5d6359
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/KadminCode.java
@@ -0,0 +1,63 @@
+/**
+ *  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.message;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+/**
+ * Used to decode messages between admin and admin server.
+ */
+public class KadminCode {
+    public static ByteBuffer encodeMessage(AdminMessage adminMessage) {
+        int length = adminMessage.encodingLength();
+        // 4 is the head to go through network
+        ByteBuffer buffer = ByteBuffer.allocate(length + 4);
+        buffer.putInt(length); // head in network
+        //buffer.putInt(adminMessage.getAdminMessageType().getValue());
+        // type has been encoded in the admin message
+        buffer.put(adminMessage.getMessageBuffer());
+        buffer.flip();
+        return buffer;
+    }
+
+    public static AdminMessage decodeMessage(ByteBuffer buffer) throws IOException {
+        //go through network, the total length has been removed.
+        int type = buffer.getInt();
+        System.out.println("type: " + type);
+        AdminMessageType adminMessageType = AdminMessageType.findType(type);
+        AdminMessage adminMessage = null;
+        byte[] bytes = new byte[buffer.remaining()];
+        buffer.get(bytes);
+        if (adminMessageType == AdminMessageType.ADD_PRINCIPAL_REQ) {
+            adminMessage = new AddPrincipalReq();
+            System.out.println("check if decoding right: "
+                + new String(ByteBuffer.wrap(bytes).array()));
+        } else if (adminMessageType == AdminMessageType.ADD_PRINCIPAL_REP) {
+            adminMessage = new AddPrincipalRep();
+            System.out.println("check if decoding right2: "
+                + new String(ByteBuffer.wrap(bytes).array()));
+        } else {
+            throw new IOException("Unknown Admin Message Type: " + type);
+        }
+
+        return adminMessage;
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalRep.java
new file mode 100644
index 0000000..5406190
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalRep.java
@@ -0,0 +1,29 @@
+/**
+ *  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.message;
+
+/**
+ * Rename principal reply, to general admin message
+ */
+public class RenamePrincipalRep extends AdminRep {
+    public RenamePrincipalRep() {
+        super(AdminMessageType.RENAME_PRINCIPAL_REP);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalReq.java
new file mode 100644
index 0000000..4bc8c1b
--- /dev/null
+++ b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/message/RenamePrincipalReq.java
@@ -0,0 +1,29 @@
+/**
+ *  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.message;
+
+/**
+ * Rename principal request, to general admin message
+ */
+public class RenamePrincipalReq extends AdminReq {
+    public RenamePrincipalReq() {
+        super(AdminMessageType.RENAME_PRINCIPAL_REQ);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalRep.java
deleted file mode 100644
index 3025845..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalRep.java
+++ /dev/null
@@ -1,30 +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.tool;
-
-
-/**
- * Add principal reply, to general admin message
- */
-public class AddPrincipalRep extends AdminRep {
-    public AddPrincipalRep() {
-        super(AdminMessageType.ADD_PRINCIPAL_REP);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalReq.java
deleted file mode 100644
index 0b58157..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AddPrincipalReq.java
+++ /dev/null
@@ -1,30 +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.tool;
-
-
-/**
- * Add principal request, to general admin message
- */
-public class AddPrincipalReq extends AdminReq {
-    public AddPrincipalReq() {
-      super(AdminMessageType.ADD_PRINCIPAL_REQ);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessage.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessage.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessage.java
deleted file mode 100644
index d83631b..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessage.java
+++ /dev/null
@@ -1,56 +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.tool;
-
-import java.nio.ByteBuffer;
-
-/**
- * Deal with messages sent and received between Kadmin and Kadmin Server.
- *       (MSB)                   (LSB)
- *      +-------+-------+-------+-------+
- *      |msg_type |para_num |prin_name |...(koptions, password) |
- *      +-------+-------+-------+-------+
- */
-public class AdminMessage {
-    private AdminMessageType adminMessageType;
-    private ByteBuffer messageBuffer;
-
-    public AdminMessage(AdminMessageType adminMessageType) {
-        this.adminMessageType = adminMessageType;
-    }
-
-    public AdminMessageType getAdminMessageType() {
-        return adminMessageType;
-    }
-
-    public void setMessageBuffer(ByteBuffer messageBuffer) {
-        this.messageBuffer = messageBuffer;
-    }
-
-    public ByteBuffer getMessageBuffer() {
-        return messageBuffer;
-    }
-
-    public int encodingLength() {
-        return messageBuffer.limit(); // no + 4 is the length of whole message
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageCode.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageCode.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageCode.java
deleted file mode 100644
index bba926a..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageCode.java
+++ /dev/null
@@ -1,90 +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.tool;
-
-import org.apache.kerby.KOptions;
-import org.apache.kerby.xdr.XdrDataType;
-import org.apache.kerby.xdr.XdrFieldInfo;
-import org.apache.kerby.xdr.type.AbstractXdrType;
-import org.apache.kerby.xdr.type.XdrInteger;
-import org.apache.kerby.xdr.type.XdrString;
-import org.apache.kerby.xdr.type.XdrStructType;
-import org.apache.kerby.xdr.type.XdrType;
-
-/**
- * An extend XdrStructType to encode and decode AdminMessage.
- */
-public class AdminMessageCode extends XdrStructType {
-    public AdminMessageCode() {
-        super(XdrDataType.STRUCT);
-    }
-
-    public AdminMessageCode(XdrFieldInfo[] fieldInfos) {
-        super(XdrDataType.STRUCT, fieldInfos);
-    }
-
-    protected  void getStructTypeInstance(final XdrType[] fields, final XdrFieldInfo[] fieldInfos) {
-        for (int i = 0; i < fieldInfos.length; i++) {
-            switch (fieldInfos[i].getDataType()) {
-                case INTEGER:
-                    fields[i] = new XdrInteger((Integer) fieldInfos[i].getValue());
-                    break;
-                case ENUM:
-                    fields[i] = new AdminMessageEnum((AdminMessageType) fieldInfos[i].getValue());
-                    break;
-                case STRING:
-                    fields[i] = new XdrString((String) fieldInfos[i].getValue());
-                    break;
-                default:
-                    fields[i] = null;
-            }
-
-        }
-    }
-
-    @Override
-    protected XdrStructType fieldsToValues(AbstractXdrType[] fields) {
-        int paramNum = (int) fields[1].getValue();
-        XdrFieldInfo[] xdrFieldInfos = new XdrFieldInfo[paramNum + 2];
-        xdrFieldInfos[0] = new XdrFieldInfo(0, XdrDataType.ENUM, fields[0].getValue());
-        xdrFieldInfos[1] = new XdrFieldInfo(1, XdrDataType.INTEGER, fields[1].getValue());
-        xdrFieldInfos[2] = new XdrFieldInfo(2, XdrDataType.STRING, fields[2].getValue());
-        if (paramNum == 2 && fields[3].getValue() instanceof KOptions) {
-            xdrFieldInfos[3] = new XdrFieldInfo(3, XdrDataType.STRUCT, fields[3].getValue()); /////koption
-        } else if (paramNum == 2 && fields[3].getValue() instanceof String) {
-            xdrFieldInfos[3] = new XdrFieldInfo(3, XdrDataType.STRING, fields[3].getValue());
-        } else if (paramNum == 3) {
-            xdrFieldInfos[3] = new XdrFieldInfo(3, XdrDataType.STRUCT, fields[3].getValue()); ////koption
-            xdrFieldInfos[4] = new XdrFieldInfo(4, XdrDataType.STRING, fields[4].getValue());
-        }
-        return new AdminMessageCode(xdrFieldInfos);
-    }
-
-    @Override
-    protected AbstractXdrType[] getAllFields() {
-        AbstractXdrType[] fields = new AbstractXdrType[5];
-        fields[0] = new AdminMessageEnum();
-        fields[1] = new XdrInteger();
-        fields[2] = new XdrString();
-        fields[3] = new XdrString(); //suppose it is string
-        fields[4] = null; // kOptions is not supported.
-        return fields;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageEnum.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageEnum.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageEnum.java
deleted file mode 100644
index af9ebb9..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageEnum.java
+++ /dev/null
@@ -1,41 +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.tool;
-
-import org.apache.kerby.xdr.EnumType;
-import org.apache.kerby.xdr.type.XdrEnumerated;
-
-/**
- * An extend XdrEnumerate to encode and decode AdminMessageType.
- */
-public class AdminMessageEnum extends XdrEnumerated<AdminMessageType> {
-    public AdminMessageEnum() {
-        super(null);
-    }
-
-    public AdminMessageEnum(AdminMessageType value) {
-        super(value);
-    }
-    @Override
-    protected EnumType[] getAllEnumValues() {
-        return AdminMessageType.values();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageType.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageType.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageType.java
deleted file mode 100644
index 66f4f1a..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminMessageType.java
+++ /dev/null
@@ -1,73 +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.tool;
-
-import org.apache.kerby.xdr.EnumType;
-
-/**
- * Type of Admin Message:
- * NONE(-1)
- * ADD_PRINCIPAL_REQ(0) add principal request
- * ADD_PRINCIPAL_REP(1) add principal reply
- * DELETE_PRINCIPAL_REQ(2),
- * DELETE_PRINCIPAL_REP(3);
- * RENAME_PRINCIPAL_REQ(4),
- * RENAME_PRINCIPAL_REP(5);
- *
- */
-
-public enum AdminMessageType implements EnumType {
-    NONE(-1),
-    ADD_PRINCIPAL_REQ(0),
-    ADD_PRINCIPAL_REP(1),
-    DELETE_PRINCIPAL_REQ(2),
-    DELETE_PRINCIPAL_REP(3),
-    RENAME_PRINCIPAL_REQ(4),
-    RENAME_PRINCIPAL_REP(5),
-    GET_PRINCS_REQ(6),
-    GET_PRINCS_REP(7);
-
-    private int value;
-
-    AdminMessageType(int value) {
-        this.value = value;
-    }
-
-    @Override
-    public int getValue() {
-        return value;
-    }
-
-    @Override
-    public String getName() {
-        return name();
-    }
-
-    public static AdminMessageType findType(int value) {
-        if (value >= 0) {
-            for (EnumType e : values()) {
-                if (e.getValue() == value) {
-                    return (AdminMessageType) e;
-                }
-            }
-        }
-        return NONE;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminRep.java
deleted file mode 100644
index ce56127..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminRep.java
+++ /dev/null
@@ -1,33 +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.tool;
-
-
-/**
- * Use to construct Admin message.
- * Probably two kinds of reply.
- * add principal -- AdRep
- * change password? -- chRep
- */
-public class AdminRep extends AdminMessage {
-    public AdminRep(AdminMessageType messageType) {
-      super(messageType);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminReq.java
deleted file mode 100644
index 655f11d..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/AdminReq.java
+++ /dev/null
@@ -1,34 +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.tool;
-
-
-/**
- * Use to construct Admin message.
- * Probably two kinds of request.
- * add principal -- AdReq
- * change password? -- chReq
- */
-public class AdminReq extends AdminMessage {
-  public AdminReq(AdminMessageType messageType) {
-    super(messageType);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalRep.java
deleted file mode 100644
index 7568e9a..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalRep.java
+++ /dev/null
@@ -1,30 +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.tool;
-
-
-/**
- * Delete principal reply, to general admin message
- */
-public class DeletePrincipalRep extends AdminRep {
-    public DeletePrincipalRep() {
-        super(AdminMessageType.DELETE_PRINCIPAL_REP);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalReq.java
deleted file mode 100644
index 4ebb5a2..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/DeletePrincipalReq.java
+++ /dev/null
@@ -1,30 +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.tool;
-
-
-/**
- * Delete principal request, to general admin message
- */
-public class DeletePrincipalReq extends AdminReq {
-    public DeletePrincipalReq() {
-        super(AdminMessageType.DELETE_PRINCIPAL_REQ);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsRep.java
deleted file mode 100644
index e9d8d39..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsRep.java
+++ /dev/null
@@ -1,26 +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.tool;
-
-public class GetprincsRep extends AdminRep {
-    public GetprincsRep() {
-        super(AdminMessageType.GET_PRINCS_REP);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsReq.java
deleted file mode 100644
index b985f6a..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/GetprincsReq.java
+++ /dev/null
@@ -1,26 +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.tool;
-
-public class GetprincsReq extends AdminReq {
-    public GetprincsReq() {
-        super(AdminMessageType.GET_PRINCS_REQ);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/KadminCode.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/KadminCode.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/KadminCode.java
deleted file mode 100644
index d33e8bb..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/KadminCode.java
+++ /dev/null
@@ -1,63 +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.tool;
-
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-/**
- * Used to decode messages between admin and admin server.
- */
-public class KadminCode {
-    public static ByteBuffer encodeMessage(AdminMessage adminMessage) {
-        int length = adminMessage.encodingLength();
-        // 4 is the head to go through network
-        ByteBuffer buffer = ByteBuffer.allocate(length + 4);
-        buffer.putInt(length); // head in network
-        //buffer.putInt(adminMessage.getAdminMessageType().getValue());
-        // type has been encoded in the admin message
-        buffer.put(adminMessage.getMessageBuffer());
-        buffer.flip();
-        return buffer;
-    }
-
-    public static AdminMessage decodeMessage(ByteBuffer buffer) throws IOException {
-        //go through network, the total length has been removed.
-        int type = buffer.getInt();
-        System.out.println("type: " + type);
-        AdminMessageType adminMessageType = AdminMessageType.findType(type);
-        AdminMessage adminMessage = null;
-        byte[] bytes = new byte[buffer.remaining()];
-        buffer.get(bytes);
-        if (adminMessageType == AdminMessageType.ADD_PRINCIPAL_REQ) {
-            adminMessage = new AddPrincipalReq();
-            System.out.println("check if decoding right: "
-                + new String(ByteBuffer.wrap(bytes).array()));
-        } else if (adminMessageType == AdminMessageType.ADD_PRINCIPAL_REP) {
-            adminMessage = new AddPrincipalRep();
-            System.out.println("check if decoding right2: "
-                + new String(ByteBuffer.wrap(bytes).array()));
-        } else {
-            throw new IOException("Unknown Admin Message Type: " + type);
-        }
-
-        return adminMessage;
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalRep.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalRep.java
deleted file mode 100644
index 831b8fe..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalRep.java
+++ /dev/null
@@ -1,29 +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.tool;
-
-/**
- * Rename principal reply, to general admin message
- */
-public class RenamePrincipalRep extends AdminRep {
-    public RenamePrincipalRep() {
-        super(AdminMessageType.RENAME_PRINCIPAL_REP);
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/5044f4f6/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalReq.java b/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalReq.java
deleted file mode 100644
index d146b12..0000000
--- a/kerby-kerb/kerb-admin/src/main/java/org/apache/kerby/kerberos/kerb/admin/tool/RenamePrincipalReq.java
+++ /dev/null
@@ -1,29 +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.tool;
-
-/**
- * Rename principal request, to general admin message
- */
-public class RenamePrincipalReq extends AdminReq {
-    public RenamePrincipalReq() {
-        super(AdminMessageType.RENAME_PRINCIPAL_REQ);
-    }
-}


Mime
View raw message