directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1068124 [11/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/kdcRep/KdcRepStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/KdcRepStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/KdcRepStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/KdcRepStatesEnum.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.kdcRep;
 
@@ -27,20 +27,20 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the KDC-REP grammar's constants. It is also used for debugging
  * purpose
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public enum KdcRepStatesEnum implements States
 {
     // Start
     START_STATE,                           // 0
-    
+
     // ----- KDC-REP component --------------------------------------
     KDC_REP_SEQ_STATE,                     // 1
-    
+
     KDC_REP_PVNO_TAG_STATE,                // 2
     KDC_REP_PVNO_STATE,                    // 3
-    
+
     KDC_REP_MSG_TYPE_TAG_STATE,            // 4
     KDC_REP_MSG_TYPE_STATE,                // 5
 
@@ -59,10 +59,10 @@ public enum KdcRepStatesEnum implements 
     // End
     LAST_KDC_REP_STATE;                    // 13
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -74,11 +74,11 @@ public enum KdcRepStatesEnum implements 
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<KdcRepContainer> grammar )
     {
         if ( grammar instanceof KdcRepGrammar )
         {
@@ -93,7 +93,7 @@ public enum KdcRepStatesEnum implements 
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -102,7 +102,7 @@ public enum KdcRepStatesEnum implements 
         return ( ( state == LAST_KDC_REP_STATE.ordinal() ) ? "KDC_REP_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -110,8 +110,8 @@ public enum KdcRepStatesEnum implements 
     {
         return this == LAST_KDC_REP_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/AddPaData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/AddPaData.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/AddPaData.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/AddPaData.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.kdcRep.actions;
 
 
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -36,10 +35,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to add a PaData
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddPaData extends GrammarAction
+public class AddPaData extends GrammarAction<KdcRepContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AddPaData.class );
@@ -59,14 +58,12 @@ public class AddPaData extends GrammarAc
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( KdcRepContainer kdcRepContainer ) throws DecoderException
     {
-        KdcRepContainer kdcRepContainer = ( KdcRepContainer ) container;
-
         TLV tlv = kdcRepContainer.getCurrentTLV();
 
         // The Length can't be null
-        if ( tlv.getLength() == 0 ) 
+        if ( tlv.getLength() == 0 )
         {
             LOG.error( I18n.err( I18n.ERR_04066 ) );
 
@@ -76,25 +73,25 @@ public class AddPaData extends GrammarAc
 
         // Now, let's decode the PA-DATA
         Asn1Decoder paDataDecoder = new Asn1Decoder();
-        
+
         PaDataContainer paDataContainer = new PaDataContainer();
-        paDataContainer.setStream( container.getStream() );
+        paDataContainer.setStream( kdcRepContainer.getStream() );
 
         // We have to move back to the PA-DATA tag
-        container.rewind();
+        kdcRepContainer.rewind();
 
         // Decode the PA-DATA PDU
         try
         {
-            paDataDecoder.decode( container.getStream(), paDataContainer );
+            paDataDecoder.decode( kdcRepContainer.getStream(), paDataContainer );
         }
         catch ( DecoderException de )
         {
             throw de;
         }
-        
+
         // Update the parent
-        container.updateParent();
+        kdcRepContainer.updateParent();
 
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/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/kdcRep/actions/CheckMsgType.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/CheckMsgType.java Mon Feb  7 20:49:04 2011
@@ -6,29 +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.kdcRep.actions;
 
 
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadMsgType;
+import org.apache.directory.shared.kerberos.codec.kdcRep.KdcRepContainer;
 
 
 /**
  * The action used to store the KDC-REP msg-type
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CheckMsgType extends AbstractReadMsgType
+public class CheckMsgType extends AbstractReadMsgType<KdcRepContainer>
 {
     /**
      * Instantiates a new CheckMsgType action.

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/StoreCName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/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/kdcRep/actions/StoreCName.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/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.kdcRep.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.kdcRep.KdcRepContainer;
 import org.apache.directory.shared.kerberos.components.PrincipalName;
@@ -28,10 +27,10 @@ import org.apache.directory.shared.kerbe
 
 /**
  * The action used to store the KDC-REP CName
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreCName extends AbstractReadPrincipalName
+public class StoreCName extends AbstractReadPrincipalName<KdcRepContainer>
 {
     /**
      * 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, KdcRepContainer kdcRepContainer )
     {
-        KdcRepContainer kdcRepContainer = ( KdcRepContainer ) container;
         kdcRepContainer.getKdcRep().setCName( principalName );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/StoreCRealm.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/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/kdcRep/actions/StoreCRealm.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/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.kdcRep.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.kdcRep.KdcRepContainer;
 
 
 /**
  * The action used to set the ticket Realm
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreCRealm extends AbstractReadRealm
+public class StoreCRealm extends AbstractReadRealm<KdcRepContainer>
 {
     /**
      * Instantiates a new TicketRealm action.
@@ -45,9 +44,8 @@ public class StoreCRealm extends Abstrac
      * {@inheritDoc}
      */
     @Override
-    protected void setRealm( String realm, Asn1Container container )
+    protected void setRealm( String realm, KdcRepContainer kdcRepContainer )
     {
-        KdcRepContainer kdcRepContainer = ( KdcRepContainer ) container;
         kdcRepContainer.getKdcRep().setCRealm( realm );
     }
 }

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

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/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/kdcRep/actions/StorePvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/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.kdcRep.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.kdcRep.KdcRepContainer;
 
 
 /**
  * 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<KdcRepContainer>
 {
     /**
      * 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, KdcRepContainer kdcRepContainer )
     {
-        KdcRepContainer kdcRepContainer = ( KdcRepContainer ) container;
         kdcRepContainer.getKdcRep().setPvno( pvno );
     }
 }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/StoreTicket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/StoreTicket.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/StoreTicket.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcRep/actions/StoreTicket.java Mon Feb  7 20:49:04 2011
@@ -6,22 +6,21 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- *  
+ *
  *    http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  *  KIND, either express or implied.  See the License for the
  *  specific language governing permissions and limitations
- *  under the License. 
- *  
+ *  under the License.
+ *
  */
 package org.apache.directory.shared.kerberos.codec.kdcRep.actions;
 
 
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -36,10 +35,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to store the Ticket
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreTicket extends GrammarAction
+public class StoreTicket extends GrammarAction<KdcRepContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreTicket.class );
@@ -59,14 +58,12 @@ public class StoreTicket extends Grammar
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( KdcRepContainer kdcRepContainer ) throws DecoderException
     {
-        KdcRepContainer kdcRepContainer = ( KdcRepContainer ) container;
-
         TLV tlv = kdcRepContainer.getCurrentTLV();
 
         // The Length can't be null
-        if ( tlv.getLength() == 0 ) 
+        if ( tlv.getLength() == 0 )
         {
             LOG.error( I18n.err( I18n.ERR_04066 ) );
 
@@ -76,30 +73,30 @@ public class StoreTicket extends Grammar
 
         // Now, let's decode the Ticket
         Asn1Decoder ticketDecoder = new Asn1Decoder();
-        
-        TicketContainer ticketContainer = new TicketContainer( container.getStream() );
+
+        TicketContainer ticketContainer = new TicketContainer( kdcRepContainer.getStream() );
 
         // Decode the Ticket PDU
         try
         {
-            ticketDecoder.decode( container.getStream(), ticketContainer );
+            ticketDecoder.decode( kdcRepContainer.getStream(), ticketContainer );
         }
         catch ( DecoderException de )
         {
             throw de;
         }
-        
+
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.updateParent();
+        kdcRepContainer.updateParent();
 
         // Store the Ticket in the container
         Ticket ticket = ticketContainer.getTicket();
         KdcRep kdcRep = kdcRepContainer.getKdcRep();
         kdcRep.setTicket( ticket );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "Stored ticket:  {}", ticket );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqGrammar.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqGrammar.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqGrammar.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqGrammar.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.kdcReq;
 
@@ -38,10 +38,10 @@ import org.slf4j.LoggerFactory;
  * This class implements the KdcReq 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 KdcReqGrammar extends AbstractGrammar
+public final class KdcReqGrammar extends AbstractGrammar<KdcReqContainer>
 {
     /** The logger */
     static final Logger LOG = LoggerFactory.getLogger( KdcReqGrammar.class );
@@ -50,12 +50,13 @@ public final class KdcReqGrammar extends
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. KdcReqGrammar is a singleton */
-    private static Grammar instance = new KdcReqGrammar();
+    private static Grammar<KdcReqContainer> instance = new KdcReqGrammar();
 
 
     /**
      * Creates a new KdcReqGrammar object.
      */
+    @SuppressWarnings("unchecked")
     private KdcReqGrammar()
     {
         setName( KdcReqGrammar.class.getName() );
@@ -64,121 +65,155 @@ public final class KdcReqGrammar extends
         super.transitions = new GrammarTransition[KdcReqStatesEnum.LAST_KDC_REQ_STATE.ordinal()][256];
 
         // ============================================================================================
-        // KdcReq 
+        // KdcReq
         // ============================================================================================
         // --------------------------------------------------------------------------------------------
         // Transition from KdcReq init to KdcReq SEQ
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
-        super.transitions[KdcReqStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            KdcReqStatesEnum.START_STATE, KdcReqStatesEnum.KDC_REQ_PVNO_TAG_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
-        
+        super.transitions[KdcReqStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.START_STATE,
+                KdcReqStatesEnum.KDC_REQ_PVNO_TAG_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<KdcReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from KdcReq SEQ to pvno tag
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         pvno            [1]
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PVNO_TAG_STATE.ordinal()][KerberosConstants.KDC_REQ_PVNO_TAG] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PVNO_TAG_STATE, KdcReqStatesEnum.KDC_REQ_PVNO_STATE, KerberosConstants.KDC_REQ_PVNO_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PVNO_TAG_STATE.ordinal()][KerberosConstants.KDC_REQ_PVNO_TAG] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PVNO_TAG_STATE,
+                KdcReqStatesEnum.KDC_REQ_PVNO_STATE,
+                KerberosConstants.KDC_REQ_PVNO_TAG,
+                new CheckNotNullLength<KdcReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno tag to pvno value
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         pvno            [1] INTEGER (5) ,
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PVNO_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PVNO_STATE, KdcReqStatesEnum.KDC_REQ_MSG_TYPE_TAG_STATE, UniversalTag.INTEGER.getValue(),
-            new StorePvno() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PVNO_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PVNO_STATE,
+                KdcReqStatesEnum.KDC_REQ_MSG_TYPE_TAG_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new StorePvno() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pvno value to msg-type tag
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         msg-type        [2]
-        super.transitions[KdcReqStatesEnum.KDC_REQ_MSG_TYPE_TAG_STATE.ordinal()][KerberosConstants.KDC_REQ_MSG_TYPE_TAG] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_MSG_TYPE_TAG_STATE, KdcReqStatesEnum.KDC_REQ_MSG_TYPE_STATE, KerberosConstants.KDC_REQ_MSG_TYPE_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_MSG_TYPE_TAG_STATE.ordinal()][KerberosConstants.KDC_REQ_MSG_TYPE_TAG] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_MSG_TYPE_TAG_STATE,
+                KdcReqStatesEnum.KDC_REQ_MSG_TYPE_STATE,
+                KerberosConstants.KDC_REQ_MSG_TYPE_TAG,
+                new CheckNotNullLength<KdcReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type tag to msg-type value
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         msg-type        [2] INTEGER (10 -- AS -- | 12 -- TGS --),
-        super.transitions[KdcReqStatesEnum.KDC_REQ_MSG_TYPE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_MSG_TYPE_STATE, KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE, UniversalTag.INTEGER.getValue(),
-            new CheckMsgType() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_MSG_TYPE_STATE.ordinal()][UniversalTag.INTEGER.getValue()] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_MSG_TYPE_STATE,
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE,
+                UniversalTag.INTEGER.getValue(),
+                new CheckMsgType() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type value to padata tag
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         padata          [3]
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE.ordinal()][KerberosConstants.KDC_REQ_PA_DATA_TAG] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE, KdcReqStatesEnum.KDC_REQ_PA_DATA_TAG_STATE, KerberosConstants.KDC_REQ_PA_DATA_TAG,
-            new CheckNotNullLength() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE.ordinal()][KerberosConstants.KDC_REQ_PA_DATA_TAG] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE,
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_TAG_STATE,
+                KerberosConstants.KDC_REQ_PA_DATA_TAG,
+                new CheckNotNullLength<KdcReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from msg-type value to KDC-REQ-BODY tag (pa-data is missing)
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         req-body        [4]
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE.ordinal()][KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE, KdcReqStatesEnum.KDC_REQ_KDC_REQ_BODY_STATE, KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG,
-            new StoreKdcReqBody() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE.ordinal()][KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_OR_REQ_BODY_STATE,
+                KdcReqStatesEnum.KDC_REQ_KDC_REQ_BODY_STATE,
+                KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG,
+                new StoreKdcReqBody() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from padata tag to pa-data SEQ
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         padata          [3] SEQUENCE OF
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PA_DATA_TAG_STATE, KdcReqStatesEnum.KDC_REQ_PA_DATA_SEQ_STATE, UniversalTag.SEQUENCE.getValue(),
-            new CheckNotNullLength() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_TAG_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_TAG_STATE,
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_SEQ_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new CheckNotNullLength<KdcReqContainer>() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pa-data SEQ to pa-data
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         padata          [3] SEQUENCE OF <PA-DATA>
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_SEQ_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PA_DATA_SEQ_STATE, KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE, UniversalTag.SEQUENCE.getValue(),
-            new AddPaData() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_SEQ_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_SEQ_STATE,
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new AddPaData() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pa-data to pa-data
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         padata          [3] SEQUENCE OF <PA-DATA>
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE, KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE, UniversalTag.SEQUENCE.getValue(),
-            new AddPaData() );
-        
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE,
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE,
+                UniversalTag.SEQUENCE.getValue(),
+                new AddPaData() );
+
         // --------------------------------------------------------------------------------------------
         // Transition from pa-data to KDC-REQ-BODY tag
         // --------------------------------------------------------------------------------------------
         // KDC-REQ         ::= SEQUENCE {
         //         ...
         //         req-body        [4]
-        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE.ordinal()][KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG] = new GrammarTransition(
-            KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE, KdcReqStatesEnum.KDC_REQ_KDC_REQ_BODY_STATE, KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG,
-            new StoreKdcReqBody() );
+        super.transitions[KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE.ordinal()][KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG] =
+            new GrammarTransition<KdcReqContainer>(
+                KdcReqStatesEnum.KDC_REQ_PA_DATA_STATE,
+                KdcReqStatesEnum.KDC_REQ_KDC_REQ_BODY_STATE,
+                KerberosConstants.KDC_REQ_KDC_REQ_BODY_TAG,
+                new StoreKdcReqBody() );
     }
 
+
     /**
      * Get the instance of this grammar
-     * 
+     *
      * @return An instance on the KDC-REQ Grammar
      */
-    public static Grammar getInstance()
+    public static Grammar<KdcReqContainer> getInstance()
     {
         return instance;
     }

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqStatesEnum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqStatesEnum.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqStatesEnum.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/KdcReqStatesEnum.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.kdcReq;
 
@@ -27,23 +27,23 @@ import org.apache.directory.shared.asn1.
 /**
  * This class store the KDC-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 KdcReqStatesEnum implements States
 {
     // Start
     START_STATE,                           // 0
-    
+
     // ----- KDC-REQ component --------------------------------------
     KDC_REQ_SEQ_STATE,                     // 1
-    
+
     KDC_REQ_PVNO_TAG_STATE,                // 2
     KDC_REQ_PVNO_STATE,                    // 3
-    
+
     KDC_REQ_MSG_TYPE_TAG_STATE,            // 4
     KDC_REQ_MSG_TYPE_STATE,                // 5
-    
+
     KDC_REQ_PA_DATA_OR_REQ_BODY_STATE,     // 6
 
     KDC_REQ_PA_DATA_TAG_STATE,             // 7
@@ -55,10 +55,10 @@ public enum KdcReqStatesEnum implements 
     // End
     LAST_KDC_REQ_STATE;                    // 11
 
-    
+
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar code
      * @return The grammar name
      */
@@ -70,11 +70,11 @@ public enum KdcReqStatesEnum implements 
 
     /**
      * Get the grammar name
-     * 
+     *
      * @param grammar The grammar class
      * @return The grammar name
      */
-    public String getGrammarName( Grammar grammar )
+    public String getGrammarName( Grammar<KdcReqContainer> grammar )
     {
         if ( grammar instanceof KdcReqGrammar )
         {
@@ -89,7 +89,7 @@ public enum KdcReqStatesEnum implements 
 
     /**
      * Get the string representing the state
-     * 
+     *
      * @param state The state number
      * @return The String representing the state
      */
@@ -98,7 +98,7 @@ public enum KdcReqStatesEnum implements 
         return ( ( state == LAST_KDC_REQ_STATE.ordinal() ) ? "KDC_REQ_END_STATE" : name() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -106,8 +106,8 @@ public enum KdcReqStatesEnum implements 
     {
         return this == LAST_KDC_REQ_STATE;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.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.kdcReq.actions;
 
 
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -36,10 +35,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to add a PaData
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class AddPaData extends GrammarAction
+public class AddPaData extends GrammarAction<KdcReqContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( AddPaData.class );
@@ -59,14 +58,12 @@ public class AddPaData extends GrammarAc
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( KdcReqContainer kdcReqContainer ) throws DecoderException
     {
-        KdcReqContainer kdcReqContainer = ( KdcReqContainer ) container;
-
         TLV tlv = kdcReqContainer.getCurrentTLV();
 
         // The Length can't be null
-        if ( tlv.getLength() == 0 ) 
+        if ( tlv.getLength() == 0 )
         {
             LOG.error( I18n.err( I18n.ERR_04066 ) );
 
@@ -76,25 +73,25 @@ public class AddPaData extends GrammarAc
 
         // Now, let's decode the PA-DATA
         Asn1Decoder paDataDecoder = new Asn1Decoder();
-        
+
         PaDataContainer paDataContainer = new PaDataContainer();
-        paDataContainer.setStream( container.getStream() );
+        paDataContainer.setStream( kdcReqContainer.getStream() );
 
         // We have to move back to the PA-DATA tag
-        container.rewind();
+        kdcReqContainer.rewind();
 
         // Decode the PA-DATA PDU
         try
         {
-            paDataDecoder.decode( container.getStream(), paDataContainer );
+            paDataDecoder.decode( kdcReqContainer.getStream(), paDataContainer );
         }
         catch ( DecoderException de )
         {
             throw de;
         }
-        
+
         // Update the parent
-        container.updateParent();
+        kdcReqContainer.updateParent();
 
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/CheckMsgType.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/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/kdcReq/actions/CheckMsgType.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/CheckMsgType.java Mon Feb  7 20:49:04 2011
@@ -6,29 +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.kdcReq.actions;
 
 
 import org.apache.directory.shared.kerberos.codec.actions.AbstractReadMsgType;
+import org.apache.directory.shared.kerberos.codec.kdcReq.KdcReqContainer;
 
 
 /**
  * The action used to store the KDC-REQ msg-type
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class CheckMsgType extends AbstractReadMsgType
+public class CheckMsgType extends AbstractReadMsgType<KdcReqContainer>
 {
     /**
      * Instantiates a new CheckMsgType action.

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java?rev=1068124&r1=1068123&r2=1068124&view=diff
==============================================================================
--- directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.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.kdcReq.actions;
 
 
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
@@ -36,10 +35,10 @@ import org.slf4j.LoggerFactory;
 
 /**
  * The action used to store the KDC_REQ-BODY
- * 
+ *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class StoreKdcReqBody extends GrammarAction
+public class StoreKdcReqBody extends GrammarAction<KdcReqContainer>
 {
     /** The logger */
     private static final Logger LOG = LoggerFactory.getLogger( StoreKdcReqBody.class );
@@ -60,10 +59,8 @@ public class StoreKdcReqBody extends Gra
     /**
      * {@inheritDoc}
      */
-    public void action( Asn1Container container ) throws DecoderException
+    public void action( KdcReqContainer kdcReqContainer ) throws DecoderException
     {
-        KdcReqContainer kdcReqContainer = ( KdcReqContainer ) container;
-
         TLV tlv = kdcReqContainer.getCurrentTLV();
 
         // The Length should not be null
@@ -74,16 +71,16 @@ public class StoreKdcReqBody extends Gra
             // This will generate a PROTOCOL_ERROR
             throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
         }
-        
+
         // Now, let's decode the KDC-REQ-BODY
         Asn1Decoder kdcReqBodyDecoder = new Asn1Decoder();
-        
-        KdcReqBodyContainer kdcReqBodyContainer = new KdcReqBodyContainer( container.getStream() );
+
+        KdcReqBodyContainer kdcReqBodyContainer = new KdcReqBodyContainer( kdcReqContainer.getStream() );
 
         // Decode the KDC-REQ-BODY PDU
         try
         {
-            kdcReqBodyDecoder.decode( container.getStream(), kdcReqBodyContainer );
+            kdcReqBodyDecoder.decode( kdcReqContainer.getStream(), kdcReqBodyContainer );
         }
         catch ( DecoderException de )
         {
@@ -94,11 +91,11 @@ public class StoreKdcReqBody extends Gra
         KdcReqBody kdcReqBody = kdcReqBodyContainer.getKdcReqBody();
         KdcReq kdcReq = kdcReqContainer.getKdcReq();
         kdcReq.setKdcReqBody( kdcReqBody );
-        
+
         // Update the parent
-        container.updateParent();
-        
-        container.setGrammarEndAllowed( true );
+        kdcReqContainer.updateParent();
+
+        kdcReqContainer.setGrammarEndAllowed( true );
 
         if ( IS_DEBUG )
         {

Modified: directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StorePvno.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/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/kdcReq/actions/StorePvno.java (original)
+++ directory/apacheds/branches/m1/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/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.kdcReq.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.kdcReq.KdcReqContainer;
 
 
 /**
  * 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<KdcReqContainer>
 {
     /**
      * Instantiates a new StorePvno action.
@@ -45,9 +44,8 @@ public class StorePvno extends AbstractR
      * {@inheritDoc}
      */
     @Override
-    public void setPvno( int pvno, Asn1Container container )
+    public void setPvno( int pvno, KdcReqContainer kdcReqContainer )
     {
-        KdcReqContainer kdcReqContainer = ( KdcReqContainer ) container;
         kdcReqContainer.getKdcReq().setPvno( pvno );
     }
 }



Mime
View raw message