directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1064990 - in /directory: apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/ apacheds/trunk/protocol-ldap/src/main/java/org/apache/dire...
Date Sat, 29 Jan 2011 10:03:36 GMT
Author: akarasulu
Date: Sat Jan 29 10:03:35 2011
New Revision: 1064990

URL: http://svn.apache.org/viewvc?rev=1064990&view=rev
Log:
fixing and migrating more controls (replication related)

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/ISyncDoneValue.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValue.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueGrammar.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueStatesEnum.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java
Modified:
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncDoneValueControlTest.java

Modified: directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?rev=1064990&r1=1064989&r2=1064990&view=diff
==============================================================================
--- directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Sat Jan 29 10:03:35 2011
@@ -83,8 +83,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.ppolicy.PasswordPolicyResponseControl;
 import org.apache.directory.shared.ldap.codec.controls.ppolicy.PasswordPolicyResponseControlContainer;
 import org.apache.directory.shared.ldap.codec.controls.ppolicy.PasswordPolicyResponseControlDecoder;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlContainer;
+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.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlDecoder;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.ISyncInfoValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueDecorator;
@@ -193,7 +194,7 @@ public abstract class ServerContext impl
         ADS_CONTROLS.put( PasswordPolicyRequestControl.CONTROL_OID, ControlEnum.PASSWORD_POLICY_REQUEST_CONTROL
);
         ADS_CONTROLS.put( PersistentSearch.OID, ControlEnum.PERSISTENT_SEARCH_CONTROL );
         ADS_CONTROLS.put( Subentries.OID, ControlEnum.SUBENTRIES_CONTROL );
-        ADS_CONTROLS.put( SyncDoneValueControl.CONTROL_OID, ControlEnum.SYNC_DONE_VALUE_CONTROL
);
+        ADS_CONTROLS.put( ISyncDoneValue.OID, ControlEnum.SYNC_DONE_VALUE_CONTROL );
         ADS_CONTROLS.put( ISyncInfoValue.OID, ControlEnum.SYNC_INFO_VALUE_CONTROL );
         ADS_CONTROLS.put( ISyncModifyDn.OID, ControlEnum.SYNC_MODIFY_DN_CONTROL );
         ADS_CONTROLS.put( ISyncRequestValue.OID, ControlEnum.SYNC_REQUEST_VALUE_CONTROL );
@@ -469,14 +470,14 @@ public abstract class ServerContext impl
                 break;
 
             case SYNC_DONE_VALUE_CONTROL:
-                control = new SyncDoneValueControl();
+                control = new SyncDoneValueDecorator();
                 SyncDoneValueControlDecoder syncDoneValueControlDecoder = new SyncDoneValueControlDecoder();
-                SyncDoneValueControlContainer syncDoneValueControlContainer = new SyncDoneValueControlContainer();
-                syncDoneValueControlContainer.setSyncDoneValueControl( ( SyncDoneValueControl
) control );
+                SyncDoneValueContainer syncDoneValueContainer = new SyncDoneValueContainer();
+                syncDoneValueContainer.setSyncDoneValueControl( ( SyncDoneValueDecorator
) control );
                 bb = ByteBuffer.allocate( jndiControl.getEncodedValue().length );
                 bb.put( jndiControl.getEncodedValue() ).flip();
 
-                syncDoneValueControlDecoder.decode( bb, syncDoneValueControlContainer );
+                syncDoneValueControlDecoder.decode( bb, syncDoneValueContainer );
 
                 break;
 

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=1064990&r1=1064989&r2=1064990&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Sat Jan 29 10:03:35 2011
@@ -59,7 +59,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.message.controls.Cascade;
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaIT;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.ISyncDoneValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.ISyncInfoValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.ISyncRequestValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.ISyncStateValue;
@@ -178,7 +178,7 @@ public class DefaultPartitionNexus exten
             EntryChange.OID, Subentries.OID, ManageDsaIT.OID,
             Cascade.OID, PagedResults.OID,
             // Replication controls
-            SyncDoneValueControl.CONTROL_OID, ISyncInfoValue.OID, ISyncRequestValue.OID,
+            ISyncDoneValue.OID, ISyncInfoValue.OID, ISyncRequestValue.OID,
             ISyncStateValue.OID );
 
         // Add the objectClasses

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java?rev=1064990&r1=1064989&r2=1064990&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapServer.java
Sat Jan 29 10:03:35 2011
@@ -62,7 +62,7 @@ import org.apache.directory.server.proto
 import org.apache.directory.server.protocol.shared.transport.UdpTransport;
 import org.apache.directory.shared.ldap.model.message.controls.Cascade;
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaIT;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.ISyncDoneValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.ISyncInfoValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.ISyncRequestValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.ISyncStateValue;
@@ -242,7 +242,7 @@ public class LdapServer extends Director
         this.supportedControls.add( Cascade.OID );
         this.supportedControls.add( PagedResults.OID );
         // Replication controls
-        this.supportedControls.add( SyncDoneValueControl.CONTROL_OID );
+        this.supportedControls.add( ISyncDoneValue.OID );
         this.supportedControls.add( ISyncInfoValue.OID );
         this.supportedControls.add( ISyncRequestValue.OID );
         this.supportedControls.add( ISyncStateValue.OID );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java?rev=1064990&r1=1064989&r2=1064990&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
Sat Jan 29 10:03:35 2011
@@ -40,7 +40,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
 import org.apache.directory.shared.ldap.codec.controls.ManageDsaITDecorator;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
+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.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlDecoder;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.ISyncInfoValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControlDecoder;
@@ -286,13 +287,13 @@ public class SyncReplConsumer implements
     {
         LOG.debug( "///////////////// handleSearchDone //////////////////" );
 
-        Control ctrl = searchDone.getControls().get( SyncDoneValueControl.CONTROL_OID );
-        SyncDoneValueControl syncDoneCtrl = new SyncDoneValueControl();
+        Control ctrl = searchDone.getControls().get( ISyncDoneValue.OID );
+        SyncDoneValueDecorator syncDoneCtrl = new SyncDoneValueDecorator();
         try
         {
             if ( ctrl != null )
             {
-                syncDoneCtrl = ( SyncDoneValueControl ) syncDoneControlDecoder.decode( ctrl.getValue(),
syncDoneCtrl );
+                syncDoneCtrl = ( SyncDoneValueDecorator ) syncDoneControlDecoder.decode(
ctrl.getValue(), syncDoneCtrl );
             }
         }
         catch ( Exception e )

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java?rev=1064990&r1=1064989&r2=1064990&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplProvider.java
Sat Jan 29 10:03:35 2011
@@ -48,7 +48,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.SearchAbandonListener;
 import org.apache.directory.server.ldap.handlers.SearchTimeLimitingMonitor;
 import org.apache.directory.shared.ldap.model.message.controls.ManageDsaIT;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueDecorator;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.ISyncInfoValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueDecorator;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.ISyncRequestValue;
@@ -340,7 +340,7 @@ public class SyncReplProvider implements
         {
             SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse();
             searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
-            SyncDoneValueControl syncDone = new SyncDoneValueControl();
+            SyncDoneValueDecorator syncDone = new SyncDoneValueDecorator();
             syncDone.setCookie( cookie );
             searchDoneResp.addControl( syncDone );
 
@@ -433,7 +433,7 @@ public class SyncReplProvider implements
             else
             {
                 // no need to send from the log, that will be done in the next refreshOnly
session
-                SyncDoneValueControl syncDone = new SyncDoneValueControl();
+                SyncDoneValueDecorator syncDone = new SyncDoneValueDecorator();
                 syncDone.setCookie( cookie );
                 searchDoneResp.addControl( syncDone );
                 session.getIoSession().write( searchDoneResp );
@@ -986,7 +986,7 @@ public class SyncReplProvider implements
     {
         SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse();
         searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.E_SYNC_REFRESH_REQUIRED
);
-        SyncDoneValueControl syncDone = new SyncDoneValueControl();
+        SyncDoneValueDecorator syncDone = new SyncDoneValueDecorator();
         searchDoneResp.addControl( syncDone );
 
         session.getIoSession().write( searchDoneResp );

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/ISyncDoneValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/ISyncDoneValue.java?rev=1064990&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/ISyncDoneValue.java
(added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/ISyncDoneValue.java
Sat Jan 29 10:03:35 2011
@@ -0,0 +1,60 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue;
+
+import org.apache.directory.shared.ldap.model.message.Control;
+
+
+/**
+ * A syncDoneValue object as described in rfc4533.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface ISyncDoneValue extends Control
+{
+
+    /** This control OID */
+    public static final String OID = "1.3.6.1.4.1.4203.1.9.1.3";
+
+
+    /**
+     * @return the cookie
+     */
+    byte[] getCookie();
+
+
+    /**
+     * @param cookie cookie to be set
+     */
+    void setCookie( byte[] cookie );
+
+
+    /**
+     * @return true, if refreshDeletes flag is set, false otherwise
+     */
+    boolean isRefreshDeletes();
+
+
+    /**
+     * @param refreshDeletes set the refreshDeletes flag 
+     */
+    void setRefreshDeletes( boolean refreshDeletes );
+
+}
\ No newline at end of file

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValue.java?rev=1064990&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValue.java
(added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValue.java
Sat Jan 29 10:03:35 2011
@@ -0,0 +1,92 @@
+/*
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *   or more contributor license agreements.  See the NOTICE file
+ *   distributed with this work for additional information
+ *   regarding copyright ownership.  The ASF licenses this file
+ *   to you under the Apache License, Version 2.0 (the
+ *   "License"); you may not use this file except in compliance
+ *   with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing,
+ *   software distributed under the License is distributed on an
+ *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *   KIND, either express or implied.  See the License for the
+ *   specific language governing permissions and limitations
+ *   under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue;
+
+
+/**
+ * TODO SyncDoneValue.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SyncDoneValue implements ISyncDoneValue
+{
+    /** The Sync cookie */
+    private byte[] cookie;
+
+    /** the refreshDeletes flag */
+    private boolean refreshDeletes;
+
+    private boolean critical;
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public byte[] getCookie()
+    {
+        return cookie;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setCookie( byte[] cookie )
+    {
+        this.cookie = cookie;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isRefreshDeletes()
+    {
+        return refreshDeletes;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setRefreshDeletes( boolean refreshDeletes )
+    {
+        this.refreshDeletes = refreshDeletes;
+    }
+
+
+    public String getOid()
+    {
+        return OID;
+    }
+
+
+    public boolean isCritical()
+    {
+        return critical;
+    }
+
+
+    public void setCritical( boolean critical )
+    {
+        this.critical = critical;
+    }
+}

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java
(from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlContainer.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?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlContainer.java&r1=1064846&r2=1064990&rev=1064990&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlContainer.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueContainer.java
Sat Jan 29 10:03:35 2011
@@ -29,10 +29,10 @@ import org.apache.directory.shared.asn1.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SyncDoneValueControlContainer extends AbstractContainer
+public class SyncDoneValueContainer extends AbstractContainer
 {
     /** syncDoneValue*/
-    private SyncDoneValueControl control;
+    private SyncDoneValueDecorator control;
 
 
     /**
@@ -40,19 +40,35 @@ public class SyncDoneValueControlContain
      * Creates a new SyncDoneValueControlContainer object.
      *
      */
-    public SyncDoneValueControlContainer()
+    public SyncDoneValueContainer()
     {
         super();
+        this.control = new SyncDoneValueDecorator();
         stateStack = new int[1];
-        grammar = SyncDoneValueControlGrammar.getInstance();
-        setTransition( SyncDoneValueControlStatesEnum.START_STATE );
+        grammar = SyncDoneValueGrammar.getInstance();
+        setTransition( SyncDoneValueStatesEnum.START_STATE );
+    }
+
+
+    /**
+     * 
+     * Creates a new SyncDoneValueControlContainer object.
+     *
+     */
+    public SyncDoneValueContainer( SyncDoneValueDecorator control )
+    {
+        super();
+        this.control = control;
+        stateStack = new int[1];
+        grammar = SyncDoneValueGrammar.getInstance();
+        setTransition( SyncDoneValueStatesEnum.START_STATE );
     }
 
 
     /**
      * @return the SyncDoneValueControlCodec object
      */
-    public SyncDoneValueControl getSyncDoneValueControl()
+    public SyncDoneValueDecorator getSyncDoneValueControl()
     {
         return control;
     }
@@ -64,7 +80,7 @@ public class SyncDoneValueControlContain
      * 
      * @param control the SyncDoneValueControlCodec to set.
      */
-    public void setSyncDoneValueControl( SyncDoneValueControl control )
+    public void setSyncDoneValueControl( SyncDoneValueDecorator control )
     {
         this.control = control;
     }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java
(from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControl.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?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControl.java&r1=1064846&r2=1064990&rev=1064990&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControl.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueDecorator.java
Sat Jan 29 10:03:35 2011
@@ -23,43 +23,40 @@ package org.apache.directory.shared.ldap
 import java.nio.ByteBuffer;
 import java.util.Arrays;
 
+import org.apache.directory.shared.asn1.Asn1Object;
+import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.EncoderException;
+import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 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.controls.AbstractControl;
+import org.apache.directory.shared.ldap.codec.controls.ControlDecorator;
 import org.apache.directory.shared.util.Strings;
 
 
 /**
- * 
  * A syncDoneValue object as described in rfc4533.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SyncDoneValueControl extends AbstractControl
+public class SyncDoneValueDecorator extends ControlDecorator<ISyncDoneValue> implements
ISyncDoneValue
 {
-    /** This control OID */
-    public static final String CONTROL_OID = "1.3.6.1.4.1.4203.1.9.1.3";
-
-    /** The Sync cookie */
-    private byte[] cookie;
-
-    /** the refreshDeletes flag */
-    private boolean refreshDeletes;
-
     /** The global length for this control */
     private int syncDoneValueLength;
+    
+    private byte[] value;
+
+    /** An instance of this decoder */
+    private static final Asn1Decoder decoder = new Asn1Decoder();
 
+    
     /**
      * Creates a new instance of SyncDoneValueControlCodec.
      */
-    public SyncDoneValueControl()
+    public SyncDoneValueDecorator()
     {
-        super( CONTROL_OID );
-
-        decoder = new SyncDoneValueControlDecoder();
+        super( new SyncDoneValue() );
     }
     
 
@@ -74,13 +71,13 @@ public class SyncDoneValueControl extend
     public int computeLength()
     {
         // cookie's length
-        if ( cookie != null )
+        if ( getCookie() != null )
         {
-            syncDoneValueLength = 1 + TLV.getNbBytes( cookie.length ) + cookie.length;
+            syncDoneValueLength = 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length;
         }
 
         // the refreshDeletes flag length
-        if ( refreshDeletes )
+        if ( isRefreshDeletes() )
         {
             syncDoneValueLength += 1 + 1 + 1;
         }
@@ -118,14 +115,14 @@ public class SyncDoneValueControl extend
         buffer.put( UniversalTag.SEQUENCE.getValue() );
         buffer.put( TLV.getBytes( syncDoneValueLength ) );
 
-        if ( cookie != null )
+        if ( getCookie() != null )
         {
-            Value.encode( buffer, cookie );
+            Value.encode( buffer, getCookie() );
         }
 
-        if ( refreshDeletes )
+        if ( isRefreshDeletes() )
         {  
-            Value.encode( buffer, refreshDeletes );
+            Value.encode( buffer, isRefreshDeletes() );
         }
 
         return buffer;
@@ -148,14 +145,14 @@ public class SyncDoneValueControl extend
                 buffer.put( UniversalTag.SEQUENCE.getValue() );
                 buffer.put( TLV.getBytes( syncDoneValueLength ) );
 
-                if ( cookie != null )
+                if ( getCookie() != null )
                 {
-                    Value.encode( buffer, cookie );
+                    Value.encode( buffer, getCookie() );
                 }
 
-                if ( refreshDeletes )
+                if ( isRefreshDeletes() )
                 {  
-                    Value.encode( buffer, refreshDeletes );
+                    Value.encode( buffer, isRefreshDeletes() );
                 }
                 
                 value = buffer.array();
@@ -171,47 +168,48 @@ public class SyncDoneValueControl extend
 
 
     /**
-     * @return the cookie
+     * {@inheritDoc}
      */
     public byte[] getCookie()
     {
-        return cookie;
+        return getDecorated().getCookie();
     }
 
 
     /**
-     * @param cookie cookie to be set
+     * {@inheritDoc}
      */
     public void setCookie( byte[] cookie )
     {
         // Copy the bytes
         if ( cookie != null )
         {
-            this.cookie = new byte[cookie.length];
-            System.arraycopy( cookie, 0, this.cookie, 0, cookie.length );
+            byte[] copy = new byte[getCookie().length];
+            System.arraycopy( cookie, 0, copy, 0, cookie.length );
+            setCookie( copy );
         }
         else
         {
-            this.cookie = null;
+            setCookie( null );
         }
     }
 
 
     /**
-     * @return true, if refreshDeletes flag is set, false otherwise
+     * {@inheritDoc}
      */
     public boolean isRefreshDeletes()
     {
-        return refreshDeletes;
+        return getDecorated().isRefreshDeletes();
     }
 
 
     /**
-     * @param refreshDeletes set the refreshDeletes flag 
+     * {@inheritDoc}
      */
     public void setRefreshDeletes( boolean refreshDeletes )
     {
-        this.refreshDeletes = refreshDeletes;
+        getDecorated().setRefreshDeletes( refreshDeletes );
     }
 
 
@@ -220,14 +218,16 @@ public class SyncDoneValueControl extend
      */
     public boolean equals( Object o )
     {
-        if ( !super.equals( o ) )
+        if ( ! super.equals( o ) )
         {
             return false;
         }
 
-        SyncDoneValueControl otherControl = ( SyncDoneValueControl ) o;
+        SyncDoneValueDecorator otherControl = ( SyncDoneValueDecorator ) o;
 
-        return ( refreshDeletes == otherControl.refreshDeletes ) && ( Arrays.equals(
cookie, otherControl.cookie ) );
+        return  ( isRefreshDeletes() == otherControl.isRefreshDeletes() ) 
+                && 
+                ( Arrays.equals( getCookie(), otherControl.getCookie() ) );
     }
 
 
@@ -241,9 +241,19 @@ public class SyncDoneValueControl extend
         sb.append( "    SyncDoneValue control :\n" );
         sb.append( "        oid : " ).append( getOid() ).append( '\n' );
         sb.append( "        critical : " ).append( isCritical() ).append( '\n' );
-        sb.append( "        cookie            : '" ).append( Strings.dumpBytes(cookie) ).append(
"'\n" );
-        sb.append( "        refreshDeletes : '" ).append( refreshDeletes ).append( "'\n"
);
+        sb.append( "        cookie            : '" ).append( Strings.dumpBytes( getCookie()
) ).append( "'\n" );
+        sb.append( "        refreshDeletes : '" ).append( isRefreshDeletes() ).append( "'\n"
);
 
         return sb.toString();
     }
+
+
+    @Override
+    public Asn1Object decode( byte[] controlBytes ) throws DecoderException
+    {
+        ByteBuffer bb = ByteBuffer.wrap( controlBytes );
+        SyncDoneValueContainer container = new SyncDoneValueContainer( this );
+        decoder.decode( bb, container );
+        return this;
+    }
 }
\ No newline at end of file

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueGrammar.java
(from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlGrammar.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueGrammar.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueGrammar.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlGrammar.java&r1=1064846&r2=1064990&rev=1064990&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlGrammar.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueGrammar.java
Sat Jan 29 10:03:35 2011
@@ -21,7 +21,6 @@ package org.apache.directory.shared.ldap
 
 
 import org.apache.directory.shared.asn1.DecoderException;
-import org.apache.directory.shared.asn1.ber.Asn1Container;
 import org.apache.directory.shared.asn1.ber.grammar.AbstractGrammar;
 import org.apache.directory.shared.asn1.ber.grammar.Grammar;
 import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
@@ -51,17 +50,17 @@ import org.slf4j.LoggerFactory;
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class SyncDoneValueControlGrammar extends AbstractGrammar
+public final class SyncDoneValueGrammar extends AbstractGrammar
 {
 
     /** the logger */
-    private static final Logger LOG = LoggerFactory.getLogger( SyncDoneValueControlGrammar.class
);
+    private static final Logger LOG = LoggerFactory.getLogger( SyncDoneValueGrammar.class
);
 
     /** speedup for logger */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** SyncDoneValueControlGrammar singleton instance */
-    private static final SyncDoneValueControlGrammar INSTANCE = new SyncDoneValueControlGrammar();
+    private static final SyncDoneValueGrammar INSTANCE = new SyncDoneValueGrammar();
 
 
     /**
@@ -69,11 +68,11 @@ public final class SyncDoneValueControlG
      * Creates a new instance of SyncDoneValueControlGrammar.
      *
      */
-    private SyncDoneValueControlGrammar()
+    private SyncDoneValueGrammar()
     {
-        setName( SyncDoneValueControlGrammar.class.getName() );
+        setName( SyncDoneValueGrammar.class.getName() );
 
-        super.transitions = new GrammarTransition[SyncDoneValueControlStatesEnum.LAST_SYNC_DONE_VALUE_STATE.ordinal()][256];
+        super.transitions = new GrammarTransition[SyncDoneValueStatesEnum.LAST_SYNC_DONE_VALUE_STATE.ordinal()][256];
 
         /** 
          * Transition from initial state to SyncDoneValue sequence
@@ -82,16 +81,14 @@ public final class SyncDoneValueControlG
          *     
          * Initialize the syncDoneValue object
          */
-        super.transitions[SyncDoneValueControlStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()]
= new GrammarTransition(
-            SyncDoneValueControlStatesEnum.START_STATE, SyncDoneValueControlStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE,
UniversalTag.SEQUENCE.getValue(),
-            new GrammarAction( "Initialization" )
+        super.transitions[SyncDoneValueStatesEnum.START_STATE.ordinal()][UniversalTag.SEQUENCE.getValue()]
= new GrammarTransition(
+            SyncDoneValueStatesEnum.START_STATE, SyncDoneValueStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE,
UniversalTag.SEQUENCE.getValue(),
+            new GrammarAction<SyncDoneValueContainer>( "Initialization" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncDoneValueContainer container ) throws DecoderException
                 {
-                    SyncDoneValueControlContainer syncDoneValueContainer = ( SyncDoneValueControlContainer
) container;
-
                     // As all the values are optional or defaulted, we can end here
-                    syncDoneValueContainer.setGrammarEndAllowed( true );
+                    container.setGrammarEndAllowed( true );
                 }
             }  );
 
@@ -102,14 +99,14 @@ public final class SyncDoneValueControlG
          *    ....
          * }
          */
-        super.transitions[SyncDoneValueControlStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()]
= new GrammarTransition(
-            SyncDoneValueControlStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE, SyncDoneValueControlStatesEnum.COOKIE_STATE,
-            UniversalTag.OCTET_STRING.getValue(), new GrammarAction( "Set SyncDoneValueControl
cookie" )
+        super.transitions[SyncDoneValueStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()]
= new GrammarTransition(
+            SyncDoneValueStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE, SyncDoneValueStatesEnum.COOKIE_STATE,
+            UniversalTag.OCTET_STRING.getValue(), 
+            new GrammarAction<SyncDoneValueContainer>( "Set SyncDoneValueControl cookie"
)
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncDoneValueContainer container ) throws DecoderException
                 {
-                    SyncDoneValueControlContainer syncDoneValueContainer = ( SyncDoneValueControlContainer
) container;
-                    Value value = syncDoneValueContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     byte[] cookie = value.getData();
 
@@ -118,18 +115,18 @@ public final class SyncDoneValueControlG
                         LOG.debug( "cookie = {}", Strings.dumpBytes(cookie) );
                     }
 
-                    syncDoneValueContainer.getSyncDoneValueControl().setCookie( cookie );
+                    container.getSyncDoneValueControl().setCookie( cookie );
 
-                    syncDoneValueContainer.setGrammarEndAllowed( true );
+                    container.setGrammarEndAllowed( true );
                 }
             } );
 
-        GrammarAction refreshDeletesTagAction = new GrammarAction( "set SyncDoneValueControl
refreshDeletes flag" )
+        GrammarAction<SyncDoneValueContainer> refreshDeletesTagAction = 
+            new GrammarAction<SyncDoneValueContainer>( "set SyncDoneValueControl refreshDeletes
flag" )
         {
-            public void action( Asn1Container container ) throws DecoderException
+            public void action( SyncDoneValueContainer container ) throws DecoderException
             {
-                SyncDoneValueControlContainer syncDoneValueContainer = ( SyncDoneValueControlContainer
) container;
-                Value value = syncDoneValueContainer.getCurrentTLV().getValue();
+                Value value = container.getCurrentTLV().getValue();
 
                 try
                 {
@@ -140,10 +137,10 @@ public final class SyncDoneValueControlG
                         LOG.debug( "refreshDeletes = {}", refreshDeletes );
                     }
 
-                    syncDoneValueContainer.getSyncDoneValueControl().setRefreshDeletes( refreshDeletes
);
+                    container.getSyncDoneValueControl().setRefreshDeletes( refreshDeletes
);
 
                     // the END transition for grammar
-                    syncDoneValueContainer.setGrammarEndAllowed( true );
+                    container.setGrammarEndAllowed( true );
                 }
                 catch ( BooleanDecoderException be )
                 {
@@ -161,8 +158,8 @@ public final class SyncDoneValueControlG
          *    refreshDeletes BOOLEAN DEFAULT FALSE
          * }
          */
-        super.transitions[SyncDoneValueControlStatesEnum.COOKIE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()]
= new GrammarTransition(
-            SyncDoneValueControlStatesEnum.COOKIE_STATE, SyncDoneValueControlStatesEnum.REFRESH_DELETES_STATE,
+        super.transitions[SyncDoneValueStatesEnum.COOKIE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()]
= new GrammarTransition(
+            SyncDoneValueStatesEnum.COOKIE_STATE, SyncDoneValueStatesEnum.REFRESH_DELETES_STATE,
             UniversalTag.BOOLEAN.getValue(), refreshDeletesTagAction );
         
         /**
@@ -172,8 +169,8 @@ public final class SyncDoneValueControlG
          *    refreshDeletes BOOLEAN DEFAULT FALSE
          * }
          */
-        super.transitions[SyncDoneValueControlStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()]
= new GrammarTransition(
-            SyncDoneValueControlStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE, SyncDoneValueControlStatesEnum.REFRESH_DELETES_STATE,
+        super.transitions[SyncDoneValueStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()]
= new GrammarTransition(
+            SyncDoneValueStatesEnum.SYNC_DONE_VALUE_SEQUENCE_STATE, SyncDoneValueStatesEnum.REFRESH_DELETES_STATE,
             UniversalTag.BOOLEAN.getValue(), refreshDeletesTagAction );
 
     }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueStatesEnum.java
(from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueStatesEnum.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueStatesEnum.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java&r1=1064846&r2=1064990&rev=1064990&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueControlStatesEnum.java
(original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncDoneValue/SyncDoneValueStatesEnum.java
Sat Jan 29 10:03:35 2011
@@ -29,7 +29,7 @@ import org.apache.directory.shared.asn1.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum SyncDoneValueControlStatesEnum implements States
+public enum SyncDoneValueStatesEnum implements States
 {
 
     /** The END_STATE */
@@ -70,7 +70,7 @@ public enum SyncDoneValueControlStatesEn
      */
     public String getGrammarName( Grammar grammar )
     {
-        if ( grammar instanceof SyncDoneValueControlGrammar )
+        if ( grammar instanceof SyncDoneValueGrammar )
         {
             return "SYNC_DONE_VALUE_GRAMMAR";
         }
@@ -103,7 +103,7 @@ public enum SyncDoneValueControlStatesEn
     /**
      * {@inheritDoc}
      */
-    public SyncDoneValueControlStatesEnum getStartState()
+    public SyncDoneValueStatesEnum getStartState()
     {
         return START_STATE;
     }

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=1064990&r1=1064989&r2=1064990&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
Sat Jan 29 10:03:35 2011
@@ -32,8 +32,9 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlContainer;
+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.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControlDecoder;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
@@ -66,8 +67,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueControlContainer container = new SyncDoneValueControlContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueControl() );
+        SyncDoneValueContainer container = new SyncDoneValueContainer();
+        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
 
         try
         {
@@ -78,7 +79,7 @@ public class SyncDoneValueControlTest
             fail( e.getMessage() );
         }
 
-        SyncDoneValueControl control = container.getSyncDoneValueControl();
+        SyncDoneValueDecorator control = container.getSyncDoneValueControl();
         assertEquals( "xkcd", Strings.utf8ToString(control.getCookie()) );
         assertTrue( control.isRefreshDeletes() );
         
@@ -128,8 +129,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueControlContainer container = new SyncDoneValueControlContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueControl() );
+        SyncDoneValueContainer container = new SyncDoneValueContainer();
+        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
 
         try
         {
@@ -140,7 +141,7 @@ public class SyncDoneValueControlTest
             fail( e.getMessage() );
         }
 
-        SyncDoneValueControl control = container.getSyncDoneValueControl();
+        SyncDoneValueDecorator control = container.getSyncDoneValueControl();
         assertNull( control.getCookie() );
         assertTrue( control.isRefreshDeletes() );
 
@@ -187,8 +188,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueControlContainer container = new SyncDoneValueControlContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueControl() );
+        SyncDoneValueContainer container = new SyncDoneValueContainer();
+        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
 
         try
         {
@@ -199,7 +200,7 @@ public class SyncDoneValueControlTest
             fail( "shouldn't reach this" );
         }
 
-        SyncDoneValueControl control = container.getSyncDoneValueControl();
+        ISyncDoneValue control = container.getSyncDoneValueControl();
         assertNull( control.getCookie() );
         assertFalse( control.isRefreshDeletes() );
     }
@@ -220,8 +221,8 @@ public class SyncDoneValueControlTest
 
         bb.flip();
 
-        SyncDoneValueControlContainer container = new SyncDoneValueControlContainer();
-        container.setSyncDoneValueControl( new SyncDoneValueControl() );
+        SyncDoneValueContainer container = new SyncDoneValueContainer();
+        container.setSyncDoneValueControl( new SyncDoneValueDecorator() );
 
         try
         {
@@ -232,7 +233,7 @@ public class SyncDoneValueControlTest
             fail( e.getMessage() );
         }
 
-        SyncDoneValueControl control = container.getSyncDoneValueControl();
+        SyncDoneValueDecorator control = container.getSyncDoneValueControl();
         assertEquals( "", Strings.utf8ToString(control.getCookie()) );
         assertFalse( control.isRefreshDeletes() );
 



Mime
View raw message