directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1065306 [2/3] - in /directory/shared/trunk: dsml-engine/src/main/java/org/apache/directory/shared/dsmlv2/engine/ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/rep...
Date Sun, 30 Jan 2011 15:42:39 GMT
Modified: directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java (original)
+++ directory/shared/trunk/dsml-parser/src/test/java/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/SearchResultReferenceTest.java Sun Jan 30 15:42:36 2011
@@ -85,7 +85,7 @@ public class SearchResultReferenceTest e
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertEquals( "Some text", Strings.utf8ToString((byte[]) control.getValue()) );
+        assertEquals( "Some text", Strings.utf8ToString((byte[]) getCodec().decorate( control ).getValue()) );
     }
 
 
@@ -121,7 +121,7 @@ public class SearchResultReferenceTest e
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.643", control.getOid() );
-        assertFalse( control.hasValue() );
+        assertFalse( getCodec().decorate( control ).hasValue() );
     }
 
 
@@ -156,7 +156,7 @@ public class SearchResultReferenceTest e
 
         assertNotNull( control );
         assertEquals( "1.2.840.113556.1.4.789", control.getOid() );
-        assertEquals( "Some other text", Strings.utf8ToString((byte[]) control.getValue()) );
+        assertEquals( "Some other text", Strings.utf8ToString((byte[]) getCodec().decorate( control ).getValue()) );
     }
 
 
@@ -192,7 +192,7 @@ public class SearchResultReferenceTest e
         assertNotNull( control );
         assertTrue( control.isCritical() );
         assertEquals( "1.2.840.113556.1.4.456", control.getOid() );
-        assertFalse( control.hasValue() );
+        assertFalse( getCodec().decorate( control ).hasValue() );
     }
 
 

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapConnection.java Sun Jan 30 15:42:36 2011
@@ -24,6 +24,7 @@ import java.io.IOException;
 import java.util.List;
 
 import org.apache.directory.shared.asn1.util.OID;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.cursor.SearchCursor;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Modification;
@@ -32,7 +33,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.message.*;
-import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
@@ -725,7 +725,16 @@ public interface LdapConnection
      */
     SchemaManager getSchemaManager();
 
-
+    
+    /**
+     * Gets the LDAP CODEC service responsible for encoding and decoding 
+     * messages.
+     * 
+     * @return The LDAP CODEC service.
+     */
+    ILdapCodecService getCodecService();
+    
+    
     /**
      * Checks if there is a ResponseFuture associated with the given message ID.
      *

Modified: directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java (original)
+++ directory/shared/trunk/ldap-client-api/src/main/java/org/apache/directory/ldap/client/api/LdapNetworkConnection.java Sun Jan 30 15:42:36 2011
@@ -3252,6 +3252,15 @@ public class LdapNetworkConnection exten
     /**
      * {@inheritDoc}
      */
+    public ILdapCodecService getCodecService()
+    {
+        return codec;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
     public SchemaManager getSchemaManager()
     {
         return schemaManager;

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/DefaultLdapCodecService.java Sun Jan 30 15:42:36 2011
@@ -27,11 +27,9 @@ import java.util.Map;
 
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesDecorator;
 import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesFactory;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.controls.Subentries;
-import org.apache.directory.shared.ldap.model.message.controls.SubentriesImpl;
 import org.apache.mina.filter.codec.ProtocolCodecFactory;
 
 
@@ -59,7 +57,7 @@ public class DefaultLdapCodecService imp
      */
     private void loadStockControls()
     {
-        SubentriesFactory subentriesFactory = new SubentriesFactory();
+        SubentriesFactory subentriesFactory = new SubentriesFactory( this );
         controlFactories.put( Subentries.OID, subentriesFactory );
 
         

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/IDecorator.java Sun Jan 30 15:42:36 2011
@@ -56,4 +56,13 @@ public interface IDecorator<E>
      * @throws EncoderException if the buffer can't be encoded
      */
     ByteBuffer encode( ByteBuffer buffer ) throws EncoderException;
+    
+    
+    /**
+     * Gets the codec service responsible for managing the encoding and 
+     * decoding of the decorated objects.
+     * 
+     * @return the codec service
+     */
+    ILdapCodecService getCodecService();
 }

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=1065306&r1=1065305&r2=1065306&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 15:42:36 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.Cascade;
 
 
@@ -35,9 +36,9 @@ public class CascadeDecorator extends Co
     /**
      * Default constructor
      */
-    public CascadeDecorator()
+    public CascadeDecorator( ILdapCodecService codec )
     {
-        super( Cascade.INSTANCE );
+        super( codec, Cascade.INSTANCE );
     }
 
     

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlDecorator.java Sun Jan 30 15:42:36 2011
@@ -32,6 +32,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.ICodecControl;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.util.Strings;
 
@@ -58,6 +59,9 @@ public abstract class ControlDecorator<E
 
     /** The encoded value of the control. */
     private byte[] value;
+    
+    /** The codec service responsible for encoding decoding this object */
+    private ILdapCodecService codec;
 
     
     /**
@@ -65,9 +69,10 @@ public abstract class ControlDecorator<E
      *
      * @param decoratedControl The Control to decorate.
      */
-    public ControlDecorator( E decoratedControl )
+    public ControlDecorator( ILdapCodecService codec, E decoratedControl )
     {
         this.decorated = decoratedControl;
+        this.codec = codec;
     }
 
 
@@ -117,6 +122,15 @@ public abstract class ControlDecorator<E
         this.decorated = decorated;
     }
     
+    
+    /**
+     * {@inheritDoc}
+     */
+    public ILdapCodecService getCodecService()
+    {
+        return codec;
+    }
+    
 
     // ------------------------------------------------------------------------
     // Control Methods

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=1065306&r1=1065305&r2=1065306&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 15:42:36 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaIT;
 
 
@@ -42,9 +43,9 @@ public class ManageDsaITDecorator extend
     /**
      * Default constructor
      */
-    public ManageDsaITDecorator()
+    public ManageDsaITDecorator( ILdapCodecService codec )
     {
-        super( ManageDsaIT.INSTANCE );
+        super( codec, ManageDsaIT.INSTANCE );
     }
 
 

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=1065306&r1=1065305&r2=1065306&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 15:42:36 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.ldap
 
 import org.apache.directory.shared.asn1.Asn1Object;
 import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 
 
@@ -33,9 +34,9 @@ import org.apache.directory.shared.ldap.
 public class PasswordPolicyRequestDecorator extends ControlDecorator<IPasswordPolicyRequest> 
     implements IPasswordPolicyRequest
 {
-    public PasswordPolicyRequestDecorator()
+    public PasswordPolicyRequestDecorator( ILdapCodecService codec )
     {
-        super( IPasswordPolicyRequest.INSTANCE );
+        super( codec, IPasswordPolicyRequest.INSTANCE );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseContainer.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseContainer.java Sun Jan 30 15:42:36 2011
@@ -22,6 +22,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 
 
 /**
@@ -34,20 +35,20 @@ public class PasswordPolicyResponseConta
     private PasswordPolicyResponseDecorator control;
 
 
-    public PasswordPolicyResponseContainer()
+    public PasswordPolicyResponseContainer( ILdapCodecService codec )
     {
         super();
-        control = new PasswordPolicyResponseDecorator( new PasswordPolicyResponseDecorator() );
+        control = new PasswordPolicyResponseDecorator( codec, new PasswordPolicyResponseDecorator( codec ) );
         stateStack = new int[1];
         grammar = PasswordPolicyResponseGrammar.getInstance();
         setTransition( PasswordPolicyResponseStates.START_STATE );
     }
 
 
-    public PasswordPolicyResponseContainer( IPasswordPolicyResponse ppolicyResponse )
+    public PasswordPolicyResponseContainer( ILdapCodecService codec, IPasswordPolicyResponse ppolicyResponse )
     {
         super();
-        control = new PasswordPolicyResponseDecorator( ppolicyResponse );
+        control = new PasswordPolicyResponseDecorator( codec, ppolicyResponse );
         stateStack = new int[1];
         grammar = PasswordPolicyResponseGrammar.getInstance();
         setTransition( PasswordPolicyResponseStates.START_STATE );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseDecorator.java Sun Jan 30 15:42:36 2011
@@ -30,6 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 
 
@@ -42,7 +43,7 @@ public class PasswordPolicyResponseDecor
 {
     /** An instance of this decoder */
     private static final Asn1Decoder decoder = new Asn1Decoder();
-
+    
     // Storage for computed lengths
     private transient int valueLength = 0;
     private transient int ppolicySeqLength = 0;
@@ -51,15 +52,15 @@ public class PasswordPolicyResponseDecor
     private transient int graceAuthNsRemainingTagLength;
     
     
-    public PasswordPolicyResponseDecorator()
+    public PasswordPolicyResponseDecorator( ILdapCodecService codec )
     {
-        super( new PasswordPolicyResponse() );
+        super( codec, new PasswordPolicyResponse() );
     }
 
 
-    public PasswordPolicyResponseDecorator( IPasswordPolicyResponse response )
+    public PasswordPolicyResponseDecorator( ILdapCodecService codec, IPasswordPolicyResponse response )
     {
-        super( response );
+        super( codec, response );
     }
 
 
@@ -240,7 +241,7 @@ public class PasswordPolicyResponseDecor
     public Asn1Object decode( byte[] controlBytes ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( this );
+        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( getCodecService(), this );
         decoder.decode( bb, container );
         return this;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java Sun Jan 30 15:42:36 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 
 
 /**
@@ -34,16 +35,19 @@ public class SyncDoneValueContainer exte
     /** syncDoneValue*/
     private SyncDoneValueDecorator control;
 
-
+    private ILdapCodecService codec;
+    
+    
     /**
      * 
      * Creates a new SyncDoneValueControlContainer object.
      *
      */
-    public SyncDoneValueContainer()
+    public SyncDoneValueContainer( ILdapCodecService codec )
     {
         super();
-        this.control = new SyncDoneValueDecorator();
+        this.codec = codec;
+        this.control = new SyncDoneValueDecorator( codec );
         stateStack = new int[1];
         grammar = SyncDoneValueGrammar.getInstance();
         setTransition( SyncDoneValueStatesEnum.START_STATE );
@@ -55,9 +59,10 @@ public class SyncDoneValueContainer exte
      * Creates a new SyncDoneValueControlContainer object.
      *
      */
-    public SyncDoneValueContainer( SyncDoneValueDecorator control )
+    public SyncDoneValueContainer( ILdapCodecService codec, SyncDoneValueDecorator control )
     {
         super();
+        this.codec = codec;
         this.control = control;
         stateStack = new int[1];
         grammar = SyncDoneValueGrammar.getInstance();
@@ -85,6 +90,12 @@ public class SyncDoneValueContainer exte
         this.control = control;
     }
 
+    
+    public ILdapCodecService getCodecService()
+    {
+        return codec;
+    }
+    
 
     /**
      * clean the container

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java Sun Jan 30 15:42:36 2011
@@ -31,6 +31,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.util.Strings;
 
@@ -54,9 +55,9 @@ public class SyncDoneValueDecorator exte
     /**
      * Creates a new instance of SyncDoneValueControlCodec.
      */
-    public SyncDoneValueDecorator()
+    public SyncDoneValueDecorator( ILdapCodecService codec )
     {
-        super( new SyncDoneValue() );
+        super( codec, new SyncDoneValue() );
     }
     
 
@@ -252,7 +253,7 @@ public class SyncDoneValueDecorator exte
     public Asn1Object decode( byte[] controlBytes ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        SyncDoneValueContainer container = new SyncDoneValueContainer( this );
+        SyncDoneValueContainer container = new SyncDoneValueContainer( getCodecService(), this );
         decoder.decode( bb, container );
         return this;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueContainer.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueContainer.java Sun Jan 30 15:42:36 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 
 
 /**
@@ -33,15 +34,18 @@ public class SyncInfoValueContainer exte
     /** SyncInfoValueControl */
     private SyncInfoValueDecorator control;
 
+    private ILdapCodecService codec;
 
+    
     /**
      * Creates a new SyncInfoValueControlContainer object. We will store one grammar,
      * it's enough ...
      */
-    public SyncInfoValueContainer()
+    public SyncInfoValueContainer( ILdapCodecService codec )
     {
         super();
-        this.control = new SyncInfoValueDecorator();
+        this.codec = codec;
+        this.control = new SyncInfoValueDecorator( codec );
         stateStack = new int[1];
         grammar = SyncInfoValueGrammar.getInstance();
         setTransition( SyncInfoValueStatesEnum.START_STATE );
@@ -52,9 +56,10 @@ public class SyncInfoValueContainer exte
      * Creates a new SyncInfoValueControlContainer object. We will store one grammar,
      * it's enough ...
      */
-    public SyncInfoValueContainer( SyncInfoValueDecorator control )
+    public SyncInfoValueContainer( ILdapCodecService codec, SyncInfoValueDecorator control )
     {
         super();
+        this.codec = codec;
         this.control = control;
         stateStack = new int[1];
         grammar = SyncInfoValueGrammar.getInstance();
@@ -83,6 +88,12 @@ public class SyncInfoValueContainer exte
     }
 
     
+    public ILdapCodecService getCodecService()
+    {
+        return codec;
+    }
+    
+    
     /**
      * Clean the container
      */

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueDecorator.java Sun Jan 30 15:42:36 2011
@@ -33,6 +33,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
 import org.apache.directory.shared.util.Strings;
@@ -45,7 +46,7 @@ import org.apache.directory.shared.util.
  */
 public class SyncInfoValueDecorator extends ControlDecorator<ISyncInfoValue> implements ISyncInfoValue
 {
-    /** The syncUUIDs cumulative lentgh */
+    /** The syncUUIDs cumulative length */
     private int syncUUIDsLength;
     
     private byte[] value;
@@ -57,9 +58,9 @@ public class SyncInfoValueDecorator exte
     /**
      * The constructor for this codec. Dont't forget to set the type.
      */
-    public SyncInfoValueDecorator()
+    public SyncInfoValueDecorator( ILdapCodecService codec )
     {
-        super( new SyncInfoValue() );
+        super( codec, new SyncInfoValue() );
     }
     
     
@@ -68,9 +69,9 @@ public class SyncInfoValueDecorator exte
      * @param type The kind of syncInfo we will store. Can be newCookie, 
      * refreshPresent, refreshDelete or syncIdSet
      */
-    public SyncInfoValueDecorator( SynchronizationInfoEnum type )
+    public SyncInfoValueDecorator( ILdapCodecService codec, SynchronizationInfoEnum type )
     {
-        this();
+        this( codec );
 
         setType( type);
     }
@@ -659,7 +660,7 @@ public class SyncInfoValueDecorator exte
     public Asn1Object decode( byte[] controlBytes ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        SyncInfoValueContainer container = new SyncInfoValueContainer( this );
+        SyncInfoValueContainer container = new SyncInfoValueContainer( getCodecService(), this );
         decoder.decode( bb, container );
         return this;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncInfoValue/SyncInfoValueGrammar.java Sun Jan 30 15:42:36 2011
@@ -98,7 +98,8 @@ public final class SyncInfoValueGrammar 
             {
                 public void action( SyncInfoValueContainer container )
                 {
-                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
+                    SyncInfoValueDecorator control = 
+                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.NEW_COOKIE);
                     
                     Value value = container.getCurrentTLV().getValue();
 
@@ -136,6 +137,11 @@ public final class SyncInfoValueGrammar 
             {
                 public void action( SyncInfoValueContainer container )
                 {
+                    SyncInfoValueDecorator control = 
+                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.REFRESH_DELETE);
+                    
+                    container.setSyncInfoValueControl( control );
+
                     // We can have an END transition
                     container.setGrammarEndAllowed( true );
                 }
@@ -297,7 +303,10 @@ public final class SyncInfoValueGrammar 
             {
                 public void action( SyncInfoValueContainer container )
                 {
-                    SyncInfoValueDecorator control = container.getSyncInfoValueControl();
+                    SyncInfoValueDecorator control = 
+                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.REFRESH_PRESENT);
+                    
+                    container.setSyncInfoValueControl( control );
 
                     // We can have an END transition
                     container.setGrammarEndAllowed( true );
@@ -456,7 +465,17 @@ public final class SyncInfoValueGrammar 
         super.transitions[SyncInfoValueStatesEnum.START_STATE.ordinal()][SyncInfoValueTags.SYNC_ID_SET_TAG.getValue()] = 
             new GrammarTransition( SyncInfoValueStatesEnum.START_STATE, 
                                     SyncInfoValueStatesEnum.SYNC_ID_SET_STATE, 
-                                    SyncInfoValueTags.SYNC_ID_SET_TAG.getValue(), null );
+                                    SyncInfoValueTags.SYNC_ID_SET_TAG.getValue(), 
+                new GrammarAction<SyncInfoValueContainer>( "SyncIdSet choice for SyncInfoValueControl" )
+            {
+                public void action( SyncInfoValueContainer container )
+                {
+                    SyncInfoValueDecorator control = 
+                        new SyncInfoValueDecorator( container.getCodecService(), SynchronizationInfoEnum.SYNC_ID_SET);
+                    
+                    container.setSyncInfoValueControl( control );
+                }
+            } );
         
         
         /** 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueDecorator.java Sun Jan 30 15:42:36 2011
@@ -31,6 +31,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;
 import org.apache.directory.shared.util.Strings;
@@ -53,15 +54,15 @@ public class SyncRequestValueDecorator  
     private static final Asn1Decoder decoder = new Asn1Decoder();
 
     
-    public SyncRequestValueDecorator()
+    public SyncRequestValueDecorator( ILdapCodecService codec )
     {
-        super( new SyncRequestValue() );
+        super( codec, new SyncRequestValue() );
     }
 
     
-    public SyncRequestValueDecorator( ISyncRequestValue control )
+    public SyncRequestValueDecorator( ILdapCodecService codec, ISyncRequestValue control )
     {
-        super( control );
+        super( codec, control );
     }
 
     

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueDecorator.java Sun Jan 30 15:42:36 2011
@@ -31,6 +31,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
 import org.apache.directory.shared.util.Strings;
@@ -53,15 +54,15 @@ public class SyncStateValueDecorator ext
     private static final Asn1Decoder decoder = new Asn1Decoder();
 
     
-    public SyncStateValueDecorator()
+    public SyncStateValueDecorator( ILdapCodecService codec )
     {
-        super( new SyncStateValue() );
+        super( codec, new SyncStateValue() );
     }
 
     
-    public SyncStateValueDecorator( ISyncStateValue value )
+    public SyncStateValueDecorator( ILdapCodecService codec, ISyncStateValue value )
     {
-        super( value );
+        super( codec, value );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java Sun Jan 30 15:42:36 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 
 
 /**
@@ -38,10 +39,10 @@ public class SyncModifyDnContainer exten
      * Creates a new SyncStateValueControlContainer object. We will store one grammar,
      * it's enough ...
      */
-    public SyncModifyDnContainer()
+    public SyncModifyDnContainer( ILdapCodecService codec )
     {
         super();
-        this.control = new SyncModifyDnDecorator();
+        this.control = new SyncModifyDnDecorator( codec );
         stateStack = new int[1];
         grammar = SyncModifyDnGrammar.getInstance();
         setTransition( SyncModifyDnStatesEnum.START_SYNC_MODDN );

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java Sun Jan 30 15:42:36 2011
@@ -31,6 +31,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.asn1.util.Asn1StringUtils;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
 
@@ -75,15 +76,15 @@ public class SyncModifyDnDecorator exten
     private Asn1Decoder decoder = new Asn1Decoder();
 
     
-    public SyncModifyDnDecorator()
+    public SyncModifyDnDecorator( ILdapCodecService codec )
     {
-        super( new SyncModifyDn() );
+        super( codec, new SyncModifyDn() );
     }
 
     
-    public SyncModifyDnDecorator( SyncModifyDnType type )
+    public SyncModifyDnDecorator( ILdapCodecService codec, SyncModifyDnType type )
     {
-        this();
+        this( codec );
         this.modDnType = type;
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/LdapResultDecorator.java Sun Jan 30 15:42:36 2011
@@ -29,6 +29,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
 import org.apache.directory.shared.ldap.codec.IDecorator;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.LdapEncoder;
 import org.apache.directory.shared.ldap.model.message.LdapResult;
 import org.apache.directory.shared.ldap.model.message.Referral;
@@ -52,6 +53,9 @@ public class LdapResultDecorator impleme
 
     /** Temporary storage of the byte[] representing the matchedDN */
     private byte[] matchedDnBytes;
+    
+    /** The codec responsible for encoding and decoding this object. */
+    private ILdapCodecService codec;
 
 
     /**
@@ -312,4 +316,13 @@ public class LdapResultDecorator impleme
     {
         return decoratedLdapResult;
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ILdapCodecService getCodecService()
+    {
+        return codec;
+    }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/decorators/MessageDecorator.java Sun Jan 30 15:42:36 2011
@@ -20,11 +20,9 @@
 package org.apache.directory.shared.ldap.codec.decorators;
 
 
-import java.nio.ByteBuffer;
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.directory.shared.asn1.EncoderException;
 import org.apache.directory.shared.ldap.codec.ICodecControl;
 import org.apache.directory.shared.ldap.codec.IDecorator;
 import org.apache.directory.shared.ldap.codec.ILdapCodecService;
@@ -397,14 +395,11 @@ public abstract class MessageDecorator<E
     }
     
 
-    public int computeLength()
-    {
-        return 0;
-    }
-
-
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
+    /**
+     * {@inheritDoc}
+     */
+    public ILdapCodecService getCodecService()
     {
-        return null;
+        return codec;
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeContainer.java Sun Jan 30 15:42:36 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.EntryChange;
 
 
@@ -31,15 +32,19 @@ public class EntryChangeContainer extend
 {
     /** EntryChangeControl */
     private EntryChangeDecorator control;
+    
+    /** The codec that encodes and decodes */
+    private ILdapCodecService codec;
 
 
     /**
      * Creates a new EntryChangeContainer object. We will store one
      * grammar, it's enough ...
      */
-    public EntryChangeContainer()
+    public EntryChangeContainer( ILdapCodecService codec )
     {
         super();
+        this.codec = codec;
         stateStack = new int[1];
         grammar = EntryChangeGrammar.getInstance();
         setTransition( EntryChangeStates.START_STATE );
@@ -53,9 +58,9 @@ public class EntryChangeContainer extend
      * @param control The EntryChange ControlDecorator, or a Control to be
      * wrapped by a new decorator.
      */
-    public EntryChangeContainer( EntryChange control )
+    public EntryChangeContainer( ILdapCodecService codec, EntryChange control )
     {
-        this();
+        this( codec );
         decorate( control );
     }
 
@@ -85,7 +90,7 @@ public class EntryChangeContainer extend
         }
         else
         {
-            this.control = new EntryChangeDecorator( control );
+            this.control = new EntryChangeDecorator( codec, control );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/entryChange/EntryChangeDecorator.java Sun Jan 30 15:42:36 2011
@@ -30,6 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.ChangeType;
 import org.apache.directory.shared.ldap.model.message.controls.EntryChange;
@@ -67,9 +68,9 @@ public class EntryChangeDecorator extend
      * Creates a new instance of EntryChangeDecoder wrapping a newly created
      * EntryChange Control object.
      */
-    public EntryChangeDecorator()
+    public EntryChangeDecorator( ILdapCodecService codec )
     {
-        super( new EntryChangeImpl() );
+        super( codec, new EntryChangeImpl() );
     }
 
 
@@ -79,9 +80,9 @@ public class EntryChangeDecorator extend
      *
      * @param control The EntryChange Control to be decorated.
      */
-    public EntryChangeDecorator( EntryChange control )
+    public EntryChangeDecorator( ILdapCodecService codec, EntryChange control )
     {
-        super( control );
+        super( codec, control );
     }
 
 
@@ -272,7 +273,7 @@ public class EntryChangeDecorator extend
     public Asn1Object decode( byte[] controlBytes ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        EntryChangeContainer container = new EntryChangeContainer( this );
+        EntryChangeContainer container = new EntryChangeContainer( getCodecService(), this );
         decoder.decode( bb, container );
         return this;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsContainer.java Sun Jan 30 15:42:36 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResults;
 
 
@@ -33,15 +34,19 @@ public class PagedResultsContainer exten
 {
     /** PagedSearchControl */
     private PagedResultsDecorator control;
+    
+    private ILdapCodecService codec;
 
 
     /**
      * Creates a new PagedSearchControl container object. We will store one grammar,
      * it's enough ...
+     * @param codec The encoder decoder for this container
      */
-    public PagedResultsContainer()
+    public PagedResultsContainer( ILdapCodecService codec )
     {
         super();
+        this.codec = codec;
         stateStack = new int[1];
         grammar = PagedResultsGrammar.getInstance();
         setTransition( PagedResultsStates.START_STATE );
@@ -53,11 +58,12 @@ public class PagedResultsContainer exten
      * Control, which is optionally decorated if is not a decorator already. If it
      * is a decorator then it is used as the decorator for this container.
      *
+     * @param codec The encoder decoder for this container
      * @param control A PagedResults Control to optionally be wrapped.
      */
-    public PagedResultsContainer( PagedResults control )
+    public PagedResultsContainer( ILdapCodecService codec, PagedResults control )
     {
-        this();
+        this( codec );
         decorate( control );
     }
 
@@ -80,7 +86,7 @@ public class PagedResultsContainer exten
         }
         else
         {
-            this.control = new PagedResultsDecorator( control );
+            this.control = new PagedResultsDecorator( codec, control );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResultsDecorator.java Sun Jan 30 15:42:36 2011
@@ -31,6 +31,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResults;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResultsImpl;
@@ -58,9 +59,9 @@ public class PagedResultsDecorator exten
      * Creates a new instance of PagedResultsDecorator with a newly created decorated
      * PagedResults Control.
      */
-    public PagedResultsDecorator()
+    public PagedResultsDecorator( ILdapCodecService codec )
     {
-        this( new PagedResultsImpl() );
+        this( codec, new PagedResultsImpl() );
     }
 
 
@@ -70,9 +71,9 @@ public class PagedResultsDecorator exten
      *
      * @param  pagedResults The PagedResults Control to be decorated.
      */
-    public PagedResultsDecorator( PagedResults pagedResults )
+    public PagedResultsDecorator( ILdapCodecService codec, PagedResults pagedResults )
     {
-        super( pagedResults );
+        super( codec, pagedResults );
     }
 
 
@@ -296,7 +297,7 @@ public class PagedResultsDecorator exten
     public Asn1Object decode( byte[] controlBytes ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        PagedResultsContainer container = new PagedResultsContainer( this );
+        PagedResultsContainer container = new PagedResultsContainer( getCodecService(), this );
         decoder.decode( bb, container );
         return this;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchContainer.java Sun Jan 30 15:42:36 2011
@@ -21,6 +21,7 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.ber.AbstractContainer;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.model.message.controls.PersistentSearch;
 
 
@@ -31,15 +32,18 @@ public class PersistentSearchContainer e
 {
     /** PSearchControl */
     private PersistentSearchDecorator decorator;
+    
+    private ILdapCodecService codec;
 
 
     /**
      * Creates a new PSearchControlContainer object. We will store one grammar,
      * it's enough ...
      */
-    public PersistentSearchContainer()
+    public PersistentSearchContainer( ILdapCodecService codec )
     {
         super();
+        this.codec = codec;
         stateStack = new int[1];
         grammar = PersistentSearchGrammar.getInstance();
         setTransition( PersistentSearchStates.START_STATE );
@@ -53,9 +57,9 @@ public class PersistentSearchContainer e
      *
      * @param control The PersistentSearch Control or a decorating wrapper.
      */
-    public PersistentSearchContainer( PersistentSearch control )
+    public PersistentSearchContainer( ILdapCodecService codec, PersistentSearch control )
     {
-        this();
+        this( codec );
         decorate( control );
     }
 
@@ -74,7 +78,7 @@ public class PersistentSearchContainer e
         }
         else
         {
-            this.decorator = new PersistentSearchDecorator( control );
+            this.decorator = new PersistentSearchDecorator( codec, control );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchDecorator.java Sun Jan 30 15:42:36 2011
@@ -30,6 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.ChangeType;
 import org.apache.directory.shared.ldap.model.message.controls.PersistentSearch;
@@ -57,9 +58,9 @@ public class PersistentSearchDecorator e
      * Default constructor creates a PersistentSearch Control automatically
      * wrapped in a decorator object inside this container.
      */
-    public PersistentSearchDecorator()
+    public PersistentSearchDecorator( ILdapCodecService codec )
     {
-        this( new PersistentSearchImpl() );
+        this( codec, new PersistentSearchImpl() );
     }
 
 
@@ -69,9 +70,9 @@ public class PersistentSearchDecorator e
      *
      * @param control The PersistentSearch Control to wrap.
      */
-    public PersistentSearchDecorator( PersistentSearch control )
+    public PersistentSearchDecorator( ILdapCodecService codec, PersistentSearch control )
     {
-        super( control );
+        super( codec, control );
     }
 
 
@@ -227,7 +228,7 @@ public class PersistentSearchDecorator e
     public Asn1Object decode( byte[] controlBytes ) throws DecoderException
     {
         ByteBuffer bb = ByteBuffer.wrap( controlBytes );
-        PersistentSearchContainer container = new PersistentSearchContainer( this );
+        PersistentSearchContainer container = new PersistentSearchContainer( getCodecService(), this );
         decoder.decode( bb, container );
         return this;
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchFactory.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchFactory.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/persistentSearch/PersistentSearchFactory.java Sun Jan 30 15:42:36 2011
@@ -28,6 +28,7 @@ import javax.naming.ldap.Control;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 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;
 
@@ -40,6 +41,14 @@ import org.apache.directory.shared.ldap.
  */
 public class PersistentSearchFactory implements IControlFactory<PersistentSearch, PersistentSearchDecorator>
 {
+    private ILdapCodecService codec;
+    
+    
+    public PersistentSearchFactory( ILdapCodecService codec )
+    {
+        this.codec = codec;
+    }
+    
     public String getOid()
     {
         return PersistentSearch.OID;
@@ -48,7 +57,7 @@ public class PersistentSearchFactory imp
     
     public PersistentSearchDecorator newCodecControl()
     {
-        return new PersistentSearchDecorator();
+        return new PersistentSearchDecorator( codec );
     }
 
     
@@ -60,7 +69,7 @@ public class PersistentSearchFactory imp
         }
         else 
         {
-            return new PersistentSearchDecorator( control );
+            return new PersistentSearchDecorator( codec, control );
         }
     }
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesDecorator.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesDecorator.java Sun Jan 30 15:42:36 2011
@@ -30,6 +30,7 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.tlv.UniversalTag;
 import org.apache.directory.shared.asn1.ber.tlv.Value;
 import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.ldap.model.message.controls.SubentriesImpl;
 import org.apache.directory.shared.ldap.model.message.controls.Subentries;
@@ -53,9 +54,9 @@ public class SubentriesDecorator extends
     /**
      * Default constructor
      */
-    public SubentriesDecorator()
+    public SubentriesDecorator( ILdapCodecService codec )
     {
-        this( new SubentriesImpl() );
+        this( codec, new SubentriesImpl() );
     }
 
 
@@ -65,9 +66,9 @@ public class SubentriesDecorator extends
      *
      * @param control The Subentries Control to wrap with this decorator.
      */
-    public SubentriesDecorator( Subentries control )
+    public SubentriesDecorator( ILdapCodecService codec, Subentries control )
     {
-        super( control );
+        super( codec, control );
     }
 
 

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesFactory.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesFactory.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/subentries/SubentriesFactory.java Sun Jan 30 15:42:36 2011
@@ -25,6 +25,7 @@ import javax.naming.ldap.Control;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
 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;
 
@@ -38,14 +39,23 @@ import org.apache.directory.shared.ldap.
  */
 public class SubentriesFactory implements IControlFactory<Subentries, SubentriesDecorator>
 {
+    private ILdapCodecService codec;
+    
+    
+    public SubentriesFactory( ILdapCodecService codec )
+    {
+        this.codec = codec;
+    }
+    
     public String getOid()
     {
         return Subentries.OID;
     }
 
+    
     public SubentriesDecorator newCodecControl()
     {
-        return new SubentriesDecorator();
+        return new SubentriesDecorator( codec );
     }
 
 
@@ -62,7 +72,7 @@ public class SubentriesFactory implement
             throw new IllegalArgumentException( "Bad control provided: " + control );
         }
         
-        return new SubentriesDecorator( control );
+        return new SubentriesDecorator( codec, control );
     }
 
     public Control toJndiControl( Subentries control ) throws EncoderException

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestCodecControl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestCodecControl.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestCodecControl.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/TestCodecControl.java Sun Jan 30 15:42:36 2011
@@ -89,4 +89,9 @@ public class TestCodecControl implements
     public void setValue( byte[] value )
     {
     }
+
+    public ILdapCodecService getCodecService()
+    {
+        return null;
+    }
 }
\ No newline at end of file

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/ppolicy/PasswordPolicyResponseControlTest.java Sun Jan 30 15:42:36 2011
@@ -26,6 +26,8 @@ import static org.junit.Assert.assertNot
 
 import java.nio.ByteBuffer;
 
+import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 
@@ -37,7 +39,8 @@ import org.junit.Test;
  */
 public class PasswordPolicyResponseControlTest
 {
-
+    ILdapCodecService codec = new DefaultLdapCodecService();
+    
     @Test
     public void testDecodeRespWithExpiryWarningAndError() throws Exception
     {
@@ -53,8 +56,8 @@ public class PasswordPolicyResponseContr
 
         bb.flip();
 
-        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
-        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator() );
+        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( codec );
+        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator( codec ) );
 
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
         control.decode( bb.array() );
@@ -97,8 +100,8 @@ public class PasswordPolicyResponseContr
 
         bb.flip();
 
-        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
-        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator() );
+        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( codec );
+        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator( codec ) );
 
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
         control.decode( bb.array() );
@@ -140,8 +143,8 @@ public class PasswordPolicyResponseContr
 
         bb.flip();
 
-        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
-        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator() );
+        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( codec );
+        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator( codec ) );
 
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
         control.decode( bb.array() );
@@ -181,8 +184,8 @@ public class PasswordPolicyResponseContr
 
         bb.flip();
 
-        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
-        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator() );
+        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( codec );
+        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator( codec ) );
 
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
         
@@ -221,8 +224,8 @@ public class PasswordPolicyResponseContr
 
         bb.flip();
 
-        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
-        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator() );
+        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( codec );
+        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator( codec ) );
 
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
         control.decode( bb.array() );
@@ -259,8 +262,8 @@ public class PasswordPolicyResponseContr
 
         bb.flip();
 
-        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer();
-        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator() );
+        PasswordPolicyResponseContainer container = new PasswordPolicyResponseContainer( codec );
+        container.setPasswordPolicyResponseControl( new PasswordPolicyResponseDecorator( codec ) );
 
         PasswordPolicyResponseDecorator control = container.getPasswordPolicyResponseControl();
         control.decode( bb.array() );

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java Sun Jan 30 15:42:36 2011
@@ -31,6 +31,8 @@ import java.nio.ByteBuffer;
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.EncoderException;
+import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.ISyncDoneValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueDecorator;
 import org.apache.directory.shared.util.Strings;
@@ -48,7 +50,9 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class SyncDoneValueControlTest
 {
+    private ILdapCodecService codec = new DefaultLdapCodecService();
 
+    
     @Test
     public void testSyncDoneValueControl() throws Exception
     {
@@ -63,7 +67,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueDecorator decorator = new SyncDoneValueDecorator();
+        SyncDoneValueContainer container = new SyncDoneValueContainer( codec );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         ISyncDoneValue control = (ISyncDoneValue)decorator.decode( bb.array() );
         
@@ -115,7 +120,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueDecorator decorator = new SyncDoneValueDecorator();
+        SyncDoneValueContainer container = new SyncDoneValueContainer( codec );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         ISyncDoneValue control = (ISyncDoneValue)decorator.decode( bb.array() );
 
@@ -164,7 +170,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueDecorator decorator = new SyncDoneValueDecorator();
+        SyncDoneValueContainer container = new SyncDoneValueContainer( codec );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         ISyncDoneValue control = (ISyncDoneValue)decorator.decode( bb.array() );
 
@@ -187,7 +194,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueDecorator decorator = new SyncDoneValueDecorator();
+        SyncDoneValueContainer container = new SyncDoneValueContainer( codec );
+        SyncDoneValueDecorator decorator = container.getSyncDoneValueControl();
 
         ISyncDoneValue control = (ISyncDoneValue)decorator.decode( bb.array() );
 

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java?rev=1065306&r1=1065305&r2=1065306&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncInfoValueControlTest.java Sun Jan 30 15:42:36 2011
@@ -30,7 +30,8 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.ISyncInfoValue;
+import org.apache.directory.shared.ldap.codec.DefaultLdapCodecService;
+import org.apache.directory.shared.ldap.codec.ILdapCodecService;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
 import org.apache.directory.shared.util.Strings;
@@ -46,6 +47,9 @@ import org.junit.runner.RunWith;
 @Concurrent()
 public class SyncInfoValueControlTest
 {
+    private ILdapCodecService codec = new DefaultLdapCodecService();
+    
+    
     //--------------------------------------------------------------------------------
     // NewCookie choice tests
     //--------------------------------------------------------------------------------
@@ -63,7 +67,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -112,7 +117,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -166,8 +172,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -221,8 +227,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -276,8 +282,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -330,8 +336,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -382,8 +388,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_DELETE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -438,8 +444,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -493,8 +499,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -548,8 +554,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -602,8 +608,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -654,8 +660,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.REFRESH_PRESENT );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -707,8 +713,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -739,8 +745,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -771,8 +777,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -804,8 +810,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -836,8 +842,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -900,8 +906,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -975,8 +981,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1041,8 +1047,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1117,8 +1123,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1183,9 +1189,9 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
-        decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
+        decorator.setType( SynchronizationInfoEnum.NEW_COOKIE );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
 
@@ -1260,8 +1266,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1328,8 +1334,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         ISyncInfoValue syncInfoValue = (ISyncInfoValue)decorator.decode( bb.array() );
@@ -1409,8 +1415,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
-        
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try
@@ -1447,7 +1453,8 @@ public class SyncInfoValueControlTest
             } );
         bb.flip();
 
-        SyncInfoValueDecorator decorator = new SyncInfoValueDecorator();
+        SyncInfoValueContainer container = new SyncInfoValueContainer( codec );
+        SyncInfoValueDecorator decorator = container.getSyncInfoValueControl();
         decorator.setType( SynchronizationInfoEnum.SYNC_ID_SET );
 
         try



Mime
View raw message