directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1068124 [3/19] - in /directory/apacheds/branches/m1/kerberos-codec/src: main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/ main/java/org/apache/di...
Date Mon, 07 Feb 2011 20:49:13 GMT
Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageGrammar.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec;
 
@@ -23,7 +23,6 @@ package org.apache.directory.shared.kerb
 import java.nio.ByteBuffer;
 
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
 import org.apache.directory.shared.asn1.ber.grammar.Grammar;
@@ -50,10 +49,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the KerberosMessage message. All the actions are declared
  * in this class. As it is a singleton, these declaration are only done once. If
  * an action is to be added or modified, this is where the work is to be done !
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class KerberosMessageGrammar extends AbstractGrammar
+public final class KerberosMessageGrammar extends AbstractGrammar<KerberosMessageContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( KerberosMessageGrammar.class );
@@ -62,29 +61,26 @@ public final class KerberosMessageGramma
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. KerberosMessageGrammar is a singleton */
-    private static Grammar instance = new KerberosMessageGrammar();
+    private static Grammar<KerberosMessageContainer> instance = new KerberosMessageGrammar();
 
     Asn1Decoder kerberosDecoder = new Asn1Decoder();
 
-    
-    private class DecodeKerberosMessage extends GrammarAction 
+    private class DecodeKerberosMessage extends GrammarAction<KerberosMessageContainer>
     {
-        public void action( Asn1Container container ) throws DecoderException
+        public void action( KerberosMessageContainer kerberosMessageContainer ) throws DecoderException
         {
-            KerberosMessageContainer kerberosMessageContainer = ( KerberosMessageContainer ) container;
-
             ByteBuffer stream = kerberosMessageContainer.getStream();
             stream.rewind();
-            
+
             TLV tlv = kerberosMessageContainer.getCurrentTLV();
             kerberosMessageContainer.setGrammarEndAllowed( true );
 
             // Now, depending on the T, call the inner decoder
             switch ( tlv.getTag() )
             {
-                case KerberosConstants.AS_REQ_TAG :
+                case KerberosConstants.AS_REQ_TAG:
                     AsReqContainer asReqContainer = new AsReqContainer( stream );
-                    
+
                     // Decode the AS_REQ PDU
                     try
                     {
@@ -94,15 +90,15 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage asReq = asReqContainer.getAsReq();
                     kerberosMessageContainer.setMessage( asReq );
-                    
+
                     break;
 
-                case KerberosConstants.AS_REP_TAG :
+                case KerberosConstants.AS_REP_TAG:
                     AsRepContainer asRepContainer = new AsRepContainer( stream );
-                    
+
                     // Decode the AS-REP PDU
                     try
                     {
@@ -112,15 +108,15 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage asRep = asRepContainer.getAsRep();
                     kerberosMessageContainer.setMessage( asRep );
-                    
+
                     break;
 
-                case KerberosConstants.TGS_REQ_TAG :
+                case KerberosConstants.TGS_REQ_TAG:
                     TgsReqContainer tgsReqContainer = new TgsReqContainer( stream );
-                    
+
                     // Decode the TGS-REQ PDU
                     try
                     {
@@ -130,15 +126,15 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage tgsReq = tgsReqContainer.getTgsReq();
                     kerberosMessageContainer.setMessage( tgsReq );
-                    
+
                     break;
 
-                case KerberosConstants.TGS_REP_TAG :
+                case KerberosConstants.TGS_REP_TAG:
                     TgsRepContainer tgsRepContainer = new TgsRepContainer( stream );
-                    
+
                     // Decode the TGS-REP PDU
                     try
                     {
@@ -148,15 +144,15 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage tgsRep = tgsRepContainer.getTgsRep();
                     kerberosMessageContainer.setMessage( tgsRep );
-                    
+
                     break;
 
-                case KerberosConstants.AP_REQ_TAG :
+                case KerberosConstants.AP_REQ_TAG:
                     ApReqContainer apReqContainer = new ApReqContainer( stream );
-                    
+
                     // Decode the AP-REQ PDU
                     try
                     {
@@ -166,14 +162,14 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage apReq = apReqContainer.getApReq();
                     kerberosMessageContainer.setMessage( apReq );
                     break;
 
-                case KerberosConstants.AP_REP_TAG :
+                case KerberosConstants.AP_REP_TAG:
                     ApRepContainer apRepContainer = new ApRepContainer( stream );
-                    
+
                     // Decode the AP-REP PDU
                     try
                     {
@@ -183,14 +179,14 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage apRep = apRepContainer.getApRep();
                     kerberosMessageContainer.setMessage( apRep );
                     break;
 
-                case KerberosConstants.KRB_SAFE_TAG :
+                case KerberosConstants.KRB_SAFE_TAG:
                     KrbSafeContainer krbSafeContainer = new KrbSafeContainer( stream );
-                    
+
                     // Decode the KRB-SAFE PDU
                     try
                     {
@@ -200,14 +196,14 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage krbSafe = krbSafeContainer.getKrbSafe();
                     kerberosMessageContainer.setMessage( krbSafe );
                     break;
 
-                case KerberosConstants.KRB_PRIV_TAG :
+                case KerberosConstants.KRB_PRIV_TAG:
                     KrbPrivContainer krbPrivContainer = new KrbPrivContainer( stream );
-                    
+
                     // Decode the KRB-PRIV PDU
                     try
                     {
@@ -217,14 +213,14 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage krbPriv = krbPrivContainer.getKrbPriv();
                     kerberosMessageContainer.setMessage( krbPriv );
                     break;
 
-                case KerberosConstants.KRB_CRED_TAG :
+                case KerberosConstants.KRB_CRED_TAG:
                     KrbCredContainer krbCredContainer = new KrbCredContainer( stream );
-                    
+
                     // Decode the KRB-CRED PDU
                     try
                     {
@@ -234,14 +230,14 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage krbCred = krbCredContainer.getKrbCred();
                     kerberosMessageContainer.setMessage( krbCred );
                     break;
 
-                case KerberosConstants.KRB_ERROR_TAG :
+                case KerberosConstants.KRB_ERROR_TAG:
                     KrbErrorContainer krbErrorContainer = new KrbErrorContainer( stream );
-                    
+
                     // Decode the KRB-ERROR PDU
                     try
                     {
@@ -251,12 +247,12 @@ public final class KerberosMessageGramma
                     {
                         throw de;
                     }
-                    
+
                     KerberosMessage krbError = krbErrorContainer.getKrbError();
                     kerberosMessageContainer.setMessage( krbError );
                     break;
             }
-            
+
             // We are done, get out
             if ( IS_DEBUG )
             {
@@ -265,9 +261,11 @@ public final class KerberosMessageGramma
         }
     }
 
+
     /**
      * Creates a new KerberosMessageGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private KerberosMessageGrammar()
     {
         setName( KerberosMessageGrammar.class.getName() );
@@ -276,61 +274,81 @@ public final class KerberosMessageGramma
         super.transitions = new GrammarTransition[KerberosMessageStatesEnum.LAST_KERBEROS_MESSAGE_STATE.ordinal()][256];
 
         // ============================================================================================
-        // Ticket 
+        // Ticket
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from START to Ticket
         // --------------------------------------------------------------------------------------------
         // This is the starting state :
-        // Ticket          ::= [APPLICATION 1] ... 
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REQ_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AS_REQ_STATE, KerberosConstants.AS_REQ_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REP_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AS_REP_TAG_STATE, KerberosConstants.AS_REP_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.TGS_REQ_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.TGS_REQ_TAG_STATE, KerberosConstants.TGS_REQ_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.TGS_REP_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.TGS_REP_TAG_STATE, KerberosConstants.TGS_REP_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REQ_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AP_REQ_TAG_STATE, KerberosConstants.AP_REQ_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REP_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AP_REP_TAG_STATE, KerberosConstants.AP_REP_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_SAFE_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_SAFE_STATE, KerberosConstants.KRB_SAFE_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_PRIV_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_PRIV_STATE, KerberosConstants.KRB_PRIV_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_CRED_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_CRED_STATE, KerberosConstants.KRB_CRED_TAG,
-            new DecodeKerberosMessage() );
-        
-        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_ERROR_TAG] = new GrammarTransition(
-            KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_ERROR_STATE, KerberosConstants.KRB_ERROR_TAG,
-            new DecodeKerberosMessage() );
+        // Ticket          ::= [APPLICATION 1] ...
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REQ_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AS_REQ_STATE,
+                KerberosConstants.AS_REQ_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REP_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AS_REP_TAG_STATE,
+                KerberosConstants.AS_REP_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.TGS_REQ_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.TGS_REQ_TAG_STATE,
+                KerberosConstants.TGS_REQ_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.TGS_REP_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.TGS_REP_TAG_STATE,
+                KerberosConstants.TGS_REP_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REQ_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AP_REQ_TAG_STATE,
+                KerberosConstants.AP_REQ_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REP_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.AP_REP_TAG_STATE,
+                KerberosConstants.AP_REP_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_SAFE_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_SAFE_STATE,
+                KerberosConstants.KRB_SAFE_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_PRIV_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_PRIV_STATE,
+                KerberosConstants.KRB_PRIV_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_CRED_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_CRED_STATE,
+                KerberosConstants.KRB_CRED_TAG,
+                new DecodeKerberosMessage() );
+
+        super.transitions[KerberosMessageStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_ERROR_TAG] =
+            new GrammarTransition<KerberosMessageContainer>(
+                KerberosMessageStatesEnum.START_STATE, KerberosMessageStatesEnum.KRB_ERROR_STATE,
+                KerberosConstants.KRB_ERROR_TAG,
+                new DecodeKerberosMessage() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the KerberosMessage Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<KerberosMessageContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/KerberosMessageStatesEnum.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec;
 
@@ -39,16 +39,16 @@ import org.apache.directory.shared.asn1.
  * <li>0x76 : KRB-CRED</li>
  * <li>0x7E : KRB-ERROR</li>
  * </ul>
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum KerberosMessageStatesEnum implements States
 {
     // Start
     START_STATE,
-    
+
     // ----- Kerberos message --------------------------------------------
-    
+
     AS_REQ_STATE,       // 0x6A
     AS_REP_TAG_STATE,   // 0x6B
     TGS_REQ_TAG_STATE,  // 0x6C
@@ -63,10 +63,10 @@ public enum KerberosMessageStatesEnum im
     // End
     LAST_KERBEROS_MESSAGE_STATE;
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -78,11 +78,11 @@ public enum KerberosMessageStatesEnum im
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<KerberosMessageContainer> grammar )
     {
         if ( grammar instanceof KerberosMessageGrammar )
         {
@@ -97,7 +97,7 @@ public enum KerberosMessageStatesEnum im
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -106,7 +106,7 @@ public enum KerberosMessageStatesEnum im
         return ( ( state == LAST_KERBEROS_MESSAGE_STATE.ordinal() ) ? "KERBEROS_MESSAGE_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -114,8 +114,8 @@ public enum KerberosMessageStatesEnum im
     {
         return this == LAST_KERBEROS_MESSAGE_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadAuthorizationData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadAuthorizationData.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadAuthorizationData.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadAuthorizationData.java Mon Feb  7 20:49:04 2011
@@ -6,25 +6,25 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
 
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.authorizationData.AuthorizationDataContainer;
 import org.apache.directory.shared.kerberos.components.AuthorizationData;
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to set the AuthorizationData
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadAuthorizationData extends GrammarAction
+public abstract class AbstractReadAuthorizationData<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadAuthorizationData.class );
@@ -57,17 +57,17 @@ public abstract class AbstractReadAuthor
 
     /**
      * set the AuthorizationData on the ASN.1 object of the container
-     *   
+     *
      * @param authorizationData the AuthorizationData object
      * @param container container holding the ASN.1 object
      */
-    protected abstract void setAuthorizationData( AuthorizationData authorizationData, Asn1Container container );
+    protected abstract void setAuthorizationData( AuthorizationData authorizationData, E container );
 
 
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -103,7 +103,7 @@ public abstract class AbstractReadAuthor
         }
 
         setAuthorizationData( authorizationData, container );
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadCheckSum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadCheckSum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadCheckSum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadCheckSum.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to set the Checksum
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadCheckSum extends GrammarAction
+public abstract class AbstractReadCheckSum<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadCheckSum.class );
@@ -57,17 +57,17 @@ public abstract class AbstractReadCheckS
 
     /**
      * set the Checksum on the ASN.1 object of the container
-     *   
+     *
      * @param checksum the Checksum object
      * @param container container holding the ASN.1 object
      */
-    protected abstract void setChecksum( Checksum checksum, Asn1Container container );
+    protected abstract void setChecksum( Checksum checksum, E container );
 
 
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -103,7 +103,7 @@ public abstract class AbstractReadCheckS
         }
 
         setChecksum( checksum, container );
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptedPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptedPart.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptedPart.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptedPart.java Mon Feb  7 20:49:04 2011
@@ -6,25 +6,25 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
 
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.encryptedData.EncryptedDataContainer;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read the EncryptedData
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadEncryptedPart extends GrammarAction
+public abstract class AbstractReadEncryptedPart<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadEncryptedPart.class );
@@ -56,19 +56,19 @@ public abstract class AbstractReadEncryp
 
 
     /**
-     * 
+     *
      * set the EncryptedData on the ASN.1 object present in the container
      *
      * @param encryptedData the encrypted data
      * @param container the container holding ASN.1 object
      */
-    protected abstract void setEncryptedData( EncryptedData encryptedData, Asn1Container container );
+    protected abstract void setEncryptedData( EncryptedData encryptedData, E container );
 
 
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -105,7 +105,7 @@ public abstract class AbstractReadEncryp
         }
 
         setEncryptedData( encryptedData, container );
-        
+
         // Update the TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptionKey.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptionKey.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptionKey.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadEncryptionKey.java Mon Feb  7 20:49:04 2011
@@ -6,25 +6,25 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
 
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.encryptionKey.EncryptionKeyContainer;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to set the EncryptionKey
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadEncryptionKey extends GrammarAction
+public abstract class AbstractReadEncryptionKey<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadEncryptionKey.class );
@@ -57,17 +57,17 @@ public abstract class AbstractReadEncryp
 
     /**
      * set the EncryptionKey on the ASN.1 object of the container
-     *   
+     *
      * @param encryptionKey the EncryptionKey object
      * @param container container holding the ASN.1 object
      */
-    protected abstract void setEncryptionKey( EncryptionKey encryptionKey, Asn1Container container );
+    protected abstract void setEncryptionKey( EncryptionKey encryptionKey, E container );
 
 
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -103,7 +103,7 @@ public abstract class AbstractReadEncryp
         }
 
         setEncryptionKey( encryptionKey, container );
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddress.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddress.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddress.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddress.java Mon Feb  7 20:49:04 2011
@@ -6,25 +6,25 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
 
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.hostAddress.HostAddressContainer;
 import org.apache.directory.shared.kerberos.components.HostAddress;
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read the HostAddress
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadHostAddress extends GrammarAction
+public abstract class AbstractReadHostAddress<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadHostAddress.class );
@@ -55,12 +55,12 @@ public abstract class AbstractReadHostAd
     }
 
 
-    protected abstract void setAddress( HostAddress hostAddress, Asn1Container container );
-    
+    protected abstract void setAddress( HostAddress hostAddress, E container );
+
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -72,12 +72,12 @@ public abstract class AbstractReadHostAd
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // Now, let's decode the HostAddress
         Asn1Decoder hostAddressDecoder = new Asn1Decoder();
-        
+
         HostAddressContainer hostAddressContainer = new HostAddressContainer();
-        
+
         // Passes the Stream to the decoder
         hostAddressContainer.setStream( container.getStream() );
 
@@ -93,15 +93,15 @@ public abstract class AbstractReadHostAd
 
         // Store the HostAddress in the container
         HostAddress hostAddress = hostAddressContainer.getHostAddress();
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
         container.updateParent();
-        
+
         setAddress( hostAddress, container );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "HostAddress : {}", hostAddress );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddresses.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddresses.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddresses.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadHostAddresses.java Mon Feb  7 20:49:04 2011
@@ -6,25 +6,25 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
 
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.hostAddresses.HostAddressesContainer;
 import org.apache.directory.shared.kerberos.components.HostAddresses;
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The abstract action used to read the HostAddresses
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadHostAddresses extends GrammarAction
+public abstract class AbstractReadHostAddresses<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadHostAddresses.class );
@@ -54,20 +54,20 @@ public abstract class AbstractReadHostAd
         super( name );
     }
 
-    
+
     /**
      * set HostAddresses on the ASN.1 object present in the container
-     * 
+     *
      * @param hostAddresses the host addresses
      * @param container the container holding the ASN.1 object
      */
-    protected abstract void setHostAddresses( HostAddresses hostAddresses, Asn1Container container );
+    protected abstract void setHostAddresses( HostAddresses hostAddresses, E container );
+
 
-    
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -79,12 +79,12 @@ public abstract class AbstractReadHostAd
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // Now, let's decode the HostAddresses
         Asn1Decoder hostAddressesDecoder = new Asn1Decoder();
-        
+
         HostAddressesContainer hostAddressesContainer = new HostAddressesContainer();
-        
+
         // Passes the Stream to the decoder
         hostAddressesContainer.setStream( container.getStream() );
 
@@ -101,13 +101,13 @@ public abstract class AbstractReadHostAd
         // Store the HostAddresses in the container
         HostAddresses hostAddresses = hostAddressesContainer.getHostAddresses();
         setHostAddresses( hostAddresses, container );
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
         container.updateParent();
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "HostAddresses : {}", hostAddresses );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadKerberosTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadKerberosTime.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadKerberosTime.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadKerberosTime.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read the KerberosTime
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadKerberosTime extends GrammarAction
+public abstract class AbstractReadKerberosTime<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadKerberosTime.class );
@@ -56,19 +56,19 @@ public abstract class AbstractReadKerber
 
 
     /**
-     * 
+     *
      * set the KerberosTime on the ASN.1 object present in the container
-     * 
+     *
      * @param krbtime the KerberosTime decoded from the TLV
      * @param container the ASN.1 object's container
      */
-    protected abstract void setKerberosTime( KerberosTime krbtime, Asn1Container container );
+    protected abstract void setKerberosTime( KerberosTime krbtime, E container );
 
 
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadMsgType.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadMsgType.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadMsgType.java Mon Feb  7 20:49:04 2011
@@ -6,27 +6,27 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
 
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
-import org.apache.directory.shared.asn1.ber.tlv.TLV;
-import org.apache.directory.shared.asn1.ber.tlv.Value;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.tlv.IntegerDecoder;
 import org.apache.directory.shared.asn1.ber.tlv.IntegerDecoderException;
+import org.apache.directory.shared.asn1.ber.tlv.TLV;
+import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.KerberosMessageType;
 import org.apache.directory.shared.kerberos.codec.kdcRep.KdcRepContainer;
@@ -38,10 +38,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read and validate the msg-type
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadMsgType extends GrammarAction
+public abstract class AbstractReadMsgType<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadMsgType.class );
@@ -57,7 +57,7 @@ public abstract class AbstractReadMsgTyp
         super( name );
     }
 
-    
+
     /**
      * Instantiates a new StoreMsgType action.
      */
@@ -67,11 +67,11 @@ public abstract class AbstractReadMsgTyp
         this.msgType = msgType;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -89,13 +89,13 @@ public abstract class AbstractReadMsgTyp
         try
         {
             int msgTypeValue = IntegerDecoder.parse( value );
-            
+
             if ( msgType != null )
             {
                 if ( msgType.getValue() == msgTypeValue )
                 {
                     LOG.debug( "msg-type : {}", msgType );
-                    
+
                     return;
                 }
 
@@ -108,7 +108,7 @@ public abstract class AbstractReadMsgTyp
             else
             {
                 KerberosMessageType messageType = KerberosMessageType.getTypeByValue( msgTypeValue );
-                
+
                 if ( container instanceof KdcReqContainer )
                 {
                     if ( ((KdcReqContainer)container).getKdcReq().getMessageType() == messageType )
@@ -123,7 +123,7 @@ public abstract class AbstractReadMsgTyp
                         return;
                     }
                 }
-                
+
                 String message = I18n.err( I18n.ERR_04070, Strings.dumpBytes(value.getData()) );
                 LOG.error( message );
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPrincipalName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPrincipalName.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPrincipalName.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPrincipalName.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
@@ -34,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to set the ticket SName
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadPrincipalName extends GrammarAction
+public abstract class AbstractReadPrincipalName<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadPrincipalName.class );
@@ -57,17 +57,17 @@ public abstract class AbstractReadPrinci
 
     /**
      * set the PrincipalName on the ASN.1 object of the container
-     *   
+     *
      * @param principalName the principal
      * @param container container holding the ASN.1 object
      */
-    protected abstract void setPrincipalName( PrincipalName principalName, Asn1Container container );
+    protected abstract void setPrincipalName( PrincipalName principalName, E container );
 
 
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -103,7 +103,7 @@ public abstract class AbstractReadPrinci
         }
 
         setPrincipalName( principalName, container );
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPvno.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadPvno.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
@@ -35,10 +35,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read the PVNO
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadPvno extends GrammarAction
+public abstract class AbstractReadPvno<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadPvno.class );
@@ -60,17 +60,17 @@ public abstract class AbstractReadPvno e
 
     /**
      * sets the pvno on the ASN.1 object present in the container
-     * 
+     *
      * @param pvno the protocol version number received
      * @param container the ASN.1 object's container
      */
-    protected abstract void setPvno( int pvno, Asn1Container container );
+    protected abstract void setPvno( int pvno, E container );
 
 
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadRealm.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadRealm.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/actions/AbstractReadRealm.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.actions;
 
@@ -33,10 +33,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read the Realm
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractReadRealm extends GrammarAction
+public abstract class AbstractReadRealm<E extends Asn1Container> extends GrammarAction<E>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractReadRealm.class );
@@ -56,16 +56,16 @@ public abstract class AbstractReadRealm 
 
     /**
      * sets the relam value on the ASN.1 object present in the container
-     * 
+     *
      * @param realm the realm name
      * @param container the container holding ASN.1 object
      */
-    protected abstract void setRealm( String realm, Asn1Container container );
-    
+    protected abstract void setRealm( String realm, E container );
+
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( E container ) throws DecoderException
     {
         TLV tlv = container.getCurrentTLV();
 
@@ -77,7 +77,7 @@ public abstract class AbstractReadRealm 
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // The value is the realm
         Value value = tlv.getValue();
         String realm = Strings.utf8ToString(value.getData());
@@ -86,7 +86,7 @@ public abstract class AbstractReadRealm 
         {
             LOG.debug( "read realm value : " + realm );
         }
-        
+
         setRealm( realm, container );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrGrammar.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.adAndOr;
 
@@ -37,10 +37,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the AdAndOr structure. All the actions are declared
  * in this class. As it is a singleton, these declaration are only done once. If
  * an action is to be added or modified, this is where the work is to be done !
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class AdAndOrGrammar extends AbstractGrammar
+public final class AdAndOrGrammar extends AbstractGrammar<AdAndOrContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( AdAndOrGrammar.class );
@@ -49,12 +49,13 @@ public final class AdAndOrGrammar extend
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. AdAndOrGrammar is a singleton */
-    private static Grammar instance = new AdAndOrGrammar();
+    private static Grammar<AdAndOrContainer> instance = new AdAndOrGrammar();
 
 
     /**
      * Creates a new AdAndOrGrammar object.
      */
+    @SuppressWarnings( "unchecked" )
     private AdAndOrGrammar()
     {
         setName( AdAndOrGrammar.class.getName() );
@@ -63,33 +64,42 @@ public final class AdAndOrGrammar extend
         super.transitions = new GrammarTransition[AdAndOrStatesEnum.LAST_AD_AND_OR_STATE.ordinal()][256];
 
         // ============================================================================================
-        // AdAndOr 
+        // AdAndOr
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from AdAndOr init to AdAndOr SEQ
         // --------------------------------------------------------------------------------------------
         // AD-AND-OR               ::= SEQUENCE {
-        super.transitions[AdAndOrStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            AdAndOrStatesEnum.START_STATE, AdAndOrStatesEnum.AD_AND_OR_STATE, UniversalTag.SEQUENCE.getValue(),
-            new AdAndOrInit() );
-        
+        super.transitions[AdAndOrStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<AdAndOrContainer>(
+                AdAndOrStatesEnum.START_STATE,
+                AdAndOrStatesEnum.AD_AND_OR_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new AdAndOrInit() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from AdAndOr SEQ to condition-count tag
         // --------------------------------------------------------------------------------------------
         // AD-AND-OR               ::= SEQUENCE {
         //         condition-count [0]
-        super.transitions[AdAndOrStatesEnum.AD_AND_OR_STATE.ordinal()][KerberosConstants.AD_AND_OR_CONDITION_COUNT_TAG] = new GrammarTransition(
-            AdAndOrStatesEnum.AD_AND_OR_STATE, AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_TAG_STATE, KerberosConstants.AD_AND_OR_CONDITION_COUNT_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AdAndOrStatesEnum.AD_AND_OR_STATE.ordinal()][KerberosConstants.AD_AND_OR_CONDITION_COUNT_TAG] =
+            new GrammarTransition<AdAndOrContainer>(
+                AdAndOrStatesEnum.AD_AND_OR_STATE,
+                AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_TAG_STATE,
+                KerberosConstants.AD_AND_OR_CONDITION_COUNT_TAG,
+                new CheckNotNullLength<AdAndOrContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from condition-count tag to condition-count value
         // --------------------------------------------------------------------------------------------
         // AD-AND-OR               ::= SEQUENCE {
         //         condition-count [0] Int32,
-        super.transitions[AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_TAG_STATE, AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_STATE, UniversalTag.INTEGER.getValue(),
-            new StoreConditionCount() );
+        super.transitions[AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<AdAndOrContainer>(
+                AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_TAG_STATE,
+                AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StoreConditionCount() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from condition-countvalue to elements
@@ -98,18 +108,21 @@ public final class AdAndOrGrammar extend
         //         ...
         //         elements        [1] AuthorizationData
         // }
-        super.transitions[AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_STATE.ordinal()][KerberosConstants.AD_AND_OR_ELEMENTS_TAG] = new GrammarTransition(
-            AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_STATE, AdAndOrStatesEnum.AD_AND_OR_ELEMENTS_TAG_STATE, KerberosConstants.AD_AND_OR_ELEMENTS_TAG,
-            new StoreElements() );
+        super.transitions[AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_STATE.ordinal()][KerberosConstants.AD_AND_OR_ELEMENTS_TAG] =
+            new GrammarTransition<AdAndOrContainer>(
+                AdAndOrStatesEnum.AD_AND_OR_CONDITION_COUNT_STATE,
+                AdAndOrStatesEnum.AD_AND_OR_ELEMENTS_TAG_STATE,
+                KerberosConstants.AD_AND_OR_ELEMENTS_TAG,
+                new StoreElements() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the AD-AND-OR Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<AdAndOrContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/AdAndOrStatesEnum.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.adAndOr;
 
@@ -27,29 +27,29 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the AD-AND-OR grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum AdAndOrStatesEnum implements States
 {
     // Start
     START_STATE,                          // 0
-    
+
     // ----- AD-AND-OR message --------------------------------------
     AD_AND_OR_STATE,                      // 1
-    
+
     AD_AND_OR_CONDITION_COUNT_TAG_STATE,  // 2
     AD_AND_OR_CONDITION_COUNT_STATE,      // 3
-    
+
     AD_AND_OR_ELEMENTS_TAG_STATE,         // 4
-    
+
     // End
     LAST_AD_AND_OR_STATE;                 // 5
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -61,11 +61,11 @@ public enum AdAndOrStatesEnum implements
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<AdAndOrContainer> grammar )
     {
         if ( grammar instanceof AdAndOrGrammar )
         {
@@ -80,7 +80,7 @@ public enum AdAndOrStatesEnum implements
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -89,7 +89,7 @@ public enum AdAndOrStatesEnum implements
         return ( ( state == LAST_AD_AND_OR_STATE.ordinal() ) ? "AD_AND_OR_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -97,8 +97,8 @@ public enum AdAndOrStatesEnum implements
     {
         return this == LAST_AD_AND_OR_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/AdAndOrInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/AdAndOrInit.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/AdAndOrInit.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/AdAndOrInit.java Mon Feb  7 20:49:04 2011
@@ -6,22 +6,21 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.adAndOr.actions;
 
 
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.i18n.I18n;
@@ -33,10 +32,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to initialize the AD-AND-OR object
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AdAndOrInit extends GrammarAction
+public class AdAndOrInit extends GrammarAction<AdAndOrContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AdAndOrInit.class );
@@ -57,10 +56,8 @@ public class AdAndOrInit extends Grammar
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( AdAndOrContainer adAndOrContainer ) throws DecoderException
     {
-        AdAndOrContainer adAndOrContainer = ( AdAndOrContainer ) container;
-
         TLV tlv = adAndOrContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -71,10 +68,10 @@ public class AdAndOrInit extends Grammar
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         AdAndOr adAndor = new AdAndOr();
         adAndOrContainer.setAdAndOr( adAndor );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "AdAndOr created" );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreConditionCount.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreConditionCount.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreConditionCount.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreConditionCount.java Mon Feb  7 20:49:04 2011
@@ -22,7 +22,6 @@ package org.apache.directory.shared.kerb
 
 
 import org.apache.directory.shared.asn1.actions.AbstractReadInteger;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.adAndOr.AdAndOrContainer;
 
 
@@ -31,7 +30,7 @@ import org.apache.directory.shared.kerbe
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreConditionCount extends AbstractReadInteger
+public class StoreConditionCount extends AbstractReadInteger<AdAndOrContainer>
 {
     /**
      * Creates a new instance of StoreConditionCount.
@@ -46,9 +45,8 @@ public class StoreConditionCount extends
      * {@inheritDoc}
      */
     @Override
-    protected void setIntegerValue( int value, Asn1Container container )
+    protected void setIntegerValue( int value, AdAndOrContainer adAndOrContainer )
     {
-        AdAndOrContainer adAndOrContainer = ( AdAndOrContainer ) container;
         adAndOrContainer.getAdAndOr().setConditionCount( value );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreElements.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreElements.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreElements.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adAndOr/actions/StoreElements.java Mon Feb  7 20:49:04 2011
@@ -6,21 +6,20 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.adAndOr.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadAuthorizationData;
 import org.apache.directory.shared.kerberos.codec.adAndOr.AdAndOrContainer;
 import org.apache.directory.shared.kerberos.components.AuthorizationData;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to store the AdAndor 'elements' value
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreElements extends AbstractReadAuthorizationData
+public class StoreElements extends AbstractReadAuthorizationData<AdAndOrContainer>
 {
     /**
      * Instantiates a new StoreElements action.
@@ -46,9 +45,8 @@ public class StoreElements extends Abstr
      * {@inheritDoc}
      */
     @Override
-    protected void setAuthorizationData( AuthorizationData authorizationData, Asn1Container container )
+    protected void setAuthorizationData( AuthorizationData authorizationData, AdAndOrContainer adAndOrContainer )
     {
-        AdAndOrContainer adAndOrContainer = ( AdAndOrContainer ) container;
         adAndOrContainer.getAdAndOr().setElements( authorizationData );
         adAndOrContainer.setGrammarEndAllowed( true );
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/AdKDCIssuedGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/AdKDCIssuedGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/AdKDCIssuedGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/AdKDCIssuedGrammar.java Mon Feb  7 20:49:04 2011
@@ -6,16 +6,16 @@
  *  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. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.adKdcIssued;
 
@@ -39,10 +39,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the AdKdcIssued structure. All the actions are declared
  * in this class. As it is a singleton, these declaration are only done once. If
  * an action is to be added or modified, this is where the work is to be done !
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class AdKDCIssuedGrammar extends AbstractGrammar
+public final class AdKDCIssuedGrammar extends AbstractGrammar<AdKdcIssuedContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( AdKDCIssuedGrammar.class );
@@ -51,12 +51,13 @@ public final class AdKDCIssuedGrammar ex
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. AdKdcIssuedGrammar is a singleton */
-    private static Grammar instance = new AdKDCIssuedGrammar();
+    private static Grammar<AdKdcIssuedContainer> instance = new AdKDCIssuedGrammar();
 
 
     /**
      * Creates a new AdKdcIssuedGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private AdKDCIssuedGrammar()
     {
         setName( AdKDCIssuedGrammar.class.getName() );
@@ -65,56 +66,83 @@ public final class AdKDCIssuedGrammar ex
         super.transitions = new GrammarTransition[AdKDCIssuedStatesEnum.LAST_AD_KDC_ISSUED_STATE.ordinal()][256];
 
         // ============================================================================================
-        // AdKdcIssued 
+        // AdKdcIssued
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from AdKdcIssued init to SEQ
         // --------------------------------------------------------------------------------------------
         // AD-KDCIssued            ::= SEQUENCE {
-        super.transitions[AdKDCIssuedStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.START_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new AdKdcIssuedInit() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_SEQ_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_AD_CHECKSUM_TAG] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_SEQ_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE, KerberosConstants.AD_KDC_ISSUED_AD_CHECKSUM_TAG,
-            new StoreChecksum() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_I_REALM_TAG] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_TAG_STATE, KerberosConstants.AD_KDC_ISSUED_I_REALM_TAG,
-            new CheckNotNullLength() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE, KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG,
-            new StoreISName() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_ELEMENTS_TAG_STATE, KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG,
-            new StoreElements() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_TAG_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE, UniversalTag.GENERAL_STRING.getValue(),
-            new StoreIRealm() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE, KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG,
-            new StoreISName() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_ELEMENTS_TAG_STATE, KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG,
-            new StoreElements() );
-        
-        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG] = new GrammarTransition(
-            AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE, AdKDCIssuedStatesEnum.AD_KDC_ISSUED_ELEMENTS_TAG_STATE, KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG,
-            new StoreElements() );
+        super.transitions[AdKDCIssuedStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.START_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new AdKdcIssuedInit() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_SEQ_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_AD_CHECKSUM_TAG] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_SEQ_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE,
+                KerberosConstants.AD_KDC_ISSUED_AD_CHECKSUM_TAG,
+                new StoreChecksum() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_I_REALM_TAG] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_TAG_STATE,
+                KerberosConstants.AD_KDC_ISSUED_I_REALM_TAG,
+                new CheckNotNullLength<AdKdcIssuedContainer>() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE,
+                KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG,
+                new StoreISName() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_ELEMENTS_TAG_STATE,
+                KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG,
+                new StoreElements() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_TAG_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE,
+                UniversalTag.GENERAL_STRING.getValue(),
+                new StoreIRealm() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE,
+                KerberosConstants.AD_KDC_ISSUED_I_SNAME_TAG,
+                new StoreISName() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_REALM_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_ELEMENTS_TAG_STATE,
+                KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG,
+                new StoreElements() );
+
+        super.transitions[AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE.ordinal()][KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG] =
+            new GrammarTransition<AdKdcIssuedContainer>(
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_I_SNAME_TAG_STATE,
+                AdKDCIssuedStatesEnum.AD_KDC_ISSUED_ELEMENTS_TAG_STATE,
+                KerberosConstants.AD_KDC_ISSUED_ELEMENTS_TAG,
+                new StoreElements() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the AdKdcIssued Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<AdKdcIssuedContainer> getInstance()
     {
         return instance;
     }



Mime
View raw message