directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [3/5] directory-kerby git commit: o Added some Javadoc o Made teh constructor protected, so that no-one can invoke it directly
Date Mon, 04 Jan 2016 11:46:06 GMT
o Added some Javadoc
o Made teh constructor protected, so that no-one can invoke it directly

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

Branch: refs/heads/trunk
Commit: 73ef82b70a79570db65bb855adc58a236d645beb
Parents: c802b31
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Sun Jan 3 22:22:11 2016 +0100
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Sun Jan 3 22:22:11 2016 +0100

----------------------------------------------------------------------
 .../kerberos/kerb/type/base/KrbMessage.java     | 54 +++++++++++++++++++-
 1 file changed, 53 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/73ef82b7/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
index 6efcc82..a0d14eb 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
@@ -24,43 +24,95 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.kerberos.kerb.KrbConstant;
 import org.apache.kerby.kerberos.kerb.type.KrbAppSequenceType;
 
+/**
+ * A base class for every possible Kerberos messages :
+ * 
+ * <ul>
+ *   <li>AS-REQ    : [APPLICATION 10]</li>
+ *   <li>AS-REP    : [APPLICATION 11]</li>
+ *   <li>TGS-REQ   : [APPLICATION 12]</li>
+ *   <li>TGS-REP   : [APPLICATION 13]</li>
+ *   <li>AP-REQ    : [APPLICATION 14]</li>
+ *   <li>AP-REP    : [APPLICATION 15]</li>
+ *   <li>KRB-SAFE  : [APPLICATION 20]</li>
+ *   <li>KRB-PRIV  : [APPLICATION 21]</li>
+ *   <li>KRB-CRED  : [APPLICATION 22]</li>
+ *   <li>KRB_ERROR : [APPLICATION 30]</li>
+ * </ul>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
 public abstract class KrbMessage extends KrbAppSequenceType {
+    /**
+     * The possible fields. We declare the PVNO and MSG_TYPE fields, which are already
+     * declared in every inherited classes, because we need to have access to them
+     * in this class to implement the common setters and getters. We can't reuse them 
+     * in the inherited classes either...
+     */
     protected enum KrbMessageField implements EnumType {
         PVNO,
         MSG_TYPE;
 
+        /**
+         * {@inheritDoc}
+         */
         @Override
         public int getValue() {
             return ordinal();
         }
 
+        /**
+         * {@inheritDoc}
+         */
         @Override
         public String getName() {
             return name();
         }
     }
 
+    /** The PVNO fields. Default to KRB_V5 */
     private final int pvno = KrbConstant.KRB_V5;
 
-    public KrbMessage(KrbMessageType msgType, Asn1FieldInfo[] fieldInfos) {
+    /**
+     * Creates a new instance of a KrbMessage. It's not possible to invoque this
+     * constructor directly.
+     * 
+     * @param msgType The Kerberos messag etype
+     * @param fieldInfos The fields to use
+     */
+    protected KrbMessage(KrbMessageType msgType, Asn1FieldInfo[] fieldInfos) {
         super(msgType.getValue(), fieldInfos);
         setPvno(pvno);
         setMsgType(msgType);
     }
 
+    /**
+     * @return The PVNO field
+     */
     public int getPvno() {
         return pvno;
     }
 
+    /**
+     * Sets the PVNO field
+     * @param pvno The PVNO to set
+     */
     protected void setPvno(int pvno) {
         setFieldAsInt(KrbMessageField.PVNO, pvno);
     }
 
+    /**
+     * @return The Kerberos message type field
+     */
     public KrbMessageType getMsgType() {
         Integer value = getFieldAsInteger(KrbMessageField.MSG_TYPE);
+        
         return KrbMessageType.fromValue(value);
     }
 
+    /**
+     * Sets the Kerberos Message Type field
+     * @param pmsgType The Kerberos Message Type to set
+     */
     public void setMsgType(KrbMessageType msgType) {
         setFieldAsInt(KrbMessageField.MSG_TYPE, msgType.getValue());
     }


Mime
View raw message