directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1067046 - in /directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap: codec/ codec/controls/cascade/ codec/controls/manageDsaIT/ codec/controls/search/entryChange/ codec/controls/search/pagedSearch/ codec/controls...
Date Fri, 04 Feb 2011 00:36:05 GMT
Author: akarasulu
Date: Fri Feb  4 00:36:04 2011
New Revision: 1067046

URL: http://svn.apache.org/viewvc?rev=1067046&view=rev
Log:
DIRSERVER-81:

  o adding documentation
  o formatting and cleanup
  o removing unused methods
  o now the default codec service checks automatically for double decoration
    so there is no need to be doing it inside the control factories themselves


Modified:
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IControlFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/cascade/CascadeFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/manageDsaIT/ManageDsaITFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/entryChange/EntryChangeFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/pagedSearch/PagedResultsFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/persistentSearch/PersistentSearchFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/subentries/SubentriesFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java
    directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
Fri Feb  4 00:36:04 2011
@@ -184,26 +184,16 @@ public class DefaultLdapCodecService imp
     /**
      * {@inheritDoc}
      */
-    @SuppressWarnings("unchecked")
     public ICodecControl<? extends Control> newControl( String oid )
     {
-        try
-        {
-            IControlFactory<?,?> factory = controlFactories.get( oid );
-            
-            if ( factory == null )
-            {
-                return new BasicControlDecorator<Control>( this, new OpaqueControl(
oid ) );
-            }
-            
-            return factory.newCodecControl();
-        }
-        catch ( SecurityException e )
+        IControlFactory<?,?> factory = controlFactories.get( oid );
+        
+        if ( factory == null )
         {
-            e.printStackTrace();
+            return new BasicControlDecorator<Control>( this, new OpaqueControl( oid
) );
         }
         
-        return null;
+        return factory.newCodecControl();
     }
 
 
@@ -212,23 +202,25 @@ public class DefaultLdapCodecService imp
      */
     public ICodecControl<? extends Control> newControl( Control control )
     {
-        try
+        if ( control == null )
+        {
+            throw new NullPointerException( "Control argument was null." );
+        }
+        
+        // protect agains being multiply decorated
+        if ( control instanceof ICodecControl )
         {
-            IControlFactory factory = controlFactories.get( control.getOid() );
-            
-            if ( factory == null )
-            {
-                return new BasicControlDecorator<Control>( this, control ); 
-            }
-            
-            return factory.newCodecControl( control );
+            return ( ICodecControl<?> )control;
         }
-        catch ( SecurityException e )
+        
+        IControlFactory factory = controlFactories.get( control.getOid() );
+        
+        if ( factory == null )
         {
-            e.printStackTrace();
+            return new BasicControlDecorator<Control>( this, control ); 
         }
         
-        return null;
+        return factory.newCodecControl( control );
     }
 
 

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IControlFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IControlFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IControlFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IControlFactory.java
Fri Feb  4 00:36:04 2011
@@ -60,19 +60,4 @@ public interface IControlFactory<C exten
      * @return The decorator wrapping the Control.
      */
     D newCodecControl( C control );
-
-
-    /**
-     * Same as the {@link #newCodecControl()} but returns the decorated object using
-     * the Control interface sub-type. Or do we really want that?
-     *
-     * @TODO isn't this totally superfluous? If the codec needs to get a handle on
-     * the original control object it can get that when it likes. If it needs to
-     * decorate it can do so. Must investigate why this is here and if we can remove
-     * it. This might be for efficiency - not to have to unnecessarily create a new
-     * decorator when all the codec wants is the control object.
-     *
-     * @return
-     */
-    C newControl();
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/cascade/CascadeFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/cascade/CascadeFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/cascade/CascadeFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/cascade/CascadeFactory.java
Fri Feb  4 00:36:04 2011
@@ -74,13 +74,4 @@ public class CascadeFactory implements I
     {
         return new CascadeDecorator( codec, control );
     }
-
-    
-    /**
-     * {@inheritDoc}
-     */
-    public Cascade newControl()
-    {
-        return new CascadeImpl();
-    }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/manageDsaIT/ManageDsaITFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/manageDsaIT/ManageDsaITFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/manageDsaIT/ManageDsaITFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/manageDsaIT/ManageDsaITFactory.java
Fri Feb  4 00:36:04 2011
@@ -74,13 +74,4 @@ public class ManageDsaITFactory implemen
     {
         return new ManageDsaITDecorator( codec, control );
     }
-    
-
-    /**
-     * {@inheritDoc}
-     */
-    public ManageDsaIT newControl()
-    {
-        return new ManageDsaITImpl();
-    }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/entryChange/EntryChangeFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/entryChange/EntryChangeFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/entryChange/EntryChangeFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/entryChange/EntryChangeFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.EntryChange;
-import org.apache.directory.shared.ldap.model.message.controls.EntryChangeImpl;
 
 
 /**
@@ -74,13 +73,4 @@ public class EntryChangeFactory implemen
     {
         return new EntryChangeDecorator( codec, control );
     }
-
-    
-    /**
-     * {@inheritDoc}
-     */
-    public EntryChange newControl()
-    {
-        return new EntryChangeImpl();
-    }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/pagedSearch/PagedResultsFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/pagedSearch/PagedResultsFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/pagedSearch/PagedResultsFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/pagedSearch/PagedResultsFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResults;
-import org.apache.directory.shared.ldap.model.message.controls.PagedResultsImpl;
 
 
 /**
@@ -74,13 +73,4 @@ public class PagedResultsFactory impleme
     {
         return new PagedResultsDecorator( codec, control );
     }
-
-    
-    /**
-     * {@inheritDoc}
-     */
-    public PagedResults newControl()
-    {
-        return new PagedResultsImpl();
-    }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/persistentSearch/PersistentSearchFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/persistentSearch/PersistentSearchFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/persistentSearch/PersistentSearchFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/persistentSearch/PersistentSearchFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.PersistentSearch;
-import org.apache.directory.shared.ldap.model.message.controls.PersistentSearchImpl;
 
 
 /**
@@ -66,23 +65,6 @@ public class PersistentSearchFactory imp
      */
     public PersistentSearchDecorator newCodecControl( PersistentSearch control )
     {
-        // protect against double decoration
-        if ( control instanceof PersistentSearchDecorator )
-        {
-            return ( PersistentSearchDecorator ) control;
-        }
-        else 
-        {
-            return new PersistentSearchDecorator( codec, control );
-        }
-    }
-
-    
-    /**
-     * {@inheritDoc}
-     */
-    public PersistentSearch newControl()
-    {
-        return new PersistentSearchImpl();
+        return new PersistentSearchDecorator( codec, control );
     }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/subentries/SubentriesFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/subentries/SubentriesFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/subentries/SubentriesFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/search/subentries/SubentriesFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.Subentries;
-import org.apache.directory.shared.ldap.model.message.controls.SubentriesImpl;
 
 
 /**
@@ -74,23 +73,8 @@ public class SubentriesFactory implement
      * 
      * {@inheritDoc}
      */
-    public Subentries newControl()
-    {
-        return new SubentriesImpl();
-    }
-
-    
-    /**
-     * 
-     * {@inheritDoc}
-     */
     public SubentriesDecorator newCodecControl( Subentries control )
     {
-        if ( ! control.getOid().equals( Subentries.OID ) )
-        {
-            throw new IllegalArgumentException( "Bad control provided: " + control );
-        }
-        
         return new SubentriesDecorator( codec, control );
     }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/ppolicy_impl/PasswordPolicyFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.extras.controls.PasswordPolicy;
-import org.apache.directory.shared.ldap.extras.controls.PasswordPolicyImpl;
 
 
 /**
@@ -74,28 +73,6 @@ public class PasswordPolicyFactory imple
      */
     public PasswordPolicyDecorator newCodecControl( PasswordPolicy control )
     {
-        PasswordPolicyDecorator decorator = null;
-        
-        // protect against double decoration
-        if ( control instanceof PasswordPolicyDecorator )
-        {
-            decorator = ( PasswordPolicyDecorator ) control;
-        }
-        else
-        {
-            decorator = new PasswordPolicyDecorator( codec, control );
-        }
-        
-        return decorator;
-    }
-
-    
-    /**
-     * 
-     * {@inheritDoc}
-     */
-    public PasswordPolicy newControl()
-    {
-        return new PasswordPolicyImpl();
+        return new PasswordPolicyDecorator( codec, control );
     }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncDoneValueFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.extras.controls.SyncDoneValue;
-import org.apache.directory.shared.ldap.extras.controls.SyncDoneValueImpl;
 
 
 /**
@@ -34,13 +33,14 @@ import org.apache.directory.shared.ldap.
  */
 public class SyncDoneValueFactory implements IControlFactory<SyncDoneValue, SyncDoneValueDecorator>
 {
-    
+    /** The codec for this factory */
     private ILdapCodecService codec;
     
 
     /**
      * Creates a new instance of SyncDoneValueFactory.
      *
+     * @param codec The codec for this factory.
      */
     public SyncDoneValueFactory( ILdapCodecService codec )
     {
@@ -49,7 +49,6 @@ public class SyncDoneValueFactory implem
     
 
     /**
-     * 
      * {@inheritDoc}
      */
     public String getOid()
@@ -59,7 +58,6 @@ public class SyncDoneValueFactory implem
 
     
     /**
-     * 
      * {@inheritDoc}
      */
     public SyncDoneValueDecorator newCodecControl()
@@ -68,26 +66,11 @@ public class SyncDoneValueFactory implem
     }
     
 
+    /**
+     * {@inheritDoc}
+     */
     public SyncDoneValueDecorator newCodecControl( SyncDoneValue control )
     {
-        SyncDoneValueDecorator decorator = null;
-        
-        // protect against double decoration
-        if ( control instanceof SyncDoneValueDecorator )
-        {
-            decorator = ( SyncDoneValueDecorator ) control;
-        }
-        else
-        {
-            decorator = new SyncDoneValueDecorator( codec, control );
-        }
-        
-        return decorator;
-    }
-
-    
-    public SyncDoneValue newControl()
-    {
-        return new SyncDoneValueImpl();
+        return new SyncDoneValueDecorator( codec, control );
     }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncInfoValueFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.extras.controls.SyncInfoValue;
-import org.apache.directory.shared.ldap.extras.controls.SyncInfoValueImpl;
 
 
 /**
@@ -41,6 +40,7 @@ public class SyncInfoValueFactory implem
     /**
      * Creates a new instance of SyncInfoValueFactory.
      *
+     * @param codec The codec for this factory.
      */
     public SyncInfoValueFactory( ILdapCodecService codec )
     {
@@ -49,7 +49,6 @@ public class SyncInfoValueFactory implem
     
 
     /**
-     * 
      * {@inheritDoc}
      */
     public String getOid()
@@ -59,7 +58,6 @@ public class SyncInfoValueFactory implem
 
     
     /**
-     * 
      * {@inheritDoc}
      */
     public SyncInfoValueDecorator newCodecControl()
@@ -68,26 +66,11 @@ public class SyncInfoValueFactory implem
     }
     
 
+    /**
+     * {@inheritDoc}
+     */
     public SyncInfoValueDecorator newCodecControl( SyncInfoValue control )
     {
-        SyncInfoValueDecorator decorator = null;
-        
-        // protect against double decoration
-        if ( control instanceof SyncInfoValueDecorator )
-        {
-            decorator = ( SyncInfoValueDecorator ) control;
-        }
-        else
-        {
-            decorator = new SyncInfoValueDecorator( codec, control );
-        }
-        
-        return decorator;
-    }
-
-    
-    public SyncInfoValue newControl()
-    {
-        return new SyncInfoValueImpl();
+        return new SyncInfoValueDecorator( codec, control );
     }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncModifyDnFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.extras.controls.SyncModifyDn;
-import org.apache.directory.shared.ldap.extras.controls.SyncModifyDnImpl;
 
 
 /**
@@ -41,6 +40,7 @@ public class SyncModifyDnFactory impleme
     /**
      * Creates a new instance of SyncModifyDnFactory.
      *
+     * @param codec The codec for this factory.
      */
     public SyncModifyDnFactory( ILdapCodecService codec )
     {
@@ -49,7 +49,6 @@ public class SyncModifyDnFactory impleme
     
 
     /**
-     * 
      * {@inheritDoc}
      */
     public String getOid()
@@ -59,7 +58,6 @@ public class SyncModifyDnFactory impleme
 
     
     /**
-     * 
      * {@inheritDoc}
      */
     public SyncModifyDnDecorator newCodecControl()
@@ -68,26 +66,11 @@ public class SyncModifyDnFactory impleme
     }
     
 
+    /**
+     * {@inheritDoc}
+     */
     public SyncModifyDnDecorator newCodecControl( SyncModifyDn control )
     {
-        SyncModifyDnDecorator decorator = null;
-        
-        // protect against double decoration
-        if ( control instanceof SyncModifyDnDecorator )
-        {
-            decorator = ( SyncModifyDnDecorator ) control;
-        }
-        else
-        {
-            decorator = new SyncModifyDnDecorator( codec, control );
-        }
-        
-        return decorator;
-    }
-
-    
-    public SyncModifyDn newControl()
-    {
-        return new SyncModifyDnImpl();
+        return new SyncModifyDnDecorator( codec, control );
     }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncRequestValueFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.extras.controls.SyncRequestValue;
-import org.apache.directory.shared.ldap.extras.controls.SyncRequestValueImpl;
 
 
 /**
@@ -34,13 +33,14 @@ import org.apache.directory.shared.ldap.
  */
 public class SyncRequestValueFactory implements IControlFactory<SyncRequestValue, SyncRequestValueDecorator>
 {
-    
+    /** The codec for this factory */
     private ILdapCodecService codec;
     
 
     /**
      * Creates a new instance of SyncRequestValueFactory.
      *
+     * @param codec The codec for this factory.
      */
     public SyncRequestValueFactory( ILdapCodecService codec )
     {
@@ -49,7 +49,6 @@ public class SyncRequestValueFactory imp
     
 
     /**
-     * 
      * {@inheritDoc}
      */
     public String getOid()
@@ -59,7 +58,6 @@ public class SyncRequestValueFactory imp
 
     
     /**
-     * 
      * {@inheritDoc}
      */
     public SyncRequestValueDecorator newCodecControl()
@@ -68,26 +66,11 @@ public class SyncRequestValueFactory imp
     }
     
 
+    /**
+     * {@inheritDoc}
+     */
     public SyncRequestValueDecorator newCodecControl( SyncRequestValue control )
     {
-        SyncRequestValueDecorator decorator = null;
-        
-        // protect against double decoration
-        if ( control instanceof SyncRequestValueDecorator )
-        {
-            decorator = ( SyncRequestValueDecorator ) control;
-        }
-        else
-        {
-            decorator = new SyncRequestValueDecorator( codec, control );
-        }
-        
-        return decorator;
-    }
-
-    
-    public SyncRequestValue newControl()
-    {
-        return new SyncRequestValueImpl();
+        return new SyncRequestValueDecorator( codec, control );
     }
 }

Modified: directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java?rev=1067046&r1=1067045&r2=1067046&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java
(original)
+++ directory/shared/branches/m1/ldap/src/main/java/org/apache/directory/shared/ldap/extras/controls/syncrepl_impl/SyncStateValueFactory.java
Fri Feb  4 00:36:04 2011
@@ -23,7 +23,6 @@ package org.apache.directory.shared.ldap
 import org.apache.directory.shared.ldap.codec.IControlFactory;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.extras.controls.SyncStateValue;
-import org.apache.directory.shared.ldap.extras.controls.SyncStateValueImpl;
 
 
 /**
@@ -34,12 +33,14 @@ import org.apache.directory.shared.ldap.
  */
 public class SyncStateValueFactory implements IControlFactory<SyncStateValue, SyncStateValueDecorator>
 {
+    /** The codec for this factory */
     private ILdapCodecService codec;
     
 
     /**
      * Creates a new instance of SyncStateValueFactory.
      *
+     * @param codec The codec for this factory.
      */
     public SyncStateValueFactory( ILdapCodecService codec )
     {
@@ -48,7 +49,6 @@ public class SyncStateValueFactory imple
     
 
     /**
-     * 
      * {@inheritDoc}
      */
     public String getOid()
@@ -58,7 +58,6 @@ public class SyncStateValueFactory imple
 
     
     /**
-     * 
      * {@inheritDoc}
      */
     public SyncStateValueDecorator newCodecControl()
@@ -67,26 +66,11 @@ public class SyncStateValueFactory imple
     }
     
 
+    /**
+     * {@inheritDoc}
+     */
     public SyncStateValueDecorator newCodecControl( SyncStateValue control )
     {
-        SyncStateValueDecorator decorator = null;
-        
-        // protect against double decoration
-        if ( control instanceof SyncStateValueDecorator )
-        {
-            decorator = ( SyncStateValueDecorator ) control;
-        }
-        else
-        {
-            decorator = new SyncStateValueDecorator( codec, control );
-        }
-        
-        return decorator;
-    }
-
-    
-    public SyncStateValue newControl()
-    {
-        return new SyncStateValueImpl();
+        return new SyncStateValueDecorator( codec, control );
     }
 }



Mime
View raw message