directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1035607 - in /directory: apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/hostAddresses/actions/ apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/ a...
Date Tue, 16 Nov 2010 12:17:30 GMT
Author: elecharny
Date: Tue Nov 16 12:17:29 2010
New Revision: 1035607

URL: http://svn.apache.org/viewvc?rev=1035607&view=rev
Log:
o Added an updateParent() method in the base Container
o Used this method in the grammar actions

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/hostAddresses/actions/AddHostAddress.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreAddresses.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreCName.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreEncAuthorizationData.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreSName.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreEncPart.java
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreSName.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/hostAddresses/actions/AddHostAddress.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/hostAddresses/actions/AddHostAddress.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/hostAddresses/actions/AddHostAddress.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/hostAddresses/actions/AddHostAddress.java
Tue Nov 16 12:17:29 2010
@@ -83,7 +83,7 @@ public class AddHostAddress extends Gram
         
         // Compute the start position in the stream for the HostAdress to decode : 
         // We have to move back to the HostAddress tag
-        container.rewind( tlv );
+        container.rewind();
 
         // Decode the HostAddress PDU
         try
@@ -99,7 +99,7 @@ public class AddHostAddress extends Gram
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
 
         // Store the hostAddress in the container
         HostAddress hostAddress = hostAddressContainer.getHostAddress();

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/AddPaData.java
Tue Nov 16 12:17:29 2010
@@ -81,7 +81,7 @@ public class AddPaData extends GrammarAc
         paDataContainer.setStream( container.getStream() );
 
         // We have to move back to the PA-DATA tag
-        container.rewind( tlv );
+        container.rewind();
 
         // Decode the PA-DATA PDU
         try
@@ -94,14 +94,7 @@ public class AddPaData extends GrammarAc
         }
         
         // Update the parent
-        TLV parentTlv = tlv.getParent();
-        
-        while ( ( parentTlv != null ) && ( parentTlv.getExpectedLength() == 0 ) )
-        {
-            parentTlv = parentTlv.getParent();
-        }
-        
-        container.setParentTLV( parentTlv );
+        container.updateParent();
 
         // Update the expected length for the current TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReq/actions/StoreKdcReqBody.java
Tue Nov 16 12:17:29 2010
@@ -97,7 +97,7 @@ public class StoreKdcReqBody extends Gra
         kdcReq.setKdcReqBody( kdcReqBody );
         
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
         
         container.setGrammarEndAllowed( true );
 

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/AddTicket.java
Tue Nov 16 12:17:29 2010
@@ -81,7 +81,7 @@ public class AddTicket extends GrammarAc
         ticketContainer.setStream( container.getStream() );
 
         // We have to move back to the Ticket tag
-        container.rewind( tlv );
+        container.rewind();
 
         // Decode the Ticket PDU
         try
@@ -97,7 +97,7 @@ public class AddTicket extends GrammarAc
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
 
         // Store the Ticket in the container
         Ticket ticket = ticketContainer.getTicket();

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreAddresses.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreAddresses.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreAddresses.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreAddresses.java
Tue Nov 16 12:17:29 2010
@@ -103,7 +103,7 @@ public class StoreAddresses extends Gram
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
         
         container.setGrammarEndAllowed( true );
         

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreCName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreCName.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreCName.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreCName.java
Tue Nov 16 12:17:29 2010
@@ -99,7 +99,7 @@ public class StoreCName extends GrammarA
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
 
         if ( IS_DEBUG )
         {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreEncAuthorizationData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreEncAuthorizationData.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreEncAuthorizationData.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreEncAuthorizationData.java
Tue Nov 16 12:17:29 2010
@@ -103,7 +103,7 @@ public class StoreEncAuthorizationData e
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
         
         container.setGrammarEndAllowed( true );
         

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreSName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreSName.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreSName.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/kdcReqBody/actions/StoreSName.java
Tue Nov 16 12:17:29 2010
@@ -99,7 +99,7 @@ public class StoreSName extends GrammarA
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
 
         if ( IS_DEBUG )
         {

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreEncPart.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreEncPart.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreEncPart.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreEncPart.java
Tue Nov 16 12:17:29 2010
@@ -103,7 +103,9 @@ public class StoreEncPart extends Gramma
 
         // Update the TLV
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
-        //container.setParentTLV( tlv.getParent() );
+
+        // Update the parent
+        container.updateParent();
 
         container.setGrammarEndAllowed( true );
     }

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreSName.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreSName.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreSName.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/ticket/actions/StoreSName.java
Tue Nov 16 12:17:29 2010
@@ -100,7 +100,7 @@ public class StoreSName extends GrammarA
         tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
 
         // Update the parent
-        container.setParentTLV( tlv.getParent() );
+        container.updateParent();
 
         if ( IS_DEBUG )
         {

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
Tue Nov 16 12:17:29 2010
@@ -302,9 +302,26 @@ public abstract class AbstractContainer 
     /**
      * {@inheritDoc}
      */
-    public void rewind( TLV tlv )
+    public void rewind()
     {
+        
         int start = stream.position() - 1 - tlv.getLengthNbBytes();
         stream.position( start );
     }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void updateParent()
+    {
+        TLV parentTlv = tlv.getParent();
+        
+        while ( ( parentTlv != null ) && ( parentTlv.getExpectedLength() == 0 ) )
+        {
+            parentTlv = parentTlv.getParent();
+        }
+        
+        this.parentTLV = parentTlv;
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java?rev=1035607&r1=1035606&r2=1035607&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
Tue Nov 16 12:17:29 2010
@@ -186,5 +186,11 @@ public interface Asn1Container
      * do a grammar switch.
      * @param tlv The TLV to rollback
      */
-    void rewind( TLV tlv );
+    void rewind();
+    
+    
+    /**
+     * Look for the closest parent which has an expected length above 0
+     */
+    void updateParent();
 }



Mime
View raw message