directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1068124 [4/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/adKdcIssued/AdKDCIssuedStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/AdKDCIssuedStatesEnum.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/AdKDCIssuedStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/AdKDCIssuedStatesEnum.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;
 
@@ -27,22 +27,22 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the AdKDCIssued grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum AdKDCIssuedStatesEnum implements States
 {
     // Start
     START_STATE,                          // 0
-    
+
     // ----- AdKDCIssued message --------------------------------------
     AD_KDC_ISSUED_SEQ_STATE,              // 1
-    
+
     AD_KDC_ISSUED_AD_CHECKSUM_TAG_STATE,  // 2
-    
+
     AD_KDC_ISSUED_I_REALM_TAG_STATE,      // 3
     AD_KDC_ISSUED_I_REALM_STATE,          // 4
-    
+
     AD_KDC_ISSUED_I_SNAME_TAG_STATE,      // 5
 
     AD_KDC_ISSUED_ELEMENTS_TAG_STATE,     // 6
@@ -50,10 +50,10 @@ public enum AdKDCIssuedStatesEnum implem
     // End
     LAST_AD_KDC_ISSUED_STATE;             // 7
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -65,11 +65,11 @@ public enum AdKDCIssuedStatesEnum implem
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<AdKdcIssuedContainer> grammar )
     {
         if ( grammar instanceof AdKDCIssuedGrammar )
         {
@@ -84,7 +84,7 @@ public enum AdKDCIssuedStatesEnum implem
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -93,7 +93,7 @@ public enum AdKDCIssuedStatesEnum implem
         return ( ( state == LAST_AD_KDC_ISSUED_STATE.ordinal() ) ? "AD_KDC_ISSUED_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -101,8 +101,8 @@ public enum AdKDCIssuedStatesEnum implem
     {
         return this == LAST_AD_KDC_ISSUED_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/AdKdcIssuedInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/AdKdcIssuedInit.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/actions/AdKdcIssuedInit.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/AdKdcIssuedInit.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.adKdcIssued.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-KDCIssued object
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AdKdcIssuedInit extends GrammarAction
+public class AdKdcIssuedInit extends GrammarAction<AdKdcIssuedContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AdKdcIssuedInit.class );
@@ -57,10 +56,8 @@ public class AdKdcIssuedInit extends Gra
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( AdKdcIssuedContainer adKdcIssuedContainer ) throws DecoderException
     {
-        AdKdcIssuedContainer adKdcIssuedContainer = ( AdKdcIssuedContainer ) container;
-
         TLV tlv = adKdcIssuedContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -71,10 +68,10 @@ public class AdKdcIssuedInit extends Gra
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         AdKdcIssued adKdcIssued = new AdKdcIssued();
         adKdcIssuedContainer.setAdKdcIssued( adKdcIssued );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "AdKdcIssued created" );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreChecksum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreChecksum.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/actions/StoreChecksum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreChecksum.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.adKdcIssued.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadCheckSum;
 import org.apache.directory.shared.kerberos.codec.adKdcIssued.AdKdcIssuedContainer;
 import org.apache.directory.shared.kerberos.components.Checksum;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the AD-KDCIssued cksum
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreChecksum extends AbstractReadCheckSum
+public class StoreChecksum extends AbstractReadCheckSum<AdKdcIssuedContainer>
 {
     /**
      * Instantiates a new StoreChecksum action.
@@ -46,9 +45,8 @@ public class StoreChecksum extends Abstr
      * {@inheritDoc}
      */
     @Override
-    protected void setChecksum( Checksum checksum, Asn1Container container )
+    protected void setChecksum( Checksum checksum, AdKdcIssuedContainer adKdcIssuedContainer )
     {
-        AdKdcIssuedContainer adKdcIssuedContainer = ( AdKdcIssuedContainer ) container;
         adKdcIssuedContainer.getAdKdcIssued().setAdChecksum( checksum );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreElements.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/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/adKdcIssued/actions/StoreElements.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/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.adKdcIssued.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.adKdcIssued.AdKdcIssuedContainer;
 import org.apache.directory.shared.kerberos.components.AuthorizationData;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to store the AD-KDCIssued 'elements' value
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreElements extends AbstractReadAuthorizationData
+public class StoreElements extends AbstractReadAuthorizationData<AdKdcIssuedContainer>
 {
     /**
      * 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, AdKdcIssuedContainer adKdcIssuedContainer )
     {
-        AdKdcIssuedContainer adKdcIssuedContainer = ( AdKdcIssuedContainer ) container;
         adKdcIssuedContainer.getAdKdcIssued().setElements( authorizationData );
         adKdcIssuedContainer.setGrammarEndAllowed( true );
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreIRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreIRealm.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/actions/StoreIRealm.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreIRealm.java Mon Feb  7 20:49:04 2011
@@ -6,31 +6,30 @@
  *  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.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadRealm;
 import org.apache.directory.shared.kerberos.codec.adKdcIssued.AdKdcIssuedContainer;
 
 
 /**
  * The action used to set the i-realm
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreIRealm extends AbstractReadRealm
+public class StoreIRealm extends AbstractReadRealm<AdKdcIssuedContainer>
 {
     /**
      * Instantiates a new StoreIRealm action.
@@ -45,9 +44,8 @@ public class StoreIRealm extends Abstrac
      * {@inheritDoc}
      */
     @Override
-    protected void setRealm( String realm, Asn1Container container )
+    protected void setRealm( String realm, AdKdcIssuedContainer adKdcIssuedContainer )
     {
-        AdKdcIssuedContainer adKdcIssuedContainer = ( AdKdcIssuedContainer ) container;
         adKdcIssuedContainer.getAdKdcIssued().setIRealm( realm );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreISName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreISName.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/actions/StoreISName.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/adKdcIssued/actions/StoreISName.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.adKdcIssued.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadPrincipalName;
 import org.apache.directory.shared.kerberos.codec.adKdcIssued.AdKdcIssuedContainer;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the AD-KDCIssued i-sName
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreISName extends AbstractReadPrincipalName
+public class StoreISName extends AbstractReadPrincipalName<AdKdcIssuedContainer>
 {
     /**
      * Instantiates a new StoreISName action.
@@ -46,9 +45,8 @@ public class StoreISName extends Abstrac
      * {@inheritDoc}
      */
     @Override
-    protected void setPrincipalName( PrincipalName principalName, Asn1Container container )
+    protected void setPrincipalName( PrincipalName principalName, AdKdcIssuedContainer adKdcIssuedContainer )
     {
-        AdKdcIssuedContainer adKdcIssuedContainer = ( AdKdcIssuedContainer ) container;
         adKdcIssuedContainer.getAdKdcIssued().setISName( principalName );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepGrammar.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.apRep;
 
 
+import org.apache.directory.shared.asn1.actions.CheckNotNullLength;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
 import org.apache.directory.shared.asn1.ber.grammar.Grammar;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarTransition;
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
-import org.apache.directory.shared.asn1.actions.CheckNotNullLength;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.codec.apRep.actions.ApRepInit;
 import org.apache.directory.shared.kerberos.codec.apRep.actions.CheckMsgType;
@@ -38,10 +38,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the AP-REP 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 ApRepGrammar extends AbstractGrammar
+public final class ApRepGrammar extends AbstractGrammar<ApRepContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( ApRepGrammar.class );
@@ -50,12 +50,13 @@ public final class ApRepGrammar extends 
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. ApRepGrammar is a singleton */
-    private static Grammar instance = new ApRepGrammar();
+    private static Grammar<ApRepContainer> instance = new ApRepGrammar();
 
 
     /**
      * Creates a new ApRepGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private ApRepGrammar()
     {
         setName( ApRepGrammar.class.getName() );
@@ -64,61 +65,79 @@ public final class ApRepGrammar extends 
         super.transitions = new GrammarTransition[ApRepStatesEnum.LAST_AP_REP_STATE.ordinal()][256];
 
         // ============================================================================================
-        // AP-REP 
+        // AP-REP
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from AP-REP init to AP-REP tag
         // --------------------------------------------------------------------------------------------
         // AP-REP          ::= [APPLICATION 15]
-        super.transitions[ApRepStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REP_TAG] = new GrammarTransition(
-            ApRepStatesEnum.START_STATE, ApRepStatesEnum.AP_REP_STATE, KerberosConstants.AP_REP_TAG,
-            new ApRepInit() );
-        
+        super.transitions[ApRepStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REP_TAG] =
+            new GrammarTransition<ApRepContainer>(
+                ApRepStatesEnum.START_STATE,
+                ApRepStatesEnum.AP_REP_STATE,
+                KerberosConstants.AP_REP_TAG,
+                new ApRepInit() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from AP-REP tag to AP-REP SEQUENCE
         // --------------------------------------------------------------------------------------------
         // AP-REP          ::= [APPLICATION 15] SEQUENCE OF {
-        super.transitions[ApRepStatesEnum.AP_REP_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            ApRepStatesEnum.AP_REP_STATE, ApRepStatesEnum.AP_REP_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
-        
+        super.transitions[ApRepStatesEnum.AP_REP_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<ApRepContainer>(
+                ApRepStatesEnum.AP_REP_STATE,
+                ApRepStatesEnum.AP_REP_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<ApRepContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from AP-REP SEQUENCE to pvno tag
         // --------------------------------------------------------------------------------------------
         // AP-REP          ::= [APPLICATION 15] SEQUENCE OF {
         //        pvno            [0]
-        super.transitions[ApRepStatesEnum.AP_REP_SEQ_STATE.ordinal()][KerberosConstants.AP_REP_PVNO_TAG] = new GrammarTransition(
-            ApRepStatesEnum.AP_REP_SEQ_STATE, ApRepStatesEnum.AP_REP_PVNO_TAG_STATE, KerberosConstants.AP_REP_PVNO_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[ApRepStatesEnum.AP_REP_SEQ_STATE.ordinal()][KerberosConstants.AP_REP_PVNO_TAG] =
+            new GrammarTransition<ApRepContainer>(
+                ApRepStatesEnum.AP_REP_SEQ_STATE,
+                ApRepStatesEnum.AP_REP_PVNO_TAG_STATE,
+                KerberosConstants.AP_REP_PVNO_TAG,
+                new CheckNotNullLength<ApRepContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno tag to pvno value
         // --------------------------------------------------------------------------------------------
         // AP-REP          ::= [APPLICATION 15] SEQUENCE OF {
         //        pvno            [0] INTEGER (5),
-        super.transitions[ApRepStatesEnum.AP_REP_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            ApRepStatesEnum.AP_REP_PVNO_TAG_STATE, ApRepStatesEnum.AP_REP_PVNO_STATE, UniversalTag.INTEGER.getValue(),
-            new StorePvno() );
-        
+        super.transitions[ApRepStatesEnum.AP_REP_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<ApRepContainer>(
+                ApRepStatesEnum.AP_REP_PVNO_TAG_STATE,
+                ApRepStatesEnum.AP_REP_PVNO_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StorePvno() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno value to msg-type tag
         // --------------------------------------------------------------------------------------------
         // AP-REP          ::= [APPLICATION 15] SEQUENCE OF {
         //        ...
         //        msg-type        [1]
-        super.transitions[ApRepStatesEnum.AP_REP_PVNO_STATE.ordinal()][KerberosConstants.AP_REP_MSG_TYPE_TAG] = new GrammarTransition(
-            ApRepStatesEnum.AP_REP_PVNO_STATE, ApRepStatesEnum.AP_REP_MSG_TYPE_TAG_STATE, KerberosConstants.AP_REP_MSG_TYPE_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[ApRepStatesEnum.AP_REP_PVNO_STATE.ordinal()][KerberosConstants.AP_REP_MSG_TYPE_TAG] =
+            new GrammarTransition<ApRepContainer>(
+                ApRepStatesEnum.AP_REP_PVNO_STATE,
+                ApRepStatesEnum.AP_REP_MSG_TYPE_TAG_STATE,
+                KerberosConstants.AP_REP_MSG_TYPE_TAG,
+                new CheckNotNullLength<ApRepContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type tag to msg-type value
         // --------------------------------------------------------------------------------------------
         // AP-REP          ::= [APPLICATION 15] SEQUENCE OF {
         //        ...
         //        msg-type        [1] INTEGER (15),
-        super.transitions[ApRepStatesEnum.AP_REP_MSG_TYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            ApRepStatesEnum.AP_REP_MSG_TYPE_TAG_STATE, ApRepStatesEnum.AP_REP_MSG_TYPE_STATE, UniversalTag.INTEGER.getValue(),
-            new CheckMsgType() );
+        super.transitions[ApRepStatesEnum.AP_REP_MSG_TYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<ApRepContainer>(
+                ApRepStatesEnum.AP_REP_MSG_TYPE_TAG_STATE,
+                ApRepStatesEnum.AP_REP_MSG_TYPE_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new CheckMsgType() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type value to enc-part
@@ -127,18 +146,21 @@ public final class ApRepGrammar extends 
         //        ...
         //        enc-part        [2] EncryptedData -- EncAPRepPart
         // }
-        super.transitions[ApRepStatesEnum.AP_REP_MSG_TYPE_STATE.ordinal()][KerberosConstants.AP_REP_ENC_PART_TAG] = new GrammarTransition(
-            ApRepStatesEnum.AP_REP_MSG_TYPE_STATE, ApRepStatesEnum.AP_REP_ENC_PART_STATE, KerberosConstants.AP_REP_ENC_PART_TAG,
-            new StoreEncPart() );
+        super.transitions[ApRepStatesEnum.AP_REP_MSG_TYPE_STATE.ordinal()][KerberosConstants.AP_REP_ENC_PART_TAG] =
+            new GrammarTransition<ApRepContainer>(
+                ApRepStatesEnum.AP_REP_MSG_TYPE_STATE,
+                ApRepStatesEnum.AP_REP_ENC_PART_STATE,
+                KerberosConstants.AP_REP_ENC_PART_TAG,
+                new StoreEncPart() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the AP-REP Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<ApRepContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/ApRepStatesEnum.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.apRep;
 
@@ -27,33 +27,33 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the AP-REP grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum ApRepStatesEnum implements States
 {
     // Start
     START_STATE,                            // 0
-    
+
     // ----- AP-REP message --------------------------------------
     AP_REP_STATE,                           // 1
     AP_REP_SEQ_STATE,                       // 2
-    
+
     AP_REP_PVNO_TAG_STATE,                  // 3
     AP_REP_PVNO_STATE,                      // 4
-    
+
     AP_REP_MSG_TYPE_TAG_STATE,              // 5
     AP_REP_MSG_TYPE_STATE,                  // 6
-    
+
     AP_REP_ENC_PART_STATE,                  // 7
-    
+
     // End
     LAST_AP_REP_STATE;                      // 8
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -65,11 +65,11 @@ public enum ApRepStatesEnum implements S
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<ApRepContainer> grammar )
     {
         if ( grammar instanceof ApRepGrammar )
         {
@@ -84,7 +84,7 @@ public enum ApRepStatesEnum implements S
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -93,7 +93,7 @@ public enum ApRepStatesEnum implements S
         return ( ( state == LAST_AP_REP_STATE.ordinal() ) ? "AP_REP_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -101,8 +101,8 @@ public enum ApRepStatesEnum implements S
     {
         return this == LAST_AP_REP_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/ApRepInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/ApRepInit.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/ApRepInit.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/ApRepInit.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.apRep.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 AP-REP object
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ApRepInit extends GrammarAction
+public class ApRepInit extends GrammarAction<ApRepContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( ApRepInit.class );
@@ -53,10 +52,8 @@ public class ApRepInit extends GrammarAc
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( ApRepContainer apRepContainer ) throws DecoderException
     {
-        ApRepContainer apRepContainer = ( ApRepContainer ) container;
-
         TLV tlv = apRepContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -67,10 +64,10 @@ public class ApRepInit extends GrammarAc
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // Create the AP-REP now
         ApRep apRep = new ApRep();
-        
+
         apRepContainer.setApRep( apRep );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/CheckMsgType.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/CheckMsgType.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/CheckMsgType.java Mon Feb  7 20:49:04 2011
@@ -6,30 +6,31 @@
  *  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.apRep.actions;
 
 
 import org.apache.directory.shared.kerberos.KerberosMessageType;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadMsgType;
+import org.apache.directory.shared.kerberos.codec.apRep.ApRepContainer;
 
 
 /**
  * The action used to store the AP-REP msg-type
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CheckMsgType extends AbstractReadMsgType
+public class CheckMsgType extends AbstractReadMsgType<ApRepContainer>
 {
     /**
      * Instantiates a new CheckMsgType action.

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StoreEncPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StoreEncPart.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StoreEncPart.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StoreEncPart.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.apRep.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadEncryptedPart;
 import org.apache.directory.shared.kerberos.codec.apRep.ApRepContainer;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the AP-REP enc-part
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreEncPart extends AbstractReadEncryptedPart
+public class StoreEncPart extends AbstractReadEncryptedPart<ApRepContainer>
 {
 
     /**
@@ -47,11 +46,10 @@ public class StoreEncPart extends Abstra
      * {@inheritDoc}
      */
     @Override
-    protected void setEncryptedData( EncryptedData encryptedData, Asn1Container container )
+    protected void setEncryptedData( EncryptedData encryptedData, ApRepContainer apRepContainer )
     {
-        ApRepContainer apRepContainer = ( ApRepContainer ) container;
         apRepContainer.getApRep().setEncPart( encryptedData );
 
-        container.setGrammarEndAllowed( true );
+        apRepContainer.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StorePvno.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StorePvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apRep/actions/StorePvno.java Mon Feb  7 20:49:04 2011
@@ -6,31 +6,30 @@
  *  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.apRep.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadPvno;
 import org.apache.directory.shared.kerberos.codec.apRep.ApRepContainer;
 
 
 /**
  * The action used to set the AP-REP VNO
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StorePvno extends AbstractReadPvno
+public class StorePvno extends AbstractReadPvno<ApRepContainer>
 {
     /**
      * Instantiates a new StorePvno action.
@@ -45,9 +44,8 @@ public class StorePvno extends AbstractR
      * {@inheritDoc}
      */
     @Override
-    protected void setPvno( int pvno, Asn1Container container )
+    protected void setPvno( int pvno, ApRepContainer apRepContainer )
     {
-        ApRepContainer apRepContainer = ( ApRepContainer ) container;
         apRepContainer.getApRep().setProtocolVersionNumber( pvno );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqGrammar.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.apReq;
 
 
+import org.apache.directory.shared.asn1.actions.CheckNotNullLength;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
 import org.apache.directory.shared.asn1.ber.grammar.Grammar;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarTransition;
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
-import org.apache.directory.shared.asn1.actions.CheckNotNullLength;
 import org.apache.directory.shared.kerberos.KerberosConstants;
 import org.apache.directory.shared.kerberos.codec.apReq.actions.ApReqInit;
 import org.apache.directory.shared.kerberos.codec.apReq.actions.CheckMsgType;
@@ -40,10 +40,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the AP-REQ 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 ApReqGrammar extends AbstractGrammar
+public final class ApReqGrammar extends AbstractGrammar<ApReqContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( ApReqGrammar.class );
@@ -52,12 +52,13 @@ public final class ApReqGrammar extends 
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. ApReqGrammar is a singleton */
-    private static Grammar instance = new ApReqGrammar();
+    private static Grammar<ApReqContainer> instance = new ApReqGrammar();
 
 
     /**
      * Creates a new ApReqGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private ApReqGrammar()
     {
         setName( ApReqGrammar.class.getName() );
@@ -66,92 +67,119 @@ public final class ApReqGrammar extends 
         super.transitions = new GrammarTransition[ApReqStatesEnum.LAST_AP_REQ_STATE.ordinal()][256];
 
         // ============================================================================================
-        // AP-REQ 
+        // AP-REQ
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from AP-REQ init to AP-REQ tag
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14]
-        super.transitions[ApReqStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REQ_TAG] = new GrammarTransition(
-            ApReqStatesEnum.START_STATE, ApReqStatesEnum.AP_REQ_STATE, KerberosConstants.AP_REQ_TAG,
-            new ApReqInit() );
+        super.transitions[ApReqStatesEnum.START_STATE.ordinal()][KerberosConstants.AP_REQ_TAG] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.START_STATE,
+                ApReqStatesEnum.AP_REQ_STATE,
+                KerberosConstants.AP_REQ_TAG,
+                new ApReqInit() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from AP-REQ tag to AP-REQ SEQ {
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
-        super.transitions[ApReqStatesEnum.AP_REQ_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_STATE, ApReqStatesEnum.AP_REQ_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_STATE,
+                ApReqStatesEnum.AP_REQ_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<ApReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from AP-REQ SEQ to PVNO tag
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
         //         pvno            [0]
-        super.transitions[ApReqStatesEnum.AP_REQ_SEQ_STATE.ordinal()][KerberosConstants.AP_REQ_PVNO_TAG] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_SEQ_STATE, ApReqStatesEnum.AP_REQ_PVNO_TAG_STATE, KerberosConstants.AP_REQ_PVNO_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_SEQ_STATE.ordinal()][KerberosConstants.AP_REQ_PVNO_TAG] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_SEQ_STATE,
+                ApReqStatesEnum.AP_REQ_PVNO_TAG_STATE,
+                KerberosConstants.AP_REQ_PVNO_TAG,
+                new CheckNotNullLength<ApReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from PVNO tag to PVNO value
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
         //         pvno            [0] INTEGER (5),
-        super.transitions[ApReqStatesEnum.AP_REQ_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_PVNO_TAG_STATE, ApReqStatesEnum.AP_REQ_PVNO_STATE, UniversalTag.INTEGER.getValue(),
-            new StorePvno() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_PVNO_TAG_STATE,
+                ApReqStatesEnum.AP_REQ_PVNO_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StorePvno() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from PVNO value to msg-type tag
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
         //         ...
         //         msg-type        [1]
-        super.transitions[ApReqStatesEnum.AP_REQ_PVNO_STATE.ordinal()][KerberosConstants.AP_REQ_MSG_TYPE_TAG] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_PVNO_STATE, ApReqStatesEnum.AP_REQ_MSG_TYPE_TAG_STATE, KerberosConstants.AP_REQ_MSG_TYPE_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_PVNO_STATE.ordinal()][KerberosConstants.AP_REQ_MSG_TYPE_TAG] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_PVNO_STATE,
+                ApReqStatesEnum.AP_REQ_MSG_TYPE_TAG_STATE,
+                KerberosConstants.AP_REQ_MSG_TYPE_TAG,
+                new CheckNotNullLength<ApReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type tag to msg-type value
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
         //         ...
         //         msg-type        [1] INTEGER (14),
-        super.transitions[ApReqStatesEnum.AP_REQ_MSG_TYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_MSG_TYPE_TAG_STATE, ApReqStatesEnum.AP_REQ_MSG_TYPE_STATE, UniversalTag.INTEGER.getValue(),
-            new CheckMsgType() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_MSG_TYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_MSG_TYPE_TAG_STATE,
+                ApReqStatesEnum.AP_REQ_MSG_TYPE_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new CheckMsgType() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type value to ap-options tag
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
         //         ...
         //         ap-options      [2]
-        super.transitions[ApReqStatesEnum.AP_REQ_MSG_TYPE_STATE.ordinal()][KerberosConstants.AP_REQ_AP_OPTIONS_TAG] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_MSG_TYPE_STATE, ApReqStatesEnum.AP_REQ_AP_OPTIONS_TAG_STATE, KerberosConstants.AP_REQ_AP_OPTIONS_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_MSG_TYPE_STATE.ordinal()][KerberosConstants.AP_REQ_AP_OPTIONS_TAG] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_MSG_TYPE_STATE,
+                ApReqStatesEnum.AP_REQ_AP_OPTIONS_TAG_STATE,
+                KerberosConstants.AP_REQ_AP_OPTIONS_TAG,
+                new CheckNotNullLength<ApReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ap-options tag to ap-options value
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
         //         ...
         //         ap-options      [2] APOptions,
-        super.transitions[ApReqStatesEnum.AP_REQ_AP_OPTIONS_TAG_STATE.ordinal()][UniversalTag.BIT_STRING.getValue()] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_AP_OPTIONS_TAG_STATE, ApReqStatesEnum.AP_REQ_AP_OPTIONS_STATE, UniversalTag.BIT_STRING.getValue(),
-            new StoreApOptions() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_AP_OPTIONS_TAG_STATE.ordinal()][UniversalTag.BIT_STRING.getValue()] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_AP_OPTIONS_TAG_STATE,
+                ApReqStatesEnum.AP_REQ_AP_OPTIONS_STATE,
+                UniversalTag.BIT_STRING.getValue(),
+                new StoreApOptions() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ap-options value to ticket
         // --------------------------------------------------------------------------------------------
         // AP-REQ          ::= [APPLICATION 14] SEQUENCE
         //         ...
         //         ticket          [3] Ticket,
-        super.transitions[ApReqStatesEnum.AP_REQ_AP_OPTIONS_STATE.ordinal()][KerberosConstants.AP_REQ_TICKET_TAG] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_AP_OPTIONS_STATE, ApReqStatesEnum.AP_REQ_TICKET_STATE, KerberosConstants.AP_REQ_TICKET_TAG,
-            new StoreTicket() );
-        
+        super.transitions[ApReqStatesEnum.AP_REQ_AP_OPTIONS_STATE.ordinal()][KerberosConstants.AP_REQ_TICKET_TAG] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_AP_OPTIONS_STATE,
+                ApReqStatesEnum.AP_REQ_TICKET_STATE,
+                KerberosConstants.AP_REQ_TICKET_TAG,
+                new StoreTicket() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ticket to authenticator
         // --------------------------------------------------------------------------------------------
@@ -159,18 +187,21 @@ public final class ApReqGrammar extends 
         //         ...
         //         authenticator   [4] <EncryptedData> -- Authenticator
         // }
-        super.transitions[ApReqStatesEnum.AP_REQ_TICKET_STATE.ordinal()][KerberosConstants.AP_REQ_AUTHENTICATOR_TAG] = new GrammarTransition(
-            ApReqStatesEnum.AP_REQ_TICKET_STATE, ApReqStatesEnum.LAST_AP_REQ_STATE, KerberosConstants.AP_REQ_AUTHENTICATOR_TAG,
-            new StoreAuthenticator() );
+        super.transitions[ApReqStatesEnum.AP_REQ_TICKET_STATE.ordinal()][KerberosConstants.AP_REQ_AUTHENTICATOR_TAG] =
+            new GrammarTransition<ApReqContainer>(
+                ApReqStatesEnum.AP_REQ_TICKET_STATE,
+                ApReqStatesEnum.LAST_AP_REQ_STATE,
+                KerberosConstants.AP_REQ_AUTHENTICATOR_TAG,
+                new StoreAuthenticator() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the AP-REQ Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<ApReqContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/ApReqStatesEnum.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.apReq;
 
@@ -27,38 +27,38 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the AP-REQ grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum ApReqStatesEnum implements States
 {
     // Start
     START_STATE,                            // 0
-    
+
     // ----- AP-REQ message --------------------------------------
     AP_REQ_STATE,                           // 1
     AP_REQ_SEQ_STATE,                       // 2
-    
+
     AP_REQ_PVNO_TAG_STATE,                  // 3
     AP_REQ_PVNO_STATE,                      // 4
-    
+
     AP_REQ_MSG_TYPE_TAG_STATE,              // 5
     AP_REQ_MSG_TYPE_STATE,                  // 6
-    
+
     AP_REQ_AP_OPTIONS_TAG_STATE,            // 7
     AP_REQ_AP_OPTIONS_STATE,                // 8
 
     AP_REQ_TICKET_STATE,                    // 9
 
     AP_REQ_AUTHENTICATOR_STATE,             // 10
-    
+
     // End
     LAST_AP_REQ_STATE;                      // 11
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -70,11 +70,11 @@ public enum ApReqStatesEnum implements S
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<ApReqContainer> grammar )
     {
         if ( grammar instanceof ApReqGrammar )
         {
@@ -89,7 +89,7 @@ public enum ApReqStatesEnum implements S
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -98,7 +98,7 @@ public enum ApReqStatesEnum implements S
         return ( ( state == LAST_AP_REQ_STATE.ordinal() ) ? "AP_REQ_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -106,8 +106,8 @@ public enum ApReqStatesEnum implements S
     {
         return this == LAST_AP_REQ_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/ApReqInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/ApReqInit.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/ApReqInit.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/ApReqInit.java Mon Feb  7 20:49:04 2011
@@ -6,24 +6,23 @@
  *  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.apReq.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.asn1.DecoderException;
 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.apReq.ApReqContainer;
 import org.apache.directory.shared.kerberos.messages.ApReq;
@@ -33,10 +32,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to initialize the AP-REQ object
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ApReqInit extends GrammarAction
+public class ApReqInit extends GrammarAction<ApReqContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( ApReqInit.class );
@@ -53,10 +52,8 @@ public class ApReqInit extends GrammarAc
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( ApReqContainer apReqContainer ) throws DecoderException
     {
-        ApReqContainer apReqContainer = ( ApReqContainer ) container;
-
         TLV tlv = apReqContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -67,10 +64,10 @@ public class ApReqInit extends GrammarAc
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // Create the AP-REQ now
         ApReq apReq = new ApReq();
-        
+
         apReqContainer.setApReq( apReq );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/CheckMsgType.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/CheckMsgType.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/CheckMsgType.java Mon Feb  7 20:49:04 2011
@@ -6,30 +6,31 @@
  *  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.apReq.actions;
 
 
 import org.apache.directory.shared.kerberos.KerberosMessageType;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadMsgType;
+import org.apache.directory.shared.kerberos.codec.apReq.ApReqContainer;
 
 
 /**
  * The action used to store the AP-REQ msg-type
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CheckMsgType extends AbstractReadMsgType
+public class CheckMsgType extends AbstractReadMsgType<ApReqContainer>
 {
     /**
      * Instantiates a new CheckMsgType action.

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreApOptions.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreApOptions.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreApOptions.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreApOptions.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.apReq.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;
@@ -34,10 +33,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to store the ApOptions
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreApOptions extends GrammarAction
+public class StoreApOptions extends GrammarAction<ApReqContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreApOptions.class );
@@ -58,10 +57,8 @@ public class StoreApOptions extends Gram
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( ApReqContainer apReqContainer ) throws DecoderException
     {
-        ApReqContainer apReqContainer = ( ApReqContainer ) container;
-
         TLV tlv = apReqContainer.getCurrentTLV();
 
         // The Length should not be null, and should be 5
@@ -72,12 +69,12 @@ public class StoreApOptions extends Gram
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         ApReq apReq = apReqContainer.getApReq();
         ApOptions apOptions = new ApOptions( tlv.getValue().getData() );
-        
+
         apReq.setApOptions( apOptions );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "APOptions : {}", apOptions );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreAuthenticator.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreAuthenticator.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreAuthenticator.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.apReq.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadEncryptedPart;
 import org.apache.directory.shared.kerberos.codec.apReq.ApReqContainer;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the AP-REQ authenticator
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreAuthenticator extends AbstractReadEncryptedPart
+public class StoreAuthenticator extends AbstractReadEncryptedPart<ApReqContainer>
 {
     /**
      * Instantiates a new StoreAuthenticator action.
@@ -46,11 +45,10 @@ public class StoreAuthenticator extends 
      * {@inheritDoc}
      */
     @Override
-    protected void setEncryptedData( EncryptedData encryptedData, Asn1Container container )
+    protected void setEncryptedData( EncryptedData encryptedData, ApReqContainer apReqContainer )
     {
-        ApReqContainer apReqContainer = ( ApReqContainer ) container;
         apReqContainer.getApReq().setAuthenticator( encryptedData );
 
-        container.setGrammarEndAllowed( true );
+        apReqContainer.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StorePvno.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StorePvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StorePvno.java Mon Feb  7 20:49:04 2011
@@ -6,31 +6,30 @@
  *  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.apReq.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadPvno;
 import org.apache.directory.shared.kerberos.codec.apReq.ApReqContainer;
 
 
 /**
  * The action used to set the AP-REQ VNO
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StorePvno extends AbstractReadPvno
+public class StorePvno extends AbstractReadPvno<ApReqContainer>
 {
     /**
      * Instantiates a new StorePvno action.
@@ -45,9 +44,8 @@ public class StorePvno extends AbstractR
      * {@inheritDoc}
      */
     @Override
-    protected void setPvno( int pvno, Asn1Container container )
+    protected void setPvno( int pvno, ApReqContainer apReqContainer )
     {
-        ApReqContainer apReqContainer = ( ApReqContainer ) container;
         apReqContainer.getApReq().setProtocolVersionNumber( pvno );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreTicket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreTicket.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreTicket.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/apReq/actions/StoreTicket.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.apReq.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;
@@ -36,10 +35,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to store the Ticket
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreTicket extends GrammarAction
+public class StoreTicket extends GrammarAction<ApReqContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreTicket.class );
@@ -59,14 +58,12 @@ public class StoreTicket extends Grammar
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( ApReqContainer apReqContainer ) throws DecoderException
     {
-        ApReqContainer apReqContainer = ( ApReqContainer ) container;
-
         TLV tlv = apReqContainer.getCurrentTLV();
 
         // The Length can't be null
-        if ( tlv.getLength() == 0 ) 
+        if ( tlv.getLength() == 0 )
         {
             LOG.error( I18n.err( I18n.ERR_04066 ) );
 
@@ -76,30 +73,30 @@ public class StoreTicket extends Grammar
 
         // Now, let's decode the Ticket
         Asn1Decoder ticketDecoder = new Asn1Decoder();
-        
-        TicketContainer ticketContainer = new TicketContainer( container.getStream() );
+
+        TicketContainer ticketContainer = new TicketContainer( apReqContainer.getStream() );
 
         // Decode the Ticket PDU
         try
         {
-            ticketDecoder.decode( container.getStream(), ticketContainer );
+            ticketDecoder.decode( apReqContainer.getStream(), ticketContainer );
         }
         catch ( DecoderException de )
         {
             throw de;
         }
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.updateParent();
+        apReqContainer.updateParent();
 
         // Store the Ticket in the container
         Ticket ticket = ticketContainer.getTicket();
         ApReq apReq = apReqContainer.getApReq();
         apReq.setTicket( ticket );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "Stored ticket:  {}", ticket );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepGrammar.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.asRep;
 
@@ -33,10 +33,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the AS-REP 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 AsRepGrammar extends AbstractGrammar
+public final class AsRepGrammar extends AbstractGrammar<AsRepContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( AsRepGrammar.class );
@@ -45,12 +45,13 @@ public final class AsRepGrammar extends 
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. AsRepGrammar is a singleton */
-    private static Grammar instance = new AsRepGrammar();
+    private static Grammar<AsRepContainer> instance = new AsRepGrammar();
 
 
     /**
      * Creates a new AsRepGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private AsRepGrammar()
     {
         setName( AsRepGrammar.class.getName() );
@@ -59,24 +60,27 @@ public final class AsRepGrammar extends 
         super.transitions = new GrammarTransition[AsRepStatesEnum.LAST_AS_REP_STATE.ordinal()][256];
 
         // ============================================================================================
-        // AS-REP 
+        // AS-REP
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from AS-REP init to KDC-REP
         // --------------------------------------------------------------------------------------------
         // AS-REP          ::= [APPLICATION 11] KDC-REP
-        super.transitions[AsRepStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REP_TAG] = new GrammarTransition(
-            AsRepStatesEnum.START_STATE, AsRepStatesEnum.AS_REP_STATE, KerberosConstants.AS_REP_TAG,
-            new StoreKdcRep() );
+        super.transitions[AsRepStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REP_TAG] =
+            new GrammarTransition<AsRepContainer>(
+                AsRepStatesEnum.START_STATE,
+                AsRepStatesEnum.AS_REP_STATE,
+                KerberosConstants.AS_REP_TAG,
+                new StoreKdcRep() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the AS-REP Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<AsRepContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/AsRepStatesEnum.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.asRep;
 
@@ -27,24 +27,24 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the AS-REP grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum AsRepStatesEnum implements States
 {
     // Start
     START_STATE,                            // 0
-    
+
     // ----- HostAddresses message --------------------------------------
     AS_REP_STATE,                           // 1
-    
+
     // End
     LAST_AS_REP_STATE;                      // 2
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -56,11 +56,11 @@ public enum AsRepStatesEnum implements S
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<AsRepContainer> grammar )
     {
         if ( grammar instanceof AsRepGrammar )
         {
@@ -75,7 +75,7 @@ public enum AsRepStatesEnum implements S
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -84,7 +84,7 @@ public enum AsRepStatesEnum implements S
         return ( ( state == LAST_AS_REP_STATE.ordinal() ) ? "AS_REP_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -92,8 +92,8 @@ public enum AsRepStatesEnum implements S
     {
         return this == LAST_AS_REP_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/actions/StoreKdcRep.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/actions/StoreKdcRep.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/actions/StoreKdcRep.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asRep/actions/StoreKdcRep.java Mon Feb  7 20:49:04 2011
@@ -6,25 +6,24 @@
  *  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.asRep.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
+import org.apache.directory.shared.asn1.DecoderException;
 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.KerberosMessageType;
 import org.apache.directory.shared.kerberos.codec.asRep.AsRepContainer;
@@ -36,10 +35,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to add a KDC-REP object
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreKdcRep extends GrammarAction
+public class StoreKdcRep extends GrammarAction<AsRepContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreKdcRep.class );
@@ -60,10 +59,8 @@ public class StoreKdcRep extends Grammar
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( AsRepContainer asRepContainer ) throws DecoderException
     {
-        AsRepContainer asRepContainer = ( AsRepContainer ) container;
-
         TLV tlv = asRepContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -74,44 +71,44 @@ public class StoreKdcRep extends Grammar
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // Now, let's decode the KDC-REP
         Asn1Decoder kdcRepDecoder = new Asn1Decoder();
-        
-        KdcRepContainer kdcRepContainer = new KdcRepContainer( container.getStream() );
-        
+
+        KdcRepContainer kdcRepContainer = new KdcRepContainer( asRepContainer.getStream() );
+
         // Store the created AS-REP object into the KDC-REP container
         AsRep asRep = new AsRep();
         kdcRepContainer.setKdcRep( asRep );
-        
+
         // Decode the KDC_REP PDU
         try
         {
-            kdcRepDecoder.decode( container.getStream(), kdcRepContainer );
+            kdcRepDecoder.decode( asRepContainer.getStream(), kdcRepContainer );
         }
         catch ( DecoderException de )
         {
             throw de;
         }
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.updateParent();
-        
+        asRepContainer.updateParent();
+
         if ( asRep.getMessageType() != KerberosMessageType.AS_REP )
         {
             throw new DecoderException( "Bad message type" );
         }
-        
+
         asRepContainer.setAsRep( asRep );
 
         if ( IS_DEBUG )
         {
             LOG.debug( "AS-REP : {}", asRep );
         }
-        
-        container.setGrammarEndAllowed( true );
+
+        asRepContainer.setGrammarEndAllowed( true );
     }
 }



Mime
View raw message