directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1036835 - in /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos: codec/kdcRep/actions/ codec/kdcReq/actions/ components/ messages/
Date Fri, 19 Nov 2010 13:39:17 GMT
Author: elecharny
Date: Fri Nov 19 13:39:17 2010
New Revision: 1036835

URL: http://svn.apache.org/viewvc?rev=1036835&view=rev
Log:
Make the inheritence scheme consistent across all the classes

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/CheckMsgType.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/CheckMsgType.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/CheckMsgType.java?rev=1036835&r1=1036834&r2=1036835&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/CheckMsgType.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/CheckMsgType.java
Fri Nov 19 13:39:17 2010
@@ -60,7 +60,7 @@ public class CheckMsgType extends Abstra
         KdcRep kdcRep = kdcRepContainer.getKdcRep();
 
         // The message type must be the expected one
-        if ( krbMsgType != kdcRep.getMsgType() )
+        if ( krbMsgType != kdcRep.getMessageType() )
         {
             LOG.error( I18n.err( I18n.ERR_04070, krbMsgType, "The msg-type should be AS-REQ
or TGS-REQ" ) );
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/CheckMsgType.java?rev=1036835&r1=1036834&r2=1036835&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/CheckMsgType.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/CheckMsgType.java
Fri Nov 19 13:39:17 2010
@@ -62,7 +62,7 @@ public class CheckMsgType extends Abstra
         KdcReq kdcReq = kdcReqContainer.getKdcReq();
 
         // The message type must be the expected one
-        if ( krbMsgType != kdcReq.getMsgType() )
+        if ( krbMsgType != kdcReq.getMessageType() )
         {
             LOG.error( I18n.err( I18n.ERR_04070, krbMsgType, "The msg-type should be AS-REQ
or TGS-REQ" ) );
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java?rev=1036835&r1=1036834&r2=1036835&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcRep.java
Fri Nov 19 13:39:17 2010
@@ -30,6 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
+import org.apache.directory.shared.kerberos.messages.KerberosMessage;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.apache.directory.shared.ldap.util.StringTools;
 
@@ -51,14 +52,8 @@ import org.apache.directory.shared.ldap.
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class KdcRep
+public class KdcRep extends KerberosMessage
 {
-    /** The PVNO field */
-    private int pvno;
-    
-    /** The message type, either it's a AS-REP or a TGS-REP */
-    private KerberosMessageType msgType;
-    
     /** The PA-DATAs */
     private List<PaData> paData;
     
@@ -95,7 +90,7 @@ public class KdcRep
      */
     public KdcRep( KerberosMessageType msgType )
     {
-        this.msgType = msgType;
+        super( msgType );
         paData = new ArrayList<PaData>();
     }
 
@@ -105,7 +100,7 @@ public class KdcRep
      */
     public int getPvno()
     {
-        return pvno;
+        return getProtocolVersionNumber();
     }
 
 
@@ -114,16 +109,7 @@ public class KdcRep
      */
     public void setPvno( int pvno )
     {
-        this.pvno = pvno;
-    }
-
-
-    /**
-     * @return the msgType
-     */
-    public KerberosMessageType getMsgType()
-    {
-        return msgType;
+        setProtocolVersionNumber( pvno );
     }
 
 
@@ -344,7 +330,7 @@ public class KdcRep
         buffer.put( TLV.getBytes( pvnoLength ) );
         
         // The value
-        Value.encode( buffer, pvno );
+        Value.encode( buffer, getProtocolVersionNumber() );
         
         // The MSG-TYPE if any ------------------------------------------------
         // The tag
@@ -352,7 +338,7 @@ public class KdcRep
         buffer.put( TLV.getBytes( msgTypeLength ) );
         
         // The value
-        Value.encode( buffer, msgType.getValue() );
+        Value.encode( buffer, getMessageType().getValue() );
         
         // The PD-DATA --------------------------------------------------------
         // The tag
@@ -415,11 +401,11 @@ public class KdcRep
     {
         StringBuilder sb = new StringBuilder();
 
-        if ( msgType == KerberosMessageType.AS_REP )
+        if ( getMessageType() == KerberosMessageType.AS_REP )
         {
             sb.append( "AS-REP" ).append( '\n' );
         }
-        else if ( msgType == KerberosMessageType.TGS_REP )
+        else if ( getMessageType() == KerberosMessageType.TGS_REP )
         {
             sb.append( "TGS-REP" ).append( '\n' );
         }
@@ -428,7 +414,7 @@ public class KdcRep
             sb.append( "Unknown" ).append( '\n' );
         }
 
-        sb.append( "pvno : " ).append( pvno ).append( '\n' );
+        sb.append( "pvno : " ).append( getProtocolVersionNumber() ).append( '\n' );
 
         sb.append( "msg-type : " );
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java?rev=1036835&r1=1036834&r2=1036835&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReq.java
Fri Nov 19 13:39:17 2010
@@ -31,6 +31,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.codec.EncoderException;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
+import org.apache.directory.shared.kerberos.messages.KerberosMessage;
 
 
 
@@ -48,14 +49,8 @@ import org.apache.directory.shared.kerbe
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class KdcReq
+public abstract class KdcReq extends KerberosMessage
 {
-    /** The PVNO field */
-    private int pvno;
-    
-    /** The message type, either it's a AS-REQ or a TGS-REQ */
-    private KerberosMessageType msgType;
-    
     /** The PA-DATAs */
     private List<PaData> paData;
     
@@ -77,7 +72,7 @@ public abstract class KdcReq
      */
     public KdcReq( KerberosMessageType msgType )
     {
-        this.msgType = msgType;
+        super( msgType );
         paData = new ArrayList<PaData>();
     }
 
@@ -87,7 +82,7 @@ public abstract class KdcReq
      */
     public int getPvno()
     {
-        return pvno;
+        return getProtocolVersionNumber();
     }
 
 
@@ -96,16 +91,7 @@ public abstract class KdcReq
      */
     public void setPvno( int pvno )
     {
-        this.pvno = pvno;
-    }
-
-
-    /**
-     * @return the msgType
-     */
-    public KerberosMessageType getMsgType()
-    {
-        return msgType;
+        setProtocolVersionNumber( pvno );
     }
 
 
@@ -235,7 +221,7 @@ public abstract class KdcReq
         buffer.put( TLV.getBytes( pvnoLength ) );
         
         // The value
-        Value.encode( buffer, pvno );
+        Value.encode( buffer, getProtocolVersionNumber() );
         
         // The msg-type if any ------------------------------------------------
         // The tag
@@ -243,7 +229,7 @@ public abstract class KdcReq
         buffer.put( TLV.getBytes( msgTypeLength ) );
         
         // The value
-        Value.encode( buffer, msgType.getValue() );
+        Value.encode( buffer, getMessageType().getValue() );
         
         // The PD-DATA --------------------------------------------------------
         // The tag
@@ -279,11 +265,11 @@ public abstract class KdcReq
     {
         StringBuilder sb = new StringBuilder();
 
-        if ( msgType == KerberosMessageType.AS_REQ )
+        if ( getMessageType() == KerberosMessageType.AS_REQ )
         {
             sb.append( "AS-REQ" ).append( '\n' );
         }
-        else if ( msgType == KerberosMessageType.TGS_REQ )
+        else if ( getMessageType() == KerberosMessageType.TGS_REQ )
         {
             sb.append( "TGS-REQ" ).append( '\n' );
         }
@@ -292,7 +278,7 @@ public abstract class KdcReq
             sb.append( "Unknown" ).append( '\n' );
         }
 
-        sb.append( "pvno : " ).append( pvno ).append( '\n' );
+        sb.append( "pvno : " ).append( getProtocolVersionNumber() ).append( '\n' );
 
         sb.append( "msg-type : " );
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java?rev=1036835&r1=1036834&r2=1036835&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/KdcReqBody.java
Fri Nov 19 13:39:17 2010
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.asn1.AbstractAsn1Object;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
@@ -66,7 +67,7 @@ import sun.security.krb5.internal.Author
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class KdcReqBody
+public class KdcReqBody extends AbstractAsn1Object
 {
     /** The KDC options */
     private KdcOptions kdcOptions;

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java?rev=1036835&r1=1036834&r2=1036835&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/messages/KerberosMessage.java
Fri Nov 19 13:39:17 2010
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.kerberos.messages;
 
+import org.apache.directory.shared.asn1.AbstractAsn1Object;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
 
@@ -27,7 +28,7 @@ import org.apache.directory.shared.kerbe
 /**
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class KerberosMessage
+public abstract class KerberosMessage extends AbstractAsn1Object
 {
     /** The Kerberos protocol version number (5). */
     public static final int PVNO = KerberosConstants.KERBEROS_V5;



Mime
View raw message