directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1068124 [15/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/d...
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/krbError/actions/StoreEText.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreEText.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.krbError.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.ber.tlv.Value;
-import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
 import org.apache.directory.shared.kerberos.messages.KrbError;
@@ -35,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read the KrbError etext
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreEText extends GrammarAction
+public class StoreEText extends GrammarAction<KrbErrorContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreEText.class );
@@ -59,11 +58,9 @@ public class StoreEText extends GrammarA
     /**
      * {@inheritDoc}
      */
-    public final void action( Asn1Container container ) throws DecoderException
+    public final void action( KrbErrorContainer krbErrorContainer ) throws DecoderException
     {
-        KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        
-        TLV tlv = krbErrContainer.getCurrentTLV();
+        TLV tlv = krbErrorContainer.getCurrentTLV();
 
         // The Length should not be null
         if ( tlv.getLength() == 0 )
@@ -73,19 +70,19 @@ public class StoreEText extends GrammarA
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // The value is the realm
         Value value = tlv.getValue();
         String eText = Strings.utf8ToString(value.getData());
 
-        KrbError krbError = krbErrContainer.getKrbError();
+        KrbError krbError = krbErrorContainer.getKrbError();
         krbError.setEText( eText );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "eText: " + eText );
         }
-        
-        container.setGrammarEndAllowed( true );
+
+        krbErrorContainer.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreErrorCode.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.krbError.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.actions.AbstractReadInteger;
 import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
 import org.apache.directory.shared.kerberos.exceptions.ErrorType;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to store the error-code
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreErrorCode extends AbstractReadInteger
+public class StoreErrorCode extends AbstractReadInteger<KrbErrorContainer>
 {
 
     /**
@@ -47,12 +46,10 @@ public class StoreErrorCode extends Abst
      * {@inheritDoc}
      */
     @Override
-    protected void setIntegerValue( int value, Asn1Container container )
+    protected void setIntegerValue( int value, KrbErrorContainer krbErrorContainer )
     {
-        KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        
         ErrorType errorCode = ErrorType.getTypeByValue( value );
-        
-        krbErrContainer.getKrbError().setErrorCode( errorCode );
+
+        krbErrorContainer.getKrbError().setErrorCode( errorCode );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/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/krbError/actions/StorePvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/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.krbError.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.krbError.KrbErrorContainer;
 
 
 /**
  * The action used to store the PVNO
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StorePvno extends AbstractReadPvno
+public class StorePvno extends AbstractReadPvno<KrbErrorContainer>
 {
     /**
      * 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, KrbErrorContainer krbErrorContainer )
     {
-        KrbErrorContainer krbErrorContainer = ( KrbErrorContainer ) container;
         krbErrorContainer.getKrbError().setProtocolVersionNumber( pvno );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreRealm.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.krbError.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.krbError.KrbErrorContainer;
 
 
 /**
  * The action used to set the KrbError realm
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreRealm extends AbstractReadRealm
+public class StoreRealm extends AbstractReadRealm<KrbErrorContainer>
 {
     /**
      * Instantiates a new StoreRealm action.
@@ -45,9 +44,8 @@ public class StoreRealm extends Abstract
      * {@inheritDoc}
      */
     @Override
-    protected void setRealm( String realm, Asn1Container container )
+    protected void setRealm( String realm, KrbErrorContainer krbErrorContainer )
     {
-        KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setRealm( realm );
+        krbErrorContainer.getKrbError().setRealm( realm );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSName.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.krbError.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.krbError.KrbErrorContainer;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the KrbError sName
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreSName extends AbstractReadPrincipalName
+public class StoreSName extends AbstractReadPrincipalName<KrbErrorContainer>
 {
     /**
      * Instantiates a new StoreSName action.
@@ -46,10 +45,9 @@ public class StoreSName extends Abstract
      * {@inheritDoc}
      */
     @Override
-    protected void setPrincipalName( PrincipalName principalName, Asn1Container container )
+    protected void setPrincipalName( PrincipalName principalName, KrbErrorContainer krbErrorContainer )
     {
-        KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setSName( principalName );
-        container.setGrammarEndAllowed( true );
+        krbErrorContainer.getKrbError().setSName( principalName );
+        krbErrorContainer.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSTime.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.krbError.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.KerberosTime;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadKerberosTime;
 import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to store the stime KerberosTime
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreSTime extends AbstractReadKerberosTime
+public class StoreSTime extends AbstractReadKerberosTime<KrbErrorContainer>
 {
 
     /**
@@ -47,9 +46,8 @@ public class StoreSTime extends Abstract
      * {@inheritDoc}
      */
     @Override
-    protected void setKerberosTime( KerberosTime krbtime, Asn1Container container )
+    protected void setKerberosTime( KerberosTime krbtime, KrbErrorContainer krbErrorContainer )
     {
-        KrbErrorContainer krbErrContainer = ( KrbErrorContainer ) container;
-        krbErrContainer.getKrbError().setSTime( krbtime );
+        krbErrorContainer.getKrbError().setSTime( krbtime );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbError/actions/StoreSusec.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.krbError.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.actions.AbstractReadInteger;
 import org.apache.directory.shared.kerberos.codec.krbError.KrbErrorContainer;
 
 
 /**
  * The action used to store the susec
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreSusec extends AbstractReadInteger
+public class StoreSusec extends AbstractReadInteger<KrbErrorContainer>
 {
 
     /**
@@ -46,9 +45,8 @@ public class StoreSusec extends Abstract
      * {@inheritDoc}
      */
     @Override
-    protected void setIntegerValue( int value, Asn1Container container )
+    protected void setIntegerValue( int value, KrbErrorContainer krbErrorContainer )
     {
-        KrbErrorContainer krbErrorContainer = ( KrbErrorContainer ) container;
         krbErrorContainer.getKrbError().setSusec( value );
     }
 

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivGrammar.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.krbPriv;
 
 
+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.krbPriv.actions.CheckMsgType;
 import org.apache.directory.shared.kerberos.codec.krbPriv.actions.KrbPrivInit;
@@ -38,10 +38,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the KRB-PRIV 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 KrbPrivGrammar extends AbstractGrammar
+public final class KrbPrivGrammar extends AbstractGrammar<KrbPrivContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( KrbPrivGrammar.class );
@@ -50,12 +50,13 @@ public final class KrbPrivGrammar extend
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. KrbPrivGrammar is a singleton */
-    private static Grammar instance = new KrbPrivGrammar();
+    private static Grammar<KrbPrivContainer> instance = new KrbPrivGrammar();
 
 
     /**
      * Creates a new KrbPrivGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private KrbPrivGrammar()
     {
         setName( KrbPrivGrammar.class.getName() );
@@ -64,73 +65,94 @@ public final class KrbPrivGrammar extend
         super.transitions = new GrammarTransition[KrbPrivStatesEnum.LAST_KRB_PRIV_STATE.ordinal()][256];
 
         // ============================================================================================
-        // KRB_PRIV 
+        // KRB_PRIV
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from KrbPriv init to KrbPriv tag
         // --------------------------------------------------------------------------------------------
         // KRB_PRIV       ::= [APPLICATION 21]
-        super.transitions[KrbPrivStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_PRIV_TAG] = new GrammarTransition(
-            KrbPrivStatesEnum.START_STATE, KrbPrivStatesEnum.KRB_PRIV_TAG_STATE, KerberosConstants.KRB_PRIV_TAG,
-            new KrbPrivInit() );
-        
+        super.transitions[KrbPrivStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_PRIV_TAG] =
+            new GrammarTransition<KrbPrivContainer>(
+                KrbPrivStatesEnum.START_STATE,
+                KrbPrivStatesEnum.KRB_PRIV_TAG_STATE, KerberosConstants.KRB_PRIV_TAG,
+                new KrbPrivInit() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from KrbPriv tag to KrbPriv SEQ
         // --------------------------------------------------------------------------------------------
         // KRB_PRIV       ::= [APPLICATION 21] SEQUENCE {
-        super.transitions[KrbPrivStatesEnum.KRB_PRIV_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            KrbPrivStatesEnum.KRB_PRIV_TAG_STATE, KrbPrivStatesEnum.KRB_PRIV_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
+        super.transitions[KrbPrivStatesEnum.KRB_PRIV_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<KrbPrivContainer>(
+                KrbPrivStatesEnum.KRB_PRIV_TAG_STATE,
+                KrbPrivStatesEnum.KRB_PRIV_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<KrbPrivContainer>() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from KrbPriv SEQ to pvno tag
         // --------------------------------------------------------------------------------------------
         // KRB_PRIV         ::= SEQUENCE {
         //         pvno            [0]
-        super.transitions[KrbPrivStatesEnum.KRB_PRIV_SEQ_STATE.ordinal()][KerberosConstants.KRB_PRIV_PVNO_TAG] = new GrammarTransition(
-            KrbPrivStatesEnum.KRB_PRIV_SEQ_STATE, KrbPrivStatesEnum.KRB_PRIV_PVNO_TAG_STATE, KerberosConstants.KRB_PRIV_PVNO_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[KrbPrivStatesEnum.KRB_PRIV_SEQ_STATE.ordinal()][KerberosConstants.KRB_PRIV_PVNO_TAG] =
+            new GrammarTransition<KrbPrivContainer>(
+                KrbPrivStatesEnum.KRB_PRIV_SEQ_STATE,
+                KrbPrivStatesEnum.KRB_PRIV_PVNO_TAG_STATE,
+                KerberosConstants.KRB_PRIV_PVNO_TAG,
+                new CheckNotNullLength<KrbPrivContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno tag to pvno value
         // --------------------------------------------------------------------------------------------
         // KRB_PRIV         ::= SEQUENCE {
         //         pvno            [0] INTEGER (5) ,
-        super.transitions[KrbPrivStatesEnum.KRB_PRIV_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            KrbPrivStatesEnum.KRB_PRIV_PVNO_TAG_STATE, KrbPrivStatesEnum.KRB_PRIV_PVNO_STATE, UniversalTag.INTEGER.getValue(),
-            new StorePvno() );
-        
+        super.transitions[KrbPrivStatesEnum.KRB_PRIV_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<KrbPrivContainer>(
+                KrbPrivStatesEnum.KRB_PRIV_PVNO_TAG_STATE,
+                KrbPrivStatesEnum.KRB_PRIV_PVNO_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StorePvno() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno to msg-type tag
         // --------------------------------------------------------------------------------------------
         // msg-type        [1]
-        super.transitions[KrbPrivStatesEnum.KRB_PRIV_PVNO_STATE.ordinal()][KerberosConstants.KRB_PRIV_MSGTYPE_TAG] = new GrammarTransition(
-            KrbPrivStatesEnum.KRB_PRIV_PVNO_STATE, KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_TAG_STATE, KerberosConstants.KRB_PRIV_MSGTYPE_TAG, 
-            new CheckNotNullLength() );
+        super.transitions[KrbPrivStatesEnum.KRB_PRIV_PVNO_STATE.ordinal()][KerberosConstants.KRB_PRIV_MSGTYPE_TAG] =
+            new GrammarTransition<KrbPrivContainer>(
+                KrbPrivStatesEnum.KRB_PRIV_PVNO_STATE,
+                KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_TAG_STATE,
+                KerberosConstants.KRB_PRIV_MSGTYPE_TAG,
+                new CheckNotNullLength<KrbPrivContainer>() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type tag to msg-type value
         // --------------------------------------------------------------------------------------------
         // msg-type        [1] INTEGER (30)
-        super.transitions[KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_TAG_STATE, KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_STATE, UniversalTag.INTEGER.getValue(), 
-            new CheckMsgType() );
-        
+        super.transitions[KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<KrbPrivContainer>(
+                KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_TAG_STATE,
+                KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new CheckMsgType() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type value to enc-part tag
         // --------------------------------------------------------------------------------------------
         // enc-part       [3] [3] EncryptedData -- EncKrbPrivPart
-        super.transitions[KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_STATE.ordinal()][KerberosConstants.KRB_PRIV_ENC_PART_TAG] = new GrammarTransition(
-            KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_STATE, KrbPrivStatesEnum.KRB_PRIV_EN_PART_TAG_STATE, KerberosConstants.KRB_PRIV_ENC_PART_TAG, 
-            new StoreEncPart() );
+        super.transitions[KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_STATE.ordinal()][KerberosConstants.KRB_PRIV_ENC_PART_TAG] =
+            new GrammarTransition<KrbPrivContainer>(
+                KrbPrivStatesEnum.KRB_PRIV_MSGTYPE_STATE,
+                KrbPrivStatesEnum.KRB_PRIV_EN_PART_TAG_STATE,
+                KerberosConstants.KRB_PRIV_ENC_PART_TAG,
+                new StoreEncPart() );
     }
 
+
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the KRB_PRIV Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<KrbPrivContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/KrbPrivStatesEnum.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.krbPriv;
 
@@ -27,34 +27,34 @@ import org.apache.directory.shared.asn1.
 /**
  * This class stores the KRB-PRIV grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum KrbPrivStatesEnum implements States
 {
     // Start
     START_STATE,                       // 0
-    
+
     // ----- KRB-SAFE component --------------------------------------
     KRB_PRIV_TAG_STATE,               // 1
-    
+
     KRB_PRIV_SEQ_STATE,               // 2
-    
+
     KRB_PRIV_PVNO_TAG_STATE,          // 3
     KRB_PRIV_PVNO_STATE,              // 4
-    
+
     KRB_PRIV_MSGTYPE_TAG_STATE,       // 5
     KRB_PRIV_MSGTYPE_STATE,           // 6
-    
+
     KRB_PRIV_EN_PART_TAG_STATE,       // 7
-    
+
     // End
     LAST_KRB_PRIV_STATE;              // 8
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -66,11 +66,11 @@ public enum KrbPrivStatesEnum implements
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<KrbPrivContainer> grammar )
     {
         if ( grammar instanceof KrbPrivGrammar )
         {
@@ -85,7 +85,7 @@ public enum KrbPrivStatesEnum implements
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -94,7 +94,7 @@ public enum KrbPrivStatesEnum implements
         return ( ( state == LAST_KRB_PRIV_STATE.ordinal() ) ? "LAST_KRB_PRIV_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -102,8 +102,8 @@ public enum KrbPrivStatesEnum implements
     {
         return this == LAST_KRB_PRIV_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/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/krbPriv/actions/CheckMsgType.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/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.krbPriv.actions;
 
 
 import org.apache.directory.shared.kerberos.KerberosMessageType;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadMsgType;
+import org.apache.directory.shared.kerberos.codec.krbPriv.KrbPrivContainer;
 
 
 /**
  * The action used to check the KRB-PRIV msg-type
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CheckMsgType extends AbstractReadMsgType
+public class CheckMsgType extends AbstractReadMsgType<KrbPrivContainer>
 {
     /**
      * Instantiates a new CheckMsgType action.

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

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/actions/StoreEncPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/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/krbPriv/actions/StoreEncPart.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/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.krbPriv.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.krbPriv.KrbPrivContainer;
 import org.apache.directory.shared.kerberos.components.EncryptedData;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to read the EncryptedData
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreEncPart extends AbstractReadEncryptedPart
+public class StoreEncPart extends AbstractReadEncryptedPart<KrbPrivContainer>
 {
 
     /**
@@ -47,11 +46,10 @@ public class StoreEncPart extends Abstra
      * {@inheritDoc}
      */
     @Override
-    protected void setEncryptedData( EncryptedData encryptedData, Asn1Container container )
+    protected void setEncryptedData( EncryptedData encryptedData, KrbPrivContainer krbPrivContainer )
     {
-        KrbPrivContainer krbPrivContainer = ( KrbPrivContainer ) container;
         krbPrivContainer.getKrbPriv().setEncPart( encryptedData );
 
-        container.setGrammarEndAllowed( true );
+        krbPrivContainer.setGrammarEndAllowed( true );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/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/krbPriv/actions/StorePvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbPriv/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.krbPriv.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.krbPriv.KrbPrivContainer;
 
 
 /**
  * The action used to store the PVNO
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StorePvno extends AbstractReadPvno
+public class StorePvno extends AbstractReadPvno<KrbPrivContainer>
 {
     /**
      * 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, KrbPrivContainer krbPrivContainer )
     {
-        KrbPrivContainer krbPrivContainer = ( KrbPrivContainer ) container;
         krbPrivContainer.getKrbPriv().setProtocolVersionNumber( pvno );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeGrammar.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.krbSafe;
 
 
+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.krbSafe.actions.CheckMsgType;
 import org.apache.directory.shared.kerberos.codec.krbSafe.actions.KrbSafeInit;
@@ -39,10 +39,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the KRB-SAFE 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 KrbSafeGrammar extends AbstractGrammar
+public final class KrbSafeGrammar extends AbstractGrammar<KrbSafeContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( KrbSafeGrammar.class );
@@ -51,12 +51,13 @@ public final class KrbSafeGrammar extend
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. KrbSafeGrammar is a singleton */
-    private static Grammar instance = new KrbSafeGrammar();
+    private static Grammar<KrbSafeContainer> instance = new KrbSafeGrammar();
 
 
     /**
      * Creates a new KrbSafeGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private KrbSafeGrammar()
     {
         setName( KrbSafeGrammar.class.getName() );
@@ -65,81 +66,106 @@ public final class KrbSafeGrammar extend
         super.transitions = new GrammarTransition[KrbSafeStatesEnum.LAST_KRB_SAFE_STATE.ordinal()][256];
 
         // ============================================================================================
-        // KRB-SAFE 
+        // KRB-SAFE
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from KrbSafe init to KrbSafe tag
         // --------------------------------------------------------------------------------------------
         // KRB-SAFE       ::= [APPLICATION 20]
-        super.transitions[KrbSafeStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_SAFE_TAG] = new GrammarTransition(
-            KrbSafeStatesEnum.START_STATE, KrbSafeStatesEnum.KRB_SAFE_TAG_STATE, KerberosConstants.KRB_SAFE_TAG,
-            new KrbSafeInit() );
-        
+        super.transitions[KrbSafeStatesEnum.START_STATE.ordinal()][KerberosConstants.KRB_SAFE_TAG] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.START_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_TAG_STATE,
+                KerberosConstants.KRB_SAFE_TAG,
+                new KrbSafeInit() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from KrbSafe tag to KrbSafe SEQ
         // --------------------------------------------------------------------------------------------
         // KRB-SAFE       ::= [APPLICATION 20] SEQUENCE {
-        super.transitions[KrbSafeStatesEnum.KRB_SAFE_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            KrbSafeStatesEnum.KRB_SAFE_TAG_STATE, KrbSafeStatesEnum.KRB_SAFE_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
+        super.transitions[KrbSafeStatesEnum.KRB_SAFE_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.KRB_SAFE_TAG_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<KrbSafeContainer>() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from KrbSafe SEQ to pvno tag
         // --------------------------------------------------------------------------------------------
         // KRB-SAFE         ::= SEQUENCE {
         //         pvno            [0]
-        super.transitions[KrbSafeStatesEnum.KRB_SAFE_SEQ_STATE.ordinal()][KerberosConstants.KRB_SAFE_PVNO_TAG] = new GrammarTransition(
-            KrbSafeStatesEnum.KRB_SAFE_SEQ_STATE, KrbSafeStatesEnum.KRB_SAFE_PVNO_TAG_STATE, KerberosConstants.KRB_SAFE_PVNO_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[KrbSafeStatesEnum.KRB_SAFE_SEQ_STATE.ordinal()][KerberosConstants.KRB_SAFE_PVNO_TAG] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.KRB_SAFE_SEQ_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_PVNO_TAG_STATE,
+                KerberosConstants.KRB_SAFE_PVNO_TAG,
+                new CheckNotNullLength<KrbSafeContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno tag to pvno value
         // --------------------------------------------------------------------------------------------
         // KRB-SAFE         ::= SEQUENCE {
         //         pvno            [0] INTEGER (5) ,
-        super.transitions[KrbSafeStatesEnum.KRB_SAFE_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            KrbSafeStatesEnum.KRB_SAFE_PVNO_TAG_STATE, KrbSafeStatesEnum.KRB_SAFE_PVNO_STATE, UniversalTag.INTEGER.getValue(),
-            new StorePvno() );
-        
+        super.transitions[KrbSafeStatesEnum.KRB_SAFE_PVNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.KRB_SAFE_PVNO_TAG_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_PVNO_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StorePvno() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno to msg-type tag
         // --------------------------------------------------------------------------------------------
         // msg-type        [1]
-        super.transitions[KrbSafeStatesEnum.KRB_SAFE_PVNO_STATE.ordinal()][KerberosConstants.KRB_SAFE_MSGTYPE_TAG] = new GrammarTransition(
-            KrbSafeStatesEnum.KRB_SAFE_PVNO_STATE, KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_TAG_STATE, KerberosConstants.KRB_SAFE_MSGTYPE_TAG, 
-            new CheckNotNullLength() );
+        super.transitions[KrbSafeStatesEnum.KRB_SAFE_PVNO_STATE.ordinal()][KerberosConstants.KRB_SAFE_MSGTYPE_TAG] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.KRB_SAFE_PVNO_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_TAG_STATE,
+                KerberosConstants.KRB_SAFE_MSGTYPE_TAG,
+                new CheckNotNullLength<KrbSafeContainer>() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type tag to msg-type value
         // --------------------------------------------------------------------------------------------
         // msg-type        [1] INTEGER (30)
-        super.transitions[KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_TAG_STATE, KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_STATE, UniversalTag.INTEGER.getValue(), 
-            new CheckMsgType() );
-        
+        super.transitions[KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_TAG_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new CheckMsgType() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type value to safe-body tag
         // --------------------------------------------------------------------------------------------
         // safe-body       [2] KRB-SAFE-BODY
-        super.transitions[KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_STATE.ordinal()][KerberosConstants.KRB_SAFE_SAFE_BODY_TAG] = new GrammarTransition(
-            KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_STATE, KrbSafeStatesEnum.KRB_SAFE_SAFE_BODY_TAG_STATE, KerberosConstants.KRB_SAFE_SAFE_BODY_TAG, 
-            new StoreSafeBody() );
-        
+        super.transitions[KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_STATE.ordinal()][KerberosConstants.KRB_SAFE_SAFE_BODY_TAG] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.KRB_SAFE_MSGTYPE_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_SAFE_BODY_TAG_STATE,
+                KerberosConstants.KRB_SAFE_SAFE_BODY_TAG,
+                new StoreSafeBody() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from safe-body tag to cksum tag
         // --------------------------------------------------------------------------------------------
         // cksum           [3] Checksum
-        super.transitions[KrbSafeStatesEnum.KRB_SAFE_SAFE_BODY_TAG_STATE.ordinal()][KerberosConstants.KRB_SAFE_CKSUM_TAG] = new GrammarTransition(
-            KrbSafeStatesEnum.KRB_SAFE_SAFE_BODY_TAG_STATE, KrbSafeStatesEnum.KRB_SAFE_CKSUM_TAG_STATE, KerberosConstants.KRB_SAFE_CKSUM_TAG, 
-            new StoreChecksum() );
+        super.transitions[KrbSafeStatesEnum.KRB_SAFE_SAFE_BODY_TAG_STATE.ordinal()][KerberosConstants.KRB_SAFE_CKSUM_TAG] =
+            new GrammarTransition<KrbSafeContainer>(
+                KrbSafeStatesEnum.KRB_SAFE_SAFE_BODY_TAG_STATE,
+                KrbSafeStatesEnum.KRB_SAFE_CKSUM_TAG_STATE,
+                KerberosConstants.KRB_SAFE_CKSUM_TAG,
+                new StoreChecksum() );
     }
 
+
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the KRB-SAFE Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<KrbSafeContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/KrbSafeStatesEnum.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.krbSafe;
 
@@ -27,36 +27,36 @@ import org.apache.directory.shared.asn1.
 /**
  * This class stores the KRB-SAFE grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum KrbSafeStatesEnum implements States
 {
     // Start
     START_STATE,                       // 0
-    
+
     // ----- KRB-SAFE component --------------------------------------
     KRB_SAFE_TAG_STATE,               // 1
-    
+
     KRB_SAFE_SEQ_STATE,               // 2
-    
+
     KRB_SAFE_PVNO_TAG_STATE,          // 3
     KRB_SAFE_PVNO_STATE,              // 4
-    
+
     KRB_SAFE_MSGTYPE_TAG_STATE,       // 5
     KRB_SAFE_MSGTYPE_STATE,           // 6
-    
+
     KRB_SAFE_SAFE_BODY_TAG_STATE,     // 7
-    
+
     KRB_SAFE_CKSUM_TAG_STATE,         // 8
-    
+
     // End
     LAST_KRB_SAFE_STATE;              // 9
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -68,11 +68,11 @@ public enum KrbSafeStatesEnum implements
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<KrbSafeContainer> grammar )
     {
         if ( grammar instanceof KrbSafeGrammar )
         {
@@ -87,7 +87,7 @@ public enum KrbSafeStatesEnum implements
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -96,7 +96,7 @@ public enum KrbSafeStatesEnum implements
         return ( ( state == LAST_KRB_SAFE_STATE.ordinal() ) ? "LAST_KRB_SAFE_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -104,8 +104,8 @@ public enum KrbSafeStatesEnum implements
     {
         return this == LAST_KRB_SAFE_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/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/krbSafe/actions/CheckMsgType.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/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.krbSafe.actions;
 
 
 import org.apache.directory.shared.kerberos.KerberosMessageType;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadMsgType;
+import org.apache.directory.shared.kerberos.codec.krbSafe.KrbSafeContainer;
 
 
 /**
  * The action used to check the KRB-SAFE msg-type
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CheckMsgType extends AbstractReadMsgType
+public class CheckMsgType extends AbstractReadMsgType<KrbSafeContainer>
 {
     /**
      * Instantiates a new CheckMsgType action.

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/KrbSafeInit.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/KrbSafeInit.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/KrbSafeInit.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/KrbSafeInit.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.krbSafe.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.krbSafe.KrbSafeContainer;
 import org.apache.directory.shared.kerberos.messages.KrbSafe;
@@ -33,10 +32,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to initialize the KrbSafe object
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class KrbSafeInit extends GrammarAction
+public class KrbSafeInit extends GrammarAction<KrbSafeContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( KrbSafeInit.class );
@@ -57,10 +56,8 @@ public class KrbSafeInit extends Grammar
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( KrbSafeContainer krbSafeContainer ) throws DecoderException
     {
-        KrbSafeContainer krbSafeContainer = ( KrbSafeContainer ) container;
-
         TLV tlv = krbSafeContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -71,10 +68,10 @@ public class KrbSafeInit extends Grammar
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         KrbSafe krbSafe = new KrbSafe();
         krbSafeContainer.setKrbSafe( krbSafe );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "KrbSafe created" );

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

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/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/krbSafe/actions/StorePvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/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.krbSafe.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.krbSafe.KrbSafeContainer;
 
 
 /**
  * The action used to store the PVNO
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StorePvno extends AbstractReadPvno
+public class StorePvno extends AbstractReadPvno<KrbSafeContainer>
 {
     /**
      * 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, KrbSafeContainer krbSafeContainer )
     {
-        KrbSafeContainer krbSafeContainer = ( KrbSafeContainer ) container;
         krbSafeContainer.getKrbSafe().setProtocolVersionNumber( pvno );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/StoreSafeBody.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/StoreSafeBody.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/StoreSafeBody.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/krbSafe/actions/StoreSafeBody.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.krbSafe.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;
@@ -35,10 +34,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to read the KrbSafeBody
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreSafeBody extends GrammarAction
+public class StoreSafeBody extends GrammarAction<KrbSafeContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreSafeBody.class );
@@ -59,10 +58,8 @@ public class StoreSafeBody extends Gramm
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( KrbSafeContainer krbSafeContainer ) throws DecoderException
     {
-        KrbSafeContainer krbSafeContainer = ( KrbSafeContainer ) container;
-        
         TLV tlv = krbSafeContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -73,19 +70,19 @@ public class StoreSafeBody extends Gramm
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // Now, let's decode the HostAddress
         Asn1Decoder krbSafeBodyDecoder = new Asn1Decoder();
-        
+
         KrbSafeBodyContainer krbSafeBodyContainer = new KrbSafeBodyContainer();
-        
+
         // Passes the Stream to the decoder
-        krbSafeBodyContainer.setStream( container.getStream() );
+        krbSafeBodyContainer.setStream( krbSafeContainer.getStream() );
 
         // Decode the KrbSafeBody PDU
         try
         {
-            krbSafeBodyDecoder.decode( container.getStream(), krbSafeBodyContainer );
+            krbSafeBodyDecoder.decode( krbSafeContainer.getStream(), krbSafeBodyContainer );
         }
         catch ( DecoderException de )
         {
@@ -99,14 +96,14 @@ public class StoreSafeBody extends Gramm
         {
             LOG.debug( "KrbSafeBody : {}", krbSafeBody );
         }
-        
+
         krbSafeContainer.getKrbSafe().setSafeBody( krbSafeBody );
-        
-        
+
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.updateParent();
+        krbSafeContainer.updateParent();
     }
 }



Mime
View raw message