directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1068124 [5/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/asReq/AsReqGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asReq/AsReqGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asReq/AsReqGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asReq/AsReqGrammar.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.asReq;
 
@@ -33,10 +33,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the AS-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 AsReqGrammar extends AbstractGrammar
+public final class AsReqGrammar extends AbstractGrammar<AsReqContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( AsReqGrammar.class );
@@ -45,12 +45,13 @@ public final class AsReqGrammar extends 
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. AsReqGrammar is a singleton */
-    private static Grammar instance = new AsReqGrammar();
+    private static Grammar<AsReqContainer> instance = new AsReqGrammar();
 
 
     /**
      * Creates a new AsReqGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private AsReqGrammar()
     {
         setName( AsReqGrammar.class.getName() );
@@ -59,24 +60,27 @@ public final class AsReqGrammar extends 
         super.transitions = new GrammarTransition[AsReqStatesEnum.LAST_AS_REQ_STATE.ordinal()][256];
 
         // ============================================================================================
-        // AS-REQ 
+        // AS-REQ
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from AS-REQ init to KDC-REQ
         // --------------------------------------------------------------------------------------------
         // AS-REQ          ::= [APPLICATION 10] KDC-REQ
-        super.transitions[AsReqStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REQ_TAG] = new GrammarTransition(
-            AsReqStatesEnum.START_STATE, AsReqStatesEnum.AS_REQ_STATE, KerberosConstants.AS_REQ_TAG,
-            new StoreKdcReq() );
+        super.transitions[AsReqStatesEnum.START_STATE.ordinal()][KerberosConstants.AS_REQ_TAG] =
+            new GrammarTransition<AsReqContainer>(
+                AsReqStatesEnum.START_STATE,
+                AsReqStatesEnum.AS_REQ_STATE,
+                KerberosConstants.AS_REQ_TAG,
+                new StoreKdcReq() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the AS-REQ Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<AsReqContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asReq/AsReqStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asReq/AsReqStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asReq/AsReqStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/asReq/AsReqStatesEnum.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.asReq;
 
@@ -27,24 +27,24 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the AS-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 AsReqStatesEnum implements States
 {
     // Start
     START_STATE,                            // 0
-    
+
     // ----- HostAddresses message --------------------------------------
     AS_REQ_STATE,                           // 1
-    
+
     // End
     LAST_AS_REQ_STATE;                      // 2
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -56,11 +56,11 @@ public enum AsReqStatesEnum implements S
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<AsReqContainer> grammar )
     {
         if ( grammar instanceof AsReqGrammar )
         {
@@ -75,7 +75,7 @@ public enum AsReqStatesEnum 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 AsReqStatesEnum implements S
         return ( ( state == LAST_AS_REQ_STATE.ordinal() ) ? "AS_REQ_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -92,8 +92,8 @@ public enum AsReqStatesEnum implements S
     {
         return this == LAST_AS_REQ_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

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

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorGrammar.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.authenticator;
 
 
+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.authenticator.actions.AuthenticatorInit;
 import org.apache.directory.shared.kerberos.codec.authenticator.actions.StoreAuthenticatorVno;
@@ -44,10 +44,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the Authenticator 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 AuthenticatorGrammar extends AbstractGrammar
+public final class AuthenticatorGrammar extends AbstractGrammar<AuthenticatorContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( AuthenticatorGrammar.class );
@@ -56,12 +56,13 @@ public final class AuthenticatorGrammar 
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. AuthenticatorGrammar is a singleton */
-    private static Grammar instance = new AuthenticatorGrammar();
+    private static Grammar<AuthenticatorContainer> instance = new AuthenticatorGrammar();
 
 
     /**
      * Creates a new AuthenticatorGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private AuthenticatorGrammar()
     {
         setName( AuthenticatorGrammar.class.getName() );
@@ -70,192 +71,249 @@ public final class AuthenticatorGrammar 
         super.transitions = new GrammarTransition[AuthenticatorStatesEnum.LAST_AUTHENTICATOR_STATE.ordinal()][256];
 
         // ============================================================================================
-        // Authenticator 
+        // Authenticator
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from START to Authenticator init
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2]
-        super.transitions[AuthenticatorStatesEnum.START_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.START_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_STATE, KerberosConstants.AUTHENTICATOR_TAG,
-            new AuthenticatorInit() );
-        
+        super.transitions[AuthenticatorStatesEnum.START_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.START_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_STATE,
+                KerberosConstants.AUTHENTICATOR_TAG,
+                new AuthenticatorInit() );
+
         // --------------------------------------------------------------------------------------------
-        // Transition from Authenticator init to Authenticator SEQ 
+        // Transition from Authenticator init to Authenticator SEQ
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
-        // Transition from Authenticator SEQ to authenticator-vno tag 
+        // Transition from Authenticator SEQ to authenticator-vno tag
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         authenticator-vno       [0]
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG_STATE, KerberosConstants.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG_STATE,
+                KerberosConstants.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG,
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
-        // Transition from authenticator-vno tag to authenticator-vno value 
+        // Transition from authenticator-vno tag to authenticator-vno value
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         authenticator-vno       [0] INTEGER (5),
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_STATE, UniversalTag.INTEGER.getValue(),
-            new StoreAuthenticatorVno() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_TAG_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StoreAuthenticatorVno() );
+
         // --------------------------------------------------------------------------------------------
-        // Transition from authenticator-vno value to crealm tag 
+        // Transition from authenticator-vno value to crealm tag
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         crealm                  [1]
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CREALM_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_TAG_STATE, KerberosConstants.AUTHENTICATOR_CREALM_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CREALM_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_AUTHENTICATOR_VNO_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_TAG_STATE,
+                KerberosConstants.AUTHENTICATOR_CREALM_TAG,
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
-        // Transition from crealm tag to crealm value 
+        // Transition from crealm tag to crealm value
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         crealm                  [1] Realm,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_TAG_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_STATE, UniversalTag.GENERAL_STRING.getValue(),
-            new StoreCRealm() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_TAG_STATE.ordinal()][UniversalTag.GENERAL_STRING.getValue()] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_TAG_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_STATE,
+                UniversalTag.GENERAL_STRING.getValue(),
+                new StoreCRealm() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from crealm value cname
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         cname                   [2] PrincipalName,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CNAME_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE, KerberosConstants.AUTHENTICATOR_CNAME_TAG,
-            new StoreCName() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CNAME_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CREALM_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE,
+                KerberosConstants.AUTHENTICATOR_CNAME_TAG,
+                new StoreCName() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from cname to cksum
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         cksum                   [3] Checksum OPTIONAL,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CKSUM_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CKSUM_STATE, KerberosConstants.AUTHENTICATOR_CKSUM_TAG,
-            new StoreChecksum() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CKSUM_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CKSUM_STATE,
+                KerberosConstants.AUTHENTICATOR_CKSUM_TAG,
+                new StoreChecksum() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from cname to cusec tag
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         cusec                   [4]
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CUSEC_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE, KerberosConstants.AUTHENTICATOR_CUSEC_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CUSEC_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CNAME_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE,
+                KerberosConstants.AUTHENTICATOR_CUSEC_TAG,
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from cksum to cusec tag
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         cusec                   [4]
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CKSUM_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CUSEC_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CKSUM_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE, KerberosConstants.AUTHENTICATOR_CUSEC_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CKSUM_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CUSEC_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CKSUM_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE,
+                KerberosConstants.AUTHENTICATOR_CUSEC_TAG,
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from cusec tag to cusec value
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         cusec                   [4] Microseconds,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_STATE, UniversalTag.INTEGER.getValue(),
-            new StoreCusec() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_TAG_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StoreCusec() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from cusec value to ctime tag
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
-        //         ctime                   [5] 
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CTIME_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_TAG_STATE, KerberosConstants.AUTHENTICATOR_CTIME_TAG,
-            new CheckNotNullLength() );
-        
+        //         ctime                   [5]
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_CTIME_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CUSEC_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_TAG_STATE,
+                KerberosConstants.AUTHENTICATOR_CTIME_TAG,
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ctime tag to ctime value
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         ctime                   [5] KerberosTime,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_TAG_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE, UniversalTag.GENERALIZED_TIME.getValue(),
-            new StoreCTime() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_TAG_STATE.ordinal()][UniversalTag.GENERALIZED_TIME.getValue()] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_TAG_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE,
+                UniversalTag.GENERALIZED_TIME.getValue(),
+                new StoreCTime() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ctime value to subkey
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         subkey                  [6] EncryptionKe> OPTIONAL,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_SUBKEY_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE, KerberosConstants.AUTHENTICATOR_SUBKEY_TAG,
-            new StoreSubKey() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_SUBKEY_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE,
+                KerberosConstants.AUTHENTICATOR_SUBKEY_TAG,
+                new StoreSubKey() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ctime value to seq-number
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         seq-number              [7] UInt32 OPTIONAL,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE, KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE,
+                KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG,
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ctime value to authorization-data
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         authorization-data      [8] AuthorizationData OPTIONAL
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_AUTHORIZATION_DATA_STATE, KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG,
-            new StoreAuthorizationData() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_CTIME_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_AUTHORIZATION_DATA_STATE,
+                KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG,
+                new StoreAuthorizationData() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from subkey to seq-number
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         seq-number              [7] UInt32 OPTIONAL,
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE, KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE,
+                KerberosConstants.AUTHENTICATOR_SEQ_NUMBER_TAG,
+                new CheckNotNullLength<AuthenticatorContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from subkey to authorization-data
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         authorization-data      [8] AuthorizationData OPTIONAL
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_AUTHORIZATION_DATA_STATE, KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG,
-            new StoreAuthorizationData() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_SUBKEY_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_AUTHORIZATION_DATA_STATE,
+                KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG,
+                new StoreAuthorizationData() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from seq-number tag to seq-number value
         // --------------------------------------------------------------------------------------------
         // Authenticator    ::= [APPLICATION 2] SEQUENCE {
         //         ...
         //         authorization-data      [8] AuthorizationData OPTIONAL
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_STATE, UniversalTag.INTEGER.getValue(),
-            new StoreSeqNumber() );
-        
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_TAG_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StoreSeqNumber() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from seq-number value to authorization-data
         // --------------------------------------------------------------------------------------------
@@ -263,17 +321,20 @@ public final class AuthenticatorGrammar 
         //         ...
         //         authorization-data      [8] AuthorizationData OPTIONAL
         // }
-        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG] = new GrammarTransition(
-            AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_STATE, AuthenticatorStatesEnum.AUTHENTICATOR_AUTHORIZATION_DATA_STATE, KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG,
-            new StoreAuthorizationData() );
+        super.transitions[AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_STATE.ordinal()][KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG] =
+            new GrammarTransition<AuthenticatorContainer>(
+                AuthenticatorStatesEnum.AUTHENTICATOR_SEQ_NUMBER_STATE,
+                AuthenticatorStatesEnum.AUTHENTICATOR_AUTHORIZATION_DATA_STATE,
+                KerberosConstants.AUTHENTICATOR_AUTHORIZATION_DATA_TAG,
+                new StoreAuthorizationData() );
     }
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the Authenticator Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<AuthenticatorContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/AuthenticatorStatesEnum.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.authenticator;
 
@@ -27,48 +27,48 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the Authenticator grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum AuthenticatorStatesEnum implements States
 {
     // Start
     START_STATE,                                // 0
-    
+
     // ----- AUTHENTICATOR message --------------------------------------
     AUTHENTICATOR_STATE,                        // 1
     AUTHENTICATOR_SEQ_STATE,                    // 2
-    
+
     AUTHENTICATOR_AUTHENTICATOR_VNO_TAG_STATE,  // 3
     AUTHENTICATOR_AUTHENTICATOR_VNO_STATE,      // 4
-    
+
     AUTHENTICATOR_CREALM_TAG_STATE,             // 5
     AUTHENTICATOR_CREALM_STATE,                 // 6
 
     AUTHENTICATOR_CNAME_STATE,                  // 7
-    
+
     AUTHENTICATOR_CKSUM_STATE,                  // 8
 
     AUTHENTICATOR_CUSEC_TAG_STATE,              // 9
     AUTHENTICATOR_CUSEC_STATE,                  // 10
-    
+
     AUTHENTICATOR_CTIME_TAG_STATE,              // 11
     AUTHENTICATOR_CTIME_STATE,                  // 12
-    
+
     AUTHENTICATOR_SUBKEY_STATE,                 // 13
 
     AUTHENTICATOR_SEQ_NUMBER_TAG_STATE,         // 14
     AUTHENTICATOR_SEQ_NUMBER_STATE,             // 15
-    
+
     AUTHENTICATOR_AUTHORIZATION_DATA_STATE,     // 16
 
     // End
     LAST_AUTHENTICATOR_STATE;                   // 17
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -80,11 +80,11 @@ public enum AuthenticatorStatesEnum impl
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<AuthenticatorContainer> grammar )
     {
         if ( grammar instanceof AuthenticatorGrammar )
         {
@@ -99,7 +99,7 @@ public enum AuthenticatorStatesEnum impl
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -108,7 +108,7 @@ public enum AuthenticatorStatesEnum impl
         return ( ( state == LAST_AUTHENTICATOR_STATE.ordinal() ) ? "AUTHENTICATOR_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -116,8 +116,8 @@ public enum AuthenticatorStatesEnum impl
     {
         return this == LAST_AUTHENTICATOR_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

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

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthenticatorVno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthenticatorVno.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthenticatorVno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthenticatorVno.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.authenticator.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.authenticator.AuthenticatorContainer;
 
 
 /**
  * The action used to store the AuthenticatorVno
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreAuthenticatorVno extends AbstractReadPvno
+public class StoreAuthenticatorVno extends AbstractReadPvno<AuthenticatorContainer>
 {
     /**
      * Instantiates a new StoreAuthenticatorVno action.
@@ -45,9 +44,8 @@ public class StoreAuthenticatorVno exten
      * {@inheritDoc}
      */
     @Override
-    protected void setPvno( int pvno, Asn1Container container )
+    protected void setPvno( int pvno, AuthenticatorContainer authenticatorContainer )
     {
-        AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
         authenticatorContainer.getAuthenticator().setProtocolVersionNumber( pvno );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreAuthorizationData.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.authenticator.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.authenticator.AuthenticatorContainer;
 import org.apache.directory.shared.kerberos.components.AuthorizationData;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the Authenticator authorization-data
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreAuthorizationData extends AbstractReadAuthorizationData
+public class StoreAuthorizationData extends AbstractReadAuthorizationData<AuthenticatorContainer>
 {
 
     /**
@@ -47,9 +46,8 @@ public class StoreAuthorizationData exte
      * {@inheritDoc}
      */
     @Override
-    protected void setAuthorizationData( AuthorizationData authorizationData, Asn1Container container )
+    protected void setAuthorizationData( AuthorizationData authorizationData, AuthenticatorContainer authenticatorContainer )
     {
-        AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
         authenticatorContainer.getAuthenticator().setAuthorizationData( authorizationData );
         authenticatorContainer.setGrammarEndAllowed( true );
     }

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

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

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

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreChecksum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/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/authenticator/actions/StoreChecksum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/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.authenticator.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.authenticator.AuthenticatorContainer;
 import org.apache.directory.shared.kerberos.components.Checksum;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the Authenticator cksum
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreChecksum extends AbstractReadCheckSum
+public class StoreChecksum extends AbstractReadCheckSum<AuthenticatorContainer>
 {
     /**
      * 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, AuthenticatorContainer authenticatorContainer )
     {
-        AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
         authenticatorContainer.getAuthenticator().setCksum( checksum );
     }
 }

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

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

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authenticator/actions/StoreSubKey.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.authenticator.actions;
 
 
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadEncryptionKey;
 import org.apache.directory.shared.kerberos.codec.authenticator.AuthenticatorContainer;
 import org.apache.directory.shared.kerberos.components.EncryptionKey;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to set the Authenticator subkey
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreSubKey extends AbstractReadEncryptionKey
+public class StoreSubKey extends AbstractReadEncryptionKey<AuthenticatorContainer>
 {
     /**
      * Instantiates a new StoreEncryptionKey action.
@@ -46,9 +45,8 @@ public class StoreSubKey extends Abstrac
      * {@inheritDoc}
      */
     @Override
-    protected void setEncryptionKey( EncryptionKey encryptionKey, Asn1Container container )
+    protected void setEncryptionKey( EncryptionKey encryptionKey, AuthenticatorContainer authenticatorContainer )
     {
-        AuthenticatorContainer authenticatorContainer = ( AuthenticatorContainer ) container;
         authenticatorContainer.getAuthenticator().setSubKey( encryptionKey );
         authenticatorContainer.setGrammarEndAllowed( true );
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataGrammar.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.authorizationData;
 
@@ -37,10 +37,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the AuthorizationData 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 AuthorizationDataGrammar extends AbstractGrammar
+public final class AuthorizationDataGrammar extends AbstractGrammar<AuthorizationDataContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( AuthorizationDataGrammar.class );
@@ -49,12 +49,13 @@ public final class AuthorizationDataGram
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. AuthorizationDataGrammar is a singleton */
-    private static Grammar instance = new AuthorizationDataGrammar();
+    private static Grammar<AuthorizationDataContainer> instance = new AuthorizationDataGrammar();
 
 
     /**
      * Creates a new AuthorizationDataGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private AuthorizationDataGrammar()
     {
         setName( AuthorizationDataGrammar.class.getName() );
@@ -63,80 +64,101 @@ public final class AuthorizationDataGram
         super.transitions = new GrammarTransition[AuthorizationDataStatesEnum.LAST_AUTHORIZATION_DATA_STATE.ordinal()][256];
 
         // ============================================================================================
-        // AuthorizationData 
+        // AuthorizationData
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from AuthorizationData init to AuthorizationData SEQ OF
         // --------------------------------------------------------------------------------------------
         // AuthorizationData   ::= SEQUENCE OF
-        super.transitions[AuthorizationDataStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            AuthorizationDataStatesEnum.START_STATE, AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new AuthorizationDataInit() );
-        
+        super.transitions[AuthorizationDataStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<AuthorizationDataContainer>(
+                AuthorizationDataStatesEnum.START_STATE,
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new AuthorizationDataInit() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from AuthorizationData SEQ OF to SEQ
         // --------------------------------------------------------------------------------------------
         // AuthorizationData  ::= SEQUENCE OF SEQUENCE {
-        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_SEQ_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_SEQ_STATE, AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_SEQ_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<AuthorizationDataContainer>(
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_SEQ_STATE,
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<AuthorizationDataContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from AuthorizationData SEQ OF to adType tag
         // --------------------------------------------------------------------------------------------
         // AuthorizationData  ::= SEQUENCE OF SEQUENCE {
         //         ad-type     [0]
-        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE.ordinal()][KerberosConstants.AUTHORIZATION_DATA_ADTYPE_TAG] = new GrammarTransition(
-            AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE, AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_TAG_STATE, KerberosConstants.AUTHORIZATION_DATA_ADTYPE_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE.ordinal()][KerberosConstants.AUTHORIZATION_DATA_ADTYPE_TAG] =
+            new GrammarTransition<AuthorizationDataContainer>(
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE,
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_TAG_STATE,
+                KerberosConstants.AUTHORIZATION_DATA_ADTYPE_TAG,
+                new CheckNotNullLength<AuthorizationDataContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from adtype tag to adtype value
         // --------------------------------------------------------------------------------------------
         // AuthorizationData  ::= SEQUENCE OF SEQUENCE {
         //         ad-type     [0] Int32,
-        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_TAG_STATE, AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_STATE, UniversalTag.INTEGER.getValue(),
-            new StoreAdType() );
-        
+        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_TAG_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<AuthorizationDataContainer>(
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_TAG_STATE,
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StoreAdType() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ad-type value to ad-data tag
         // --------------------------------------------------------------------------------------------
         // AuthorizationData   ::= SEQUENCE OF SEQUENCE {
         //         ...
         //         ad-data     [1]
-        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_STATE.ordinal()][KerberosConstants.AUTHORIZATION_DATA_ADDATA_TAG] = new GrammarTransition(
-            AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_STATE, AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_TAG_STATE, KerberosConstants.AUTHORIZATION_DATA_ADDATA_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_STATE.ordinal()][KerberosConstants.AUTHORIZATION_DATA_ADDATA_TAG] =
+            new GrammarTransition<AuthorizationDataContainer>(
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADTYPE_STATE,
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_TAG_STATE,
+                KerberosConstants.AUTHORIZATION_DATA_ADDATA_TAG,
+                new CheckNotNullLength<AuthorizationDataContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ad-data tag to ad-data value
         // --------------------------------------------------------------------------------------------
         // AuthorizationData   ::= SEQUENCE OF SEQUENCE {
         //         ...
         //         ad-data     [1] (OCTET STRING)
-        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_TAG_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
-            AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_TAG_STATE, AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_STATE, UniversalTag.OCTET_STRING.getValue(),
-            new StoreAdData() );
-        
+        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_TAG_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] =
+            new GrammarTransition<AuthorizationDataContainer>(
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_TAG_STATE,
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_STATE,
+                UniversalTag.OCTET_STRING.getValue(),
+                new StoreAdData() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from ad-data value to SEQUENCE
         // --------------------------------------------------------------------------------------------
         // AuthorizationData   ::= SEQUENCE {
         //         ...
         //         ad-data     [1] (OCTET STRING)
-        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_STATE, AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
+        super.transitions[AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<AuthorizationDataContainer>(
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_ADDATA_STATE,
+                AuthorizationDataStatesEnum.AUTHORIZATION_DATA_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<AuthorizationDataContainer>() );
     }
 
 
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the AuthorizationData Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<AuthorizationDataContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/authorizationData/AuthorizationDataStatesEnum.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.authorizationData;
 
@@ -27,31 +27,31 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the AuthorizationData grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum AuthorizationDataStatesEnum implements States
 {
     // Start
     START_STATE,                                // 0
-    
+
     AUTHORIZATION_DATA_SEQ_STATE,               // 1
-    
+
     AUTHORIZATION_DATA_SEQ_SEQ_STATE,           // 2
-    
+
     AUTHORIZATION_DATA_ADTYPE_TAG_STATE,        // 3
     AUTHORIZATION_DATA_ADTYPE_STATE,            // 4
-    
+
     AUTHORIZATION_DATA_ADDATA_TAG_STATE,        // 5
     AUTHORIZATION_DATA_ADDATA_STATE,            // 6
-    
+
     // End
     LAST_AUTHORIZATION_DATA_STATE;              // 7
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -63,11 +63,11 @@ public enum AuthorizationDataStatesEnum 
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<AuthorizationDataContainer> grammar )
     {
         if ( grammar instanceof AuthorizationDataGrammar )
         {
@@ -82,7 +82,7 @@ public enum AuthorizationDataStatesEnum 
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -91,7 +91,7 @@ public enum AuthorizationDataStatesEnum 
         return ( ( state == LAST_AUTHORIZATION_DATA_STATE.ordinal() ) ? "LAST_AUTHORIZATION_DATA_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -99,8 +99,8 @@ public enum AuthorizationDataStatesEnum 
     {
         return this == LAST_AUTHORIZATION_DATA_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */



Mime
View raw message