directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1094115 - in /directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl: PasswordPolicyContainer.java PasswordPolicyDecorator.java
Date Sun, 17 Apr 2011 07:54:33 GMT
Author: kayyagari
Date: Sun Apr 17 07:54:33 2011
New Revision: 1094115

URL: http://svn.apache.org/viewvc?rev=1094115&view=rev
Log:
o reset the variables holding tag lengths
o use the existing decorator object in container 

Modified:
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyContainer.java
    directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyContainer.java?rev=1094115&r1=1094114&r2=1094115&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyContainer.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyContainer.java
Sun Apr 17 07:54:33 2011
@@ -50,7 +50,16 @@ public class PasswordPolicyContainer ext
     public PasswordPolicyContainer( LdapCodecService codec, PasswordPolicy ppolicyResponse
)
     {
         super();
-        control = new PasswordPolicyDecorator( codec, ppolicyResponse );
+        
+        if( ppolicyResponse instanceof PasswordPolicyDecorator )
+        {
+            this.control = ( PasswordPolicyDecorator ) ppolicyResponse;
+        }
+        else
+        {
+            control = new PasswordPolicyDecorator( codec, ppolicyResponse );
+        }
+        
         stateStack = new int[1];
         grammar = PasswordPolicyGrammar.getInstance();
         setTransition( PasswordPolicyStates.START_STATE );

Modified: directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java?rev=1094115&r1=1094114&r2=1094115&view=diff
==============================================================================
--- directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java
(original)
+++ directory/shared/trunk/ldap/extras/codec/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyDecorator.java
Sun Apr 17 07:54:33 2011
@@ -96,6 +96,13 @@ public class PasswordPolicyDecorator ext
     @Override
     public int computeLength()
     {
+        // reset the length values
+        valueLength = 0;
+        ppolicySeqLength = 0;
+        warningLength = 0;
+        timeBeforeExpirationTagLength = 0;
+        graceAuthNsRemainingTagLength = 0;
+
         if ( ! hasResponse() )
         {
             return 0;



Mime
View raw message