directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1065367 - in /directory/shared/trunk/ldap/src: main/java/org/apache/directory/shared/ldap/codec/controls/ main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/ main/java/org/apache/directory/shared/ldap/model/message/controls/...
Date Sun, 30 Jan 2011 20:28:00 GMT
Author: akarasulu
Date: Sun Jan 30 20:27:59 2011
New Revision: 1065367

URL: http://svn.apache.org/viewvc?rev=1065367&view=rev
Log:
removing static instances of no value Controls like ManageDsaIT which are unsafe: thanks to
Stefan Seelmann

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
Modified:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CascadeDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/IPasswordPolicyRequest.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyRequestDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/Cascade.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaIT.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CascadeDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CascadeDecorator.java?rev=1065367&r1=1065366&r2=1065367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CascadeDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CascadeDecorator.java
Sun Jan 30 20:27:59 2011
@@ -36,9 +36,9 @@ public class CascadeDecorator extends Co
     /**
      * Default constructor
      */
-    public CascadeDecorator( ILdapCodecService codec )
+    public CascadeDecorator( ILdapCodecService codec, Cascade control )
     {
-        super( codec, Cascade.INSTANCE );
+        super( codec, control );
     }
 
     

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java?rev=1065367&r1=1065366&r2=1065367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java
Sun Jan 30 20:27:59 2011
@@ -33,19 +33,14 @@ import org.apache.directory.shared.ldap.
  */
 public class ManageDsaITDecorator extends ControlDecorator<ManageDsaIT> implements
ManageDsaIT
 {
-    // @TODO We should not bother encoding and decoding marker controls that always
-    // encode and decode into the same TLV/byte sequence. Can't the control just
-    // supply the canned PDU element?
-    //
-    // override the decorator component to hard code this control?
-
 
+    
     /**
      * Default constructor
      */
-    public ManageDsaITDecorator( ILdapCodecService codec )
+    public ManageDsaITDecorator( ILdapCodecService codec, ManageDsaIT control )
     {
-        super( codec, ManageDsaIT.INSTANCE );
+        super( codec, control );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/IPasswordPolicyRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/IPasswordPolicyRequest.java?rev=1065367&r1=1065366&r2=1065367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/IPasswordPolicyRequest.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/IPasswordPolicyRequest.java
Sun Jan 30 20:27:59 2011
@@ -34,7 +34,4 @@ public interface IPasswordPolicyRequest 
 
     /** the password policy request control */
     public static final String OID = "1.3.6.1.4.1.42.2.27.8.5.1";
-
-    /** an instance that can be repeatedly reused */
-    public static final IPasswordPolicyRequest INSTANCE = new PasswordPolicyRequest(); 
 }
\ No newline at end of file

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyRequestDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyRequestDecorator.java?rev=1065367&r1=1065366&r2=1065367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyRequestDecorator.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyRequestDecorator.java
Sun Jan 30 20:27:59 2011
@@ -34,9 +34,9 @@ import org.apache.directory.shared.ldap.
 public class PasswordPolicyRequestDecorator extends ControlDecorator<IPasswordPolicyRequest>

     implements IPasswordPolicyRequest
 {
-    public PasswordPolicyRequestDecorator( ILdapCodecService codec )
+    public PasswordPolicyRequestDecorator( ILdapCodecService codec, IPasswordPolicyRequest
control )
     {
-        super( codec, IPasswordPolicyRequest.INSTANCE );
+        super( codec, control );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/Cascade.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/Cascade.java?rev=1065367&r1=1065366&r2=1065367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/Cascade.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/Cascade.java
Sun Jan 30 20:27:59 2011
@@ -32,9 +32,6 @@ public interface Cascade extends Control
     /** The Cascade control OID */
     String OID = "1.3.6.1.4.1.18060.0.0.1";
 
-    Cascade INSTANCE = new SimpleCascade();
-
-
     /**
      * Simple Cascade control implementation.
      *

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaIT.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaIT.java?rev=1065367&r1=1065366&r2=1065367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaIT.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaIT.java
Sun Jan 30 20:27:59 2011
@@ -63,30 +63,4 @@ public interface ManageDsaIT extends Con
 {
     /** This control OID */
     String OID = "2.16.840.1.113730.3.4.2";
-
-    /** An instance of this constant control which never changes */
-    ManageDsaIT INSTANCE = new SimpleManageDsaIT();
-
-
-    class SimpleManageDsaIT extends BasicControl implements ManageDsaIT
-    {
-        /**
-         * Default constructor.
-         */
-        public SimpleManageDsaIT()
-        {
-            super( OID );
-        }
-
-
-        public void setValue( byte [] value )
-        {
-        }
-
-
-        public boolean hasValue()
-        {
-            return false;
-        }
-    }
 }

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java?rev=1065367&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
(added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/model/message/controls/ManageDsaITImpl.java
Sun Jan 30 20:27:59 2011
@@ -0,0 +1,24 @@
+
+package org.apache.directory.shared.ldap.model.message.controls;
+
+public class ManageDsaITImpl extends BasicControl implements ManageDsaIT
+{
+    /**
+     * Default constructor.
+     */
+    public ManageDsaITImpl()
+    {
+        super( OID );
+    }
+
+
+    public void setValue( byte [] value )
+    {
+    }
+
+
+    public boolean hasValue()
+    {
+        return false;
+    }
+}
\ No newline at end of file

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java?rev=1065367&r1=1065366&r2=1065367&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java
(original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java
Sun Jan 30 20:27:59 2011
@@ -22,13 +22,11 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
-import org.apache.directory.shared.ldap.codec.ILdapCodecService;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITDecorator;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.shared.ldap.model.message.controls.ManageDsaITImpl;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.util.Strings;
@@ -542,8 +540,7 @@ public class LdifUtilsTest
         entry.addAttribute( "m-oid", "1.2.3.4" );
         entry.addAttribute( "m-description", "description" );
         
-        ILdapCodecService codec = new DefaultLdapCodecService();
-        ManageDsaITDecorator control = new ManageDsaITDecorator( codec );
+        ManageDsaITImpl control = new ManageDsaITImpl();
         
         entry.addControl( control );
         



Mime
View raw message