directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1064985 - in /directory: apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ shared/trunk/ldap/src/main/java/org/apache/dire...
Date Sat, 29 Jan 2011 09:11:17 GMT
Author: akarasulu
Date: Sat Jan 29 09:11:15 2011
New Revision: 1064985

URL: http://svn.apache.org/viewvc?rev=1064985&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/syncmodifydn/ISyncModifyDn.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDn.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnGrammar.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnStatesEnum.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlStatesEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnTags.java
      - copied, changed from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlTags.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlContainer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlGrammar.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlStatesEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlTags.java
Modified:
    directory/apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessage.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/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValue.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValueDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValue.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValueDecorator.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.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=1064985&r1=1064984&r2=1064985&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 09:11:15 2011
@@ -97,9 +97,10 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueDecorator;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueContainer;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlDecoder;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControl;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControlContainer;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControlDecoder;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.ISyncModifyDn;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnContainer;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
 import org.apache.directory.shared.ldap.codec.search.controls.entryChange.*;
 import org.apache.directory.shared.ldap.model.message.controls.PagedResults;
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsContainer;
@@ -193,7 +194,7 @@ public abstract class ServerContext impl
         ADS_CONTROLS.put( Subentries.OID, ControlEnum.SUBENTRIES_CONTROL );
         ADS_CONTROLS.put( SyncDoneValueControl.CONTROL_OID, ControlEnum.SYNC_DONE_VALUE_CONTROL );
         ADS_CONTROLS.put( SyncInfoValueControl.CONTROL_OID, ControlEnum.SYNC_INFO_VALUE_CONTROL );
-        ADS_CONTROLS.put( SyncModifyDnControl.CONTROL_OID, ControlEnum.SYNC_MODIFY_DN_CONTROL );
+        ADS_CONTROLS.put( ISyncModifyDn.OID, ControlEnum.SYNC_MODIFY_DN_CONTROL );
         ADS_CONTROLS.put( ISyncRequestValue.OID, ControlEnum.SYNC_REQUEST_VALUE_CONTROL );
         ADS_CONTROLS.put( ISyncStateValue.OID, ControlEnum.SYNC_STATE_VALUE_CONTROL );
     }
@@ -491,10 +492,10 @@ public abstract class ServerContext impl
                 break;
 
             case SYNC_MODIFY_DN_CONTROL:
-                control = new SyncModifyDnControl();
+                control = new SyncModifyDnDecorator();
                 SyncModifyDnControlDecoder syncModifyDnControlDecoder = new SyncModifyDnControlDecoder();
-                SyncModifyDnControlContainer syncModifyDnControlContainer = new SyncModifyDnControlContainer();
-                syncModifyDnControlContainer.setSyncModifyDnControl( ( SyncModifyDnControl ) control );
+                SyncModifyDnContainer syncModifyDnControlContainer = new SyncModifyDnContainer();
+                syncModifyDnControlContainer.setSyncModifyDnDecorator( ( SyncModifyDnDecorator ) control );
                 bb = ByteBuffer.allocate( jndiControl.getEncodedValue().length );
                 bb.put( jndiControl.getEncodedValue() ).flip();
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessage.java?rev=1064985&r1=1064984&r2=1064985&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessage.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaEventMessage.java Sat Jan 29 09:11:15 2011
@@ -29,7 +29,7 @@ import java.util.Iterator;
 
 import org.apache.directory.server.core.event.EventType;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControl;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.EntryAttribute;
 import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
@@ -54,7 +54,7 @@ public class ReplicaEventMessage impleme
     private EventType eventType;
     private Entry entry;
 
-    private SyncModifyDnControl modDnControl;
+    private SyncModifyDnDecorator modDnControl;
     
     private static final Logger LOG = LoggerFactory.getLogger( ReplicaEventMessage.class );
 
@@ -74,7 +74,7 @@ public class ReplicaEventMessage impleme
     }
 
 
-    public ReplicaEventMessage( SyncModifyDnControl modDnControl, Entry entry )
+    public ReplicaEventMessage( SyncModifyDnDecorator modDnControl, Entry entry )
     {
         this.modDnControl = modDnControl;
         this.entry = entry;
@@ -93,7 +93,7 @@ public class ReplicaEventMessage impleme
     }
 
 
-    public SyncModifyDnControl getModDnControl()
+    public SyncModifyDnDecorator getModDnControl()
     {
         return modDnControl;
     }
@@ -107,7 +107,7 @@ public class ReplicaEventMessage impleme
         {
             SyncModifyDnType modDnType = SyncModifyDnType.getModifyDnType( in.readShort() );
             
-            modDnControl = new SyncModifyDnControl();
+            modDnControl = new SyncModifyDnDecorator();
             modDnControl.setModDnType( modDnType );
             
             modDnControl.setEntryDn( Unicode.readUTF(in) );

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=1064985&r1=1064984&r2=1064985&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 09:11:15 2011
@@ -48,8 +48,9 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.ISyncStateValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueDecorator;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueControlDecoder;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControl;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControlDecoder;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.ISyncModifyDn;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;
@@ -382,12 +383,12 @@ public class SyncReplConsumer implements
                     break;
 
                 case MODDN:
-                    Control adsModDnControl = syncResult.getControls().get( SyncModifyDnControl.CONTROL_OID );
+                    Control adsModDnControl = syncResult.getControls().get( ISyncModifyDn.OID );
                     //Apache Directory Server's special control
-                    SyncModifyDnControl syncModDnControl = new SyncModifyDnControl();
+                    SyncModifyDnDecorator syncModDnControl = new SyncModifyDnDecorator();
 
                     LOG.debug( "decoding the SyncModifyDnControl.." );
-                    syncModDnControl = ( SyncModifyDnControl ) syncModifyDnControlDecoder.decode( adsModDnControl
+                    syncModDnControl = ( SyncModifyDnDecorator ) syncModifyDnControlDecoder.decode( adsModDnControl
                         .getValue(), syncModDnControl );
 
                     applyModDnOperation( syncModDnControl );
@@ -776,7 +777,7 @@ public class SyncReplConsumer implements
     }
 
 
-    private void applyModDnOperation( SyncModifyDnControl modDnControl ) throws Exception
+    private void applyModDnOperation( ISyncModifyDn modDnControl ) throws Exception
     {
         SyncModifyDnType modDnType = modDnControl.getModDnType();
 

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=1064985&r1=1064984&r2=1064985&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 09:11:15 2011
@@ -52,7 +52,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.ISyncRequestValue;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueDecorator;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControl;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationInfoEnum;
 import org.apache.directory.shared.ldap.message.control.replication.SynchronizationModeEnum;
@@ -580,7 +580,7 @@ public class SyncReplProvider implements
 
 
     private void sendSearchResultEntry( LdapSession session, SearchRequest req, Entry entry,
-        SyncModifyDnControl modDnControl ) throws Exception
+        SyncModifyDnDecorator modDnControl ) throws Exception
     {
 
         EntryAttribute uuid = entry.get( SchemaConstants.ENTRY_UUID_AT );

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java?rev=1064985&r1=1064984&r2=1064985&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplSearchListener.java Sat Jan 29 09:11:15 2011
@@ -31,7 +31,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncStateValue.SyncStateValueDecorator;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControl;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
 import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
 import org.apache.directory.shared.ldap.message.control.replication.SyncStateTypeEnum;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
@@ -263,7 +263,7 @@ public class SyncReplSearchListener impl
                 return;
             }
 
-            SyncModifyDnControl modDnControl = new SyncModifyDnControl( SyncModifyDnType.MOVE );
+            SyncModifyDnDecorator modDnControl = new SyncModifyDnDecorator( SyncModifyDnType.MOVE );
             modDnControl.setEntryDn( moveContext.getDn().getNormName() );
             modDnControl.setNewSuperiorDn( moveContext.getNewSuperior().getNormName() );
 
@@ -310,7 +310,7 @@ public class SyncReplSearchListener impl
                 return;
             }
 
-            SyncModifyDnControl modDnControl = new SyncModifyDnControl( SyncModifyDnType.MOVEANDRENAME );
+            SyncModifyDnDecorator modDnControl = new SyncModifyDnDecorator( SyncModifyDnType.MOVEANDRENAME );
             modDnControl.setEntryDn( moveAndRenameContext.getDn().getNormName() );
             modDnControl.setNewSuperiorDn( moveAndRenameContext.getNewSuperiorDn().getNormName() );
             modDnControl.setNewRdn( moveAndRenameContext.getNewRdn().getNormName() );
@@ -356,7 +356,7 @@ public class SyncReplSearchListener impl
 
         try
         {
-            SyncModifyDnControl modDnControl = new SyncModifyDnControl();
+            SyncModifyDnDecorator modDnControl = new SyncModifyDnDecorator();
             modDnControl.setModDnType( SyncModifyDnType.RENAME );
             modDnControl.setEntryDn( renameContext.getDn().getName() );
             modDnControl.setNewRdn( renameContext.getNewRdn().getName() );
@@ -411,7 +411,7 @@ public class SyncReplSearchListener impl
     }
 
 
-    private void handleWriteFuture( WriteFuture future, Entry entry, EventType event, SyncModifyDnControl modDnControl )
+    private void handleWriteFuture( WriteFuture future, Entry entry, EventType event, SyncModifyDnDecorator modDnControl )
     {
         future.awaitUninterruptibly();
         if ( !future.isWritten() )

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValue.java?rev=1064985&r1=1064984&r2=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncRequestValue/SyncRequestValue.java Sat Jan 29 09:11:15 2011
@@ -32,8 +32,14 @@ import org.apache.directory.shared.ldap.
 public class SyncRequestValue implements ISyncRequestValue
 {
     private boolean isCritical;
-    private byte[] cookie;
+    
+    /** The synchronization type */
     private SynchronizationModeEnum mode;
+    
+    /** The Sync cookie */
+    private byte[] cookie;
+    
+    /** The reloadHint flag */
     private boolean isReloadHint;
     
     

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=1064985&r1=1064984&r2=1064985&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 Sat Jan 29 09:11:15 2011
@@ -43,15 +43,6 @@ import org.apache.directory.shared.util.
  */
 public class SyncRequestValueDecorator  extends ControlDecorator<ISyncRequestValue> implements ISyncRequestValue
 {
-    /** The synchronization type */
-    private SynchronizationModeEnum mode;
-    
-    /** The Sync cookie */
-    private byte[] cookie;
-    
-    /** The reloadHint flag */
-    private boolean reloadHint;
-    
     /** The global length for this control */
     private int syncRequestValueLength;
     
@@ -79,7 +70,7 @@ public class SyncRequestValueDecorator  
      */
     public SynchronizationModeEnum getMode()
     {
-        return mode;
+        return getDecorated().getMode();
     }
 
     
@@ -88,7 +79,7 @@ public class SyncRequestValueDecorator  
      */
     public void setMode( SynchronizationModeEnum mode )
     {
-        this.mode = mode;
+        getDecorated().setMode( mode );
     }
 
     
@@ -97,7 +88,7 @@ public class SyncRequestValueDecorator  
      */
     public byte[] getCookie()
     {
-        return cookie;
+        return getDecorated().getCookie();
     }
 
     
@@ -106,7 +97,7 @@ public class SyncRequestValueDecorator  
      */
     public void setCookie( byte[] cookie )
     {
-        this.cookie = cookie;
+        getDecorated().setCookie( cookie );
     }
 
     
@@ -115,7 +106,7 @@ public class SyncRequestValueDecorator  
      */
     public boolean isReloadHint()
     {
-        return reloadHint;
+        return getDecorated().isReloadHint();
     }
 
     
@@ -124,9 +115,10 @@ public class SyncRequestValueDecorator  
      */
     public void setReloadHint( boolean reloadHint )
     {
-        this.reloadHint = reloadHint;
+        getDecorated().setReloadHint( reloadHint );
     }
-
+    
+    
     /**
      * Compute the SyncRequestValue length.
      * 
@@ -144,13 +136,13 @@ public class SyncRequestValueDecorator  
         syncRequestValueLength = 1 + 1 + 1;
         
         // The cookie length, if we have a cookie
-        if ( cookie != null )
+        if ( getCookie() != null )
         {
-            syncRequestValueLength += 1 + TLV.getNbBytes( cookie.length ) + cookie.length;
+            syncRequestValueLength += 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length;
         }
         
         // The reloadHint length, default to false
-        if ( reloadHint )
+        if ( isReloadHint() )
         {
             syncRequestValueLength += 1 + 1 + 1;
         }
@@ -189,19 +181,19 @@ public class SyncRequestValueDecorator  
 
         // The mode
         buffer.put(  UniversalTag.ENUMERATED.getValue() );
-        buffer.put( (byte)0x01 );
-        buffer.put( Value.getBytes( mode.getValue() ) );
+        buffer.put( ( byte )0x01 );
+        buffer.put( Value.getBytes( getMode().getValue() ) );
 
         // The cookie
-        if ( cookie != null )
+        if ( getCookie() != null )
         {
-            Value.encode( buffer, cookie );
+            Value.encode( buffer, getCookie() );
         }
         
         // The reloadHint if not false
-        if ( reloadHint )
+        if ( isReloadHint() )
         {
-            Value.encode( buffer, reloadHint );
+            Value.encode( buffer, isReloadHint() );
         }
         
         return buffer;
@@ -226,19 +218,19 @@ public class SyncRequestValueDecorator  
 
                 // The mode
                 buffer.put(  UniversalTag.ENUMERATED.getValue() );
-                buffer.put( (byte)0x01 );
-                buffer.put( Value.getBytes( mode.getValue() ) );
+                buffer.put( ( byte ) 0x01 );
+                buffer.put( Value.getBytes( getMode().getValue() ) );
 
                 // The cookie
-                if ( cookie != null )
+                if ( getCookie() != null )
                 {
-                    Value.encode( buffer, cookie );
+                    Value.encode( buffer, getCookie() );
                 }
                 
                 // The reloadHint if not false
-                if ( reloadHint )
+                if ( isReloadHint() )
                 {
-                    Value.encode( buffer, reloadHint );
+                    Value.encode( buffer, isReloadHint() );
                 }
 
                 value = buffer.array();
@@ -267,9 +259,9 @@ public class SyncRequestValueDecorator  
 
         SyncRequestValueDecorator otherControl = ( SyncRequestValueDecorator ) o;
         
-        return ( mode == otherControl.mode ) && 
-            ( reloadHint == otherControl.reloadHint ) &&
-            ( Arrays.equals( cookie, otherControl.cookie ) );
+        return ( getMode() == otherControl.getMode() ) && 
+            ( isReloadHint() == otherControl.isReloadHint() ) &&
+            ( Arrays.equals( getCookie(), otherControl.getCookie() ) );
     }
 
 
@@ -283,10 +275,10 @@ public class SyncRequestValueDecorator  
         sb.append( "    SyncRequestValue control :\n" );
         sb.append( "        oid : " ).append( getOid() ).append( '\n' );
         sb.append( "        critical : " ).append( isCritical() ).append( '\n' );
-        sb.append( "        mode              : '" ).append( mode ).append( "'\n" );
+        sb.append( "        mode              : '" ).append( getMode() ).append( "'\n" );
         sb.append( "        cookie            : '" ).
-            append( Strings.dumpBytes(cookie) ).append( "'\n" );
-        sb.append( "        refreshAndPersist : '" ).append( reloadHint ).append( "'\n" );
+            append( Strings.dumpBytes( getCookie() ) ).append( "'\n" );
+        sb.append( "        refreshAndPersist : '" ).append( isReloadHint() ).append( "'\n" );
 
         return sb.toString();
     }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValue.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValue.java?rev=1064985&r1=1064984&r2=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValue.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncStateValue/SyncStateValue.java Sat Jan 29 09:11:15 2011
@@ -32,10 +32,16 @@ import org.apache.directory.shared.ldap.
  */
 public class SyncStateValue implements ISyncStateValue
 {
-    private boolean critical;
+    /** The syncStateEnum type */
+    private SyncStateTypeEnum type;
+
+    /** The Sync cookie */
     private byte[] cookie;
+
+    /** The entryUUID */
     private byte[] entryUuid;
-    private SyncStateTypeEnum type;
+
+    private boolean critical;
     
     
     /**

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=1064985&r1=1064984&r2=1064985&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 Sat Jan 29 09:11:15 2011
@@ -43,15 +43,6 @@ import org.apache.directory.shared.util.
  */
 public class SyncStateValueDecorator extends ControlDecorator<ISyncStateValue> implements ISyncStateValue
 {
-    /** The syncStateEnum type */
-    private SyncStateTypeEnum syncStateType;
-
-    /** The Sync cookie */
-    private byte[] cookie;
-
-    /** The entryUUID */
-    private byte[] entryUUID;
-
     /** Global length for the control */
     private int syncStateSeqLength;
 
@@ -79,7 +70,7 @@ public class SyncStateValueDecorator ext
      */
     public byte[] getCookie()
     {
-        return cookie;
+        return getDecorated().getCookie();
     }
 
 
@@ -88,7 +79,7 @@ public class SyncStateValueDecorator ext
      */
     public void setCookie( byte[] cookie )
     {
-        this.cookie = cookie;
+        getDecorated().setCookie( cookie );
     }
 
 
@@ -97,7 +88,7 @@ public class SyncStateValueDecorator ext
      */
     public SyncStateTypeEnum getSyncStateType()
     {
-        return syncStateType;
+        return getDecorated().getSyncStateType();
     }
 
 
@@ -106,7 +97,7 @@ public class SyncStateValueDecorator ext
      */
     public void setSyncStateType( SyncStateTypeEnum syncStateType )
     {
-        this.syncStateType = syncStateType;
+        getDecorated().setSyncStateType( syncStateType );
     }
 
 
@@ -115,7 +106,7 @@ public class SyncStateValueDecorator ext
      */
     public byte[] getEntryUUID()
     {
-        return entryUUID;
+        return getDecorated().getEntryUUID();
     }
 
 
@@ -124,7 +115,7 @@ public class SyncStateValueDecorator ext
      */
     public void setEntryUUID( byte[] entryUUID )
     {
-        this.entryUUID = entryUUID;
+        getDecorated().setEntryUUID( entryUUID );
     }
 
 
@@ -144,12 +135,12 @@ public class SyncStateValueDecorator ext
         // The sync state type length
         syncStateSeqLength = 1 + 1 + 1;
 
-        syncStateSeqLength += 1 + TLV.getNbBytes( entryUUID.length ) + entryUUID.length;
+        syncStateSeqLength += 1 + TLV.getNbBytes( getEntryUUID().length ) + getEntryUUID().length;
 
         // The cookie length, if we have a cookie
-        if ( cookie != null )
+        if ( getCookie() != null )
         {
-            syncStateSeqLength += 1 + TLV.getNbBytes( cookie.length ) + cookie.length;
+            syncStateSeqLength += 1 + TLV.getNbBytes( getCookie().length ) + getCookie().length;
         }
         
         valueLength = 1 + TLV.getNbBytes( syncStateSeqLength ) + syncStateSeqLength;
@@ -186,15 +177,15 @@ public class SyncStateValueDecorator ext
         // The mode
         buffer.put( UniversalTag.ENUMERATED.getValue() );
         buffer.put( ( byte ) 0x01 );
-        buffer.put( Value.getBytes( syncStateType.getValue() ) );
+        buffer.put( Value.getBytes( getSyncStateType().getValue() ) );
 
         // the entryUUID
-        Value.encode( buffer, entryUUID );
+        Value.encode( buffer, getEntryUUID() );
 
         // The cookie
-        if ( cookie != null )
+        if ( getCookie() != null )
         {
-            Value.encode( buffer, cookie );
+            Value.encode( buffer, getCookie() );
         }
 
         return buffer;
@@ -220,15 +211,15 @@ public class SyncStateValueDecorator ext
                 // The mode
                 buffer.put( UniversalTag.ENUMERATED.getValue() );
                 buffer.put( ( byte ) 0x01 );
-                buffer.put( Value.getBytes( syncStateType.getValue() ) );
+                buffer.put( Value.getBytes( getSyncStateType().getValue() ) );
 
                 // the entryUUID
-                Value.encode( buffer, entryUUID );
+                Value.encode( buffer, getEntryUUID() );
 
                 // The cookie
-                if ( cookie != null )
+                if ( getCookie() != null )
                 {
-                    Value.encode( buffer, cookie );
+                    Value.encode( buffer, getCookie() );
                 }
 
                 value = buffer.array();
@@ -255,9 +246,9 @@ public class SyncStateValueDecorator ext
 
         SyncStateValueDecorator otherControl = ( SyncStateValueDecorator ) o;
         
-        return ( syncStateType == otherControl.syncStateType ) && 
-            ( Arrays.equals( entryUUID, otherControl.entryUUID ) ) &&
-            ( Arrays.equals( cookie, otherControl.cookie ) );
+        return ( getSyncStateType() == otherControl.getSyncStateType() ) && 
+            ( Arrays.equals( getEntryUUID(), otherControl.getEntryUUID() ) ) &&
+            ( Arrays.equals( getCookie(), otherControl.getCookie() ) );
     }
 
 
@@ -271,9 +262,9 @@ public class SyncStateValueDecorator ext
         sb.append( "    SyncStateValue control :\n" );
         sb.append( "        oid : " ).append( getOid() ).append( '\n' );
         sb.append( "        critical : " ).append( isCritical() ).append( '\n' );
-        sb.append( "        syncStateType     : '" ).append( syncStateType ).append( "'\n" );
-        sb.append( "        entryUUID         : '" ).append( Strings.dumpBytes(entryUUID) ).append( "'\n" );
-        sb.append( "        cookie            : '" ).append( Strings.dumpBytes(cookie) ).append( "'\n" );
+        sb.append( "        syncStateType     : '" ).append( getSyncStateType() ).append( "'\n" );
+        sb.append( "        entryUUID         : '" ).append( Strings.dumpBytes( getEntryUUID() ) ).append( "'\n" );
+        sb.append( "        cookie            : '" ).append( Strings.dumpBytes( getCookie()) ).append( "'\n" );
 
         return sb.toString();
     }

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/ISyncModifyDn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/ISyncModifyDn.java?rev=1064985&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/ISyncModifyDn.java (added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/ISyncModifyDn.java Sat Jan 29 09:11:15 2011
@@ -0,0 +1,74 @@
+/*
+ *   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.syncmodifydn;
+
+
+import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
+import org.apache.directory.shared.ldap.model.message.Control;
+
+
+/**
+ * A SyncModifyDnControl object, to send the parameters used in a MODIFYDN operation
+ * that was carried out on a syncrepl provider server.
+ * 
+ * The consumer will use the values present in this control to perform the same operation
+ * on its local data, which helps in avoiding huge number of updates to the consumer.
+ * 
+ * NOTE: syncrepl, defined in RFC 4533, doesn't mention about this approach, this is a special
+ *       extension provided by Apache Directory Server
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public interface ISyncModifyDn extends Control
+{
+
+    /** This control OID */
+    public static final String OID = "1.3.6.1.4.1.4203.1.9.1.5";
+    
+
+    String getEntryDn();
+
+
+    void setEntryDn( String entryDn );
+
+
+    String getNewSuperiorDn();
+
+
+    void setNewSuperiorDn( String newSuperiorDn );
+
+
+    String getNewRdn();
+
+
+    void setNewRdn( String newRdn );
+
+
+    boolean isDeleteOldRdn();
+
+
+    void setDeleteOldRdn( boolean deleteOldRdn );
+
+
+    SyncModifyDnType getModDnType();
+
+
+    void setModDnType( SyncModifyDnType modDnType );
+}
\ No newline at end of file

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDn.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDn.java?rev=1064985&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDn.java (added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDn.java Sat Jan 29 09:11:15 2011
@@ -0,0 +1,160 @@
+/*
+ *   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.syncmodifydn;
+
+
+import org.apache.directory.shared.ldap.message.control.replication.SyncModifyDnType;
+
+
+/**
+ * A simple {@link ISyncModifyDn} implementation to hold properties.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SyncModifyDn implements ISyncModifyDn
+{
+    /** the entry's Dn to be changed */
+    private String entryDn;
+
+    /** target entry's new parent Dn */
+    private String newSuperiorDn;
+
+    /** the new Rdn */
+    private String newRdn;
+
+    /** flag to indicate whether to delete the old Rdn */
+    private boolean deleteOldRdn = false;
+
+    private SyncModifyDnType modDnType;
+    
+    
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getOid()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isCritical()
+    {
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setCritical( boolean isCritical )
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getEntryDn()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setEntryDn( String entryDn )
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getNewSuperiorDn()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setNewSuperiorDn( String newSuperiorDn )
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getNewRdn()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setNewRdn( String newRdn )
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isDeleteOldRdn()
+    {
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setDeleteOldRdn( boolean deleteOldRdn )
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public SyncModifyDnType getModDnType()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setModDnType( SyncModifyDnType modDnType )
+    {
+    }
+
+}

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java (from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlContainer.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?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlContainer.java&r1=1064846&r2=1064985&rev=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlContainer.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnContainer.java Sat Jan 29 09:11:15 2011
@@ -28,29 +28,44 @@ import org.apache.directory.shared.asn1.
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SyncModifyDnControlContainer extends AbstractContainer
+public class SyncModifyDnContainer extends AbstractContainer
 {
     /** SyncModifyDnControl */
-    private SyncModifyDnControl control;
+    private SyncModifyDnDecorator control;
 
 
     /**
      * Creates a new SyncStateValueControlContainer object. We will store one grammar,
      * it's enough ...
      */
-    public SyncModifyDnControlContainer()
+    public SyncModifyDnContainer()
     {
         super();
+        this.control = new SyncModifyDnDecorator();
         stateStack = new int[1];
-        grammar = SyncModifyDnControlGrammar.getInstance();
-        setTransition( SyncModifyDnControlStatesEnum.START_SYNC_MODDN );
+        grammar = SyncModifyDnGrammar.getInstance();
+        setTransition( SyncModifyDnStatesEnum.START_SYNC_MODDN );
+    }
+
+
+    /**
+     * Creates a new SyncStateValueControlContainer object. We will store one grammar,
+     * it's enough ...
+     */
+    public SyncModifyDnContainer( SyncModifyDnDecorator control )
+    {
+        super();
+        this.control = control;
+        stateStack = new int[1];
+        grammar = SyncModifyDnGrammar.getInstance();
+        setTransition( SyncModifyDnStatesEnum.START_SYNC_MODDN );
     }
 
 
     /**
      * @return Returns the SyncModifyDnControl control.
      */
-    public SyncModifyDnControl getSyncModifyDnControl()
+    public SyncModifyDnDecorator getSyncModifyDnControl()
     {
         return control;
     }
@@ -62,10 +77,11 @@ public class SyncModifyDnControlContaine
      * 
      * @param control the SyncStateValueControl to set.
      */
-    public void setSyncModifyDnControl( SyncModifyDnControl control )
+    public void setSyncModifyDnDecorator( SyncModifyDnDecorator control )
     {
         this.control = control;
     }
+    
 
     /**
      * Clean the container

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java (from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.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?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java&r1=1064846&r2=1064985&rev=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnDecorator.java Sat Jan 29 09:11:15 2011
@@ -22,13 +22,16 @@ package org.apache.directory.shared.ldap
 
 import java.nio.ByteBuffer;
 
+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.asn1.util.Asn1StringUtils;
 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.ldap.message.control.replication.SyncModifyDnType;
 
 
@@ -44,11 +47,8 @@ import org.apache.directory.shared.ldap.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SyncModifyDnControl extends AbstractControl
+public class SyncModifyDnDecorator extends ControlDecorator<ISyncModifyDn> implements ISyncModifyDn
 {
-    /** This control OID */
-    public static final String CONTROL_OID = "1.3.6.1.4.1.4203.1.9.1.5";
-
     /** the entry's Dn to be changed */
     private String entryDn;
 
@@ -68,16 +68,20 @@ public class SyncModifyDnControl extends
 
     private int renameLen = 0;
     private int moveAndRenameLen = 0;
+    
+    private byte[] value;
 
+    /** An instance of this decoder */
+    private Asn1Decoder decoder = new Asn1Decoder();
 
-    public SyncModifyDnControl()
+    
+    public SyncModifyDnDecorator()
     {
-        super( CONTROL_OID );
-        decoder = new SyncModifyDnControlDecoder();
+        super( new SyncModifyDn() );
     }
 
     
-    public SyncModifyDnControl( SyncModifyDnType type )
+    public SyncModifyDnDecorator( SyncModifyDnType type )
     {
         this();
         this.modDnType = type;
@@ -163,20 +167,20 @@ public class SyncModifyDnControl extends
         switch ( modDnType )
         {
             case MOVE:
-                buffer.put( ( byte ) SyncModifyDnControlTags.MOVE_TAG.getValue() );
+                buffer.put( ( byte ) SyncModifyDnTags.MOVE_TAG.getValue() );
                 buffer.put( TLV.getBytes( newSuperiorDn.length() ) );
                 buffer.put( Asn1StringUtils.getBytesUtf8( newSuperiorDn ) );
                 break;
 
             case RENAME:
-                buffer.put( ( byte ) SyncModifyDnControlTags.RENAME_TAG.getValue() );
+                buffer.put( ( byte ) SyncModifyDnTags.RENAME_TAG.getValue() );
                 buffer.put( TLV.getBytes( renameLen ) );
                 Value.encode( buffer, newRdn );
                 Value.encode( buffer, deleteOldRdn );
                 break;
 
             case MOVEANDRENAME:
-                buffer.put( ( byte ) SyncModifyDnControlTags.MOVEANDRENAME_TAG.getValue() );
+                buffer.put( ( byte ) SyncModifyDnTags.MOVEANDRENAME_TAG.getValue() );
                 buffer.put( TLV.getBytes( moveAndRenameLen ) );
                 Value.encode( buffer, newSuperiorDn );
                 Value.encode( buffer, newRdn );
@@ -210,20 +214,20 @@ public class SyncModifyDnControl extends
                 switch ( modDnType )
                 {
                     case MOVE:
-                        buffer.put( ( byte ) SyncModifyDnControlTags.MOVE_TAG.getValue() );
+                        buffer.put( ( byte ) SyncModifyDnTags.MOVE_TAG.getValue() );
                         buffer.put( TLV.getBytes( newSuperiorDn.length() ) );
                         buffer.put( Asn1StringUtils.getBytesUtf8( newSuperiorDn ) );
                         break;
 
                     case RENAME:
-                        buffer.put( ( byte ) SyncModifyDnControlTags.RENAME_TAG.getValue() );
+                        buffer.put( ( byte ) SyncModifyDnTags.RENAME_TAG.getValue() );
                         buffer.put( TLV.getBytes( renameLen ) );
                         Value.encode( buffer, newRdn );
                         Value.encode( buffer, deleteOldRdn );
                         break;
 
                     case MOVEANDRENAME:
-                        buffer.put( ( byte ) SyncModifyDnControlTags.MOVEANDRENAME_TAG.getValue() );
+                        buffer.put( ( byte ) SyncModifyDnTags.MOVEANDRENAME_TAG.getValue() );
                         buffer.put( TLV.getBytes( moveAndRenameLen ) );
                         Value.encode( buffer, newSuperiorDn );
                         Value.encode( buffer, newRdn );
@@ -243,60 +247,90 @@ public class SyncModifyDnControl extends
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getEntryDn()
     {
         return entryDn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setEntryDn( String entryDn )
     {
         this.entryDn = entryDn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getNewSuperiorDn()
     {
         return newSuperiorDn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setNewSuperiorDn( String newSuperiorDn )
     {
         this.newSuperiorDn = newSuperiorDn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public String getNewRdn()
     {
         return newRdn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setNewRdn( String newRdn )
     {
         this.newRdn = newRdn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean isDeleteOldRdn()
     {
         return deleteOldRdn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setDeleteOldRdn( boolean deleteOldRdn )
     {
         this.deleteOldRdn = deleteOldRdn;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public SyncModifyDnType getModDnType()
     {
         return modDnType;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void setModDnType( SyncModifyDnType modDnType )
     {
         if( this.modDnType != null )
@@ -317,7 +351,7 @@ public class SyncModifyDnControl extends
             return false;
         }
 
-        SyncModifyDnControl otherControl = ( SyncModifyDnControl ) o;
+        SyncModifyDnDecorator otherControl = ( SyncModifyDnDecorator ) o;
         
         if ( newRdn != null )
         {
@@ -372,4 +406,14 @@ public class SyncModifyDnControl extends
 
         return sb.toString();
     }
+
+
+    @Override
+    public Asn1Object decode( byte[] controlBytes ) throws DecoderException
+    {
+        ByteBuffer bb = ByteBuffer.wrap( controlBytes );
+        SyncModifyDnContainer container = new SyncModifyDnContainer( this );
+        decoder.decode( bb, container );
+        return this;
+    }
 }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnGrammar.java (from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlGrammar.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnGrammar.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnGrammar.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlGrammar.java&r1=1064846&r2=1064985&rev=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlGrammar.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnGrammar.java Sat Jan 29 09:11:15 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;
@@ -64,27 +63,27 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public final class SyncModifyDnControlGrammar extends AbstractGrammar
+public final class SyncModifyDnGrammar extends AbstractGrammar
 {
     /** The logger */
-    static final Logger LOG = LoggerFactory.getLogger( SyncModifyDnControlGrammar.class );
+    static final Logger LOG = LoggerFactory.getLogger( SyncModifyDnGrammar.class );
 
     /** Speedup for logs */
     static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
     /** The instance of grammar. SyncStateValueControlGrammar is a singleton */
-    private static Grammar instance = new SyncModifyDnControlGrammar();
+    private static Grammar instance = new SyncModifyDnGrammar();
 
 
     /**
      * Creates a new SyncModifyDnControlGrammar object.
      */
-    private SyncModifyDnControlGrammar()
+    private SyncModifyDnGrammar()
     {
-        setName( SyncModifyDnControlGrammar.class.getName() );
+        setName( SyncModifyDnGrammar.class.getName() );
 
         // Create the transitions table
-        super.transitions = new GrammarTransition[SyncModifyDnControlStatesEnum.LAST_SYNC_MODDN_VALUE_STATE.ordinal()][256];
+        super.transitions = new GrammarTransition[SyncModifyDnStatesEnum.LAST_SYNC_MODDN_VALUE_STATE.ordinal()][256];
 
         /** 
          * Transition from initial state to SyncModifyDnControl sequence
@@ -93,8 +92,8 @@ public final class SyncModifyDnControlGr
          *     
          * Initialize the SyncModifyDnControl object
          */
-        super.transitions[SyncModifyDnControlStatesEnum.START_SYNC_MODDN.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.START_SYNC_MODDN, SyncModifyDnControlStatesEnum.SYNC_MODDN_VALUE_SEQUENCE_STATE,
+        super.transitions[SyncModifyDnStatesEnum.START_SYNC_MODDN.ordinal()][UniversalTag.SEQUENCE.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.START_SYNC_MODDN, SyncModifyDnStatesEnum.SYNC_MODDN_VALUE_SEQUENCE_STATE,
             UniversalTag.SEQUENCE.getValue(), null );
 
         /** 
@@ -105,15 +104,14 @@ public final class SyncModifyDnControlGr
          *     
          * Stores the entryDn value
          */
-        super.transitions[SyncModifyDnControlStatesEnum.SYNC_MODDN_VALUE_SEQUENCE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.SYNC_MODDN_VALUE_SEQUENCE_STATE,
-            SyncModifyDnControlStatesEnum.ENTRY_DN_STATE, UniversalTag.OCTET_STRING.getValue(), new GrammarAction(
-                "Set SyncModifyDnControl entryDn value" )
+        super.transitions[SyncModifyDnStatesEnum.SYNC_MODDN_VALUE_SEQUENCE_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.SYNC_MODDN_VALUE_SEQUENCE_STATE,
+            SyncModifyDnStatesEnum.ENTRY_DN_STATE, UniversalTag.OCTET_STRING.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl entryDn value" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    Value value = syncModifyDnControlContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     // Check that the value is into the allowed interval
                     String entryDn = Strings.utf8ToString(value.getData());
@@ -123,10 +121,10 @@ public final class SyncModifyDnControlGr
                         LOG.debug( "ModDN entryDn = {}", entryDn );
                     }
                     
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setEntryDn( entryDn );
+                    container.getSyncModifyDnControl().setEntryDn( entryDn );
                     
-                    // move on to the next transistion
-                    syncModifyDnControlContainer.setGrammarEndAllowed( false );
+                    // move on to the next transition
+                    container.setGrammarEndAllowed( false );
                 }
             } );
 
@@ -139,17 +137,17 @@ public final class SyncModifyDnControlGr
          * Stores the newSuperiorDn value
          */
 
-        super.transitions[SyncModifyDnControlStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnControlTags.MOVE_TAG.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.ENTRY_DN_STATE, SyncModifyDnControlStatesEnum.MOVE_STATE,
-            SyncModifyDnControlTags.MOVE_TAG.getValue(), new GrammarAction( "Set SyncModifyDnControl newSuperiorDn" )
+        super.transitions[SyncModifyDnStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnTags.MOVE_TAG.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.ENTRY_DN_STATE, SyncModifyDnStatesEnum.MOVE_STATE,
+            SyncModifyDnTags.MOVE_TAG.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl newSuperiorDn" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setModDnType( SyncModifyDnType.MOVE );
+                    container.getSyncModifyDnControl().setModDnType( SyncModifyDnType.MOVE );
 
                     // We need to read the move operation's superiorDN
-                    Value value = syncModifyDnControlContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     // Check that the value is into the allowed interval
                     String newSuperiorDn = Strings.utf8ToString(value.getData());
@@ -159,10 +157,10 @@ public final class SyncModifyDnControlGr
                         LOG.debug( "ModDN newSuperiorDn = {}", newSuperiorDn );
                     }
                     
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setNewSuperiorDn( newSuperiorDn );
+                    container.getSyncModifyDnControl().setNewSuperiorDn( newSuperiorDn );
                     
-                    // move on to the next transistion
-                    syncModifyDnControlContainer.setGrammarEndAllowed( true );
+                    // move on to the next transition
+                    container.setGrammarEndAllowed( true );
                 }
             } );
 
@@ -171,16 +169,15 @@ public final class SyncModifyDnControlGr
          * read the newSuperiorDn
          * move-name       [0] LDAPDN
          */
-        super.transitions[SyncModifyDnControlStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnControlTags.RENAME_TAG.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.ENTRY_DN_STATE, SyncModifyDnControlStatesEnum.RENAME_STATE,
-            SyncModifyDnControlTags.RENAME_TAG.getValue(), new GrammarAction( "enter SyncModifyDnControl rename choice" )
+        super.transitions[SyncModifyDnStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnTags.RENAME_TAG.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.ENTRY_DN_STATE, SyncModifyDnStatesEnum.RENAME_STATE,
+            SyncModifyDnTags.RENAME_TAG.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "enter SyncModifyDnControl rename choice" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setModDnType( SyncModifyDnType.RENAME );
-
-                    syncModifyDnControlContainer.setGrammarEndAllowed( false );
+                    container.getSyncModifyDnControl().setModDnType( SyncModifyDnType.RENAME );
+                    container.setGrammarEndAllowed( false );
                 }
             } );
 
@@ -193,14 +190,14 @@ public final class SyncModifyDnControlGr
          *            
          * Stores the newRdn value
          */
-        super.transitions[SyncModifyDnControlStatesEnum.RENAME_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.RENAME_STATE, SyncModifyDnControlStatesEnum.RENAME_NEW_RDN_STATE,
-            UniversalTag.OCTET_STRING.getValue(), new GrammarAction( "Set SyncModifyDnControl newRdn value" )
+        super.transitions[SyncModifyDnStatesEnum.RENAME_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.RENAME_STATE, SyncModifyDnStatesEnum.RENAME_NEW_RDN_STATE,
+            UniversalTag.OCTET_STRING.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl newRdn value" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    Value value = syncModifyDnControlContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     String newRdn = Strings.utf8ToString(value.getData());
 
@@ -209,10 +206,10 @@ public final class SyncModifyDnControlGr
                         LOG.debug( "newRdn = {}", newRdn );
                     }
 
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setNewRdn( newRdn );
+                    container.getSyncModifyDnControl().setNewRdn( newRdn );
 
                     // terminal state
-                    syncModifyDnControlContainer.setGrammarEndAllowed( false );
+                    container.setGrammarEndAllowed( false );
                 }
             } );
        
@@ -227,14 +224,14 @@ public final class SyncModifyDnControlGr
          *            
          * Stores the deleteOldRdn value
          */
-        super.transitions[SyncModifyDnControlStatesEnum.RENAME_NEW_RDN_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.RENAME_NEW_RDN_STATE, SyncModifyDnControlStatesEnum.RENAME_DEL_OLD_RDN_STATE,
-            UniversalTag.BOOLEAN.getValue(), new GrammarAction( "Set SyncModifyDnControl deleteOldRdn value" )
+        super.transitions[SyncModifyDnStatesEnum.RENAME_NEW_RDN_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.RENAME_NEW_RDN_STATE, SyncModifyDnStatesEnum.RENAME_DEL_OLD_RDN_STATE,
+            UniversalTag.BOOLEAN.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl deleteOldRdn value" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    Value value = syncModifyDnControlContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     byte deleteOldRdn = value.getData()[0];
 
@@ -245,11 +242,11 @@ public final class SyncModifyDnControlGr
 
                     if( deleteOldRdn != 0 )
                     {
-                        syncModifyDnControlContainer.getSyncModifyDnControl().setDeleteOldRdn( true );
+                        container.getSyncModifyDnControl().setDeleteOldRdn( true );
                     }
 
                     // terminal state
-                    syncModifyDnControlContainer.setGrammarEndAllowed( true );
+                    container.setGrammarEndAllowed( true );
                 }
             } );
         
@@ -260,16 +257,15 @@ public final class SyncModifyDnControlGr
          *     
          * Stores the deleteOldRdn flag
          */
-        super.transitions[SyncModifyDnControlStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnControlTags.MOVEANDRENAME_TAG.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.ENTRY_DN_STATE, SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_STATE,
-            SyncModifyDnControlTags.MOVEANDRENAME_TAG.getValue(), new GrammarAction( "enter SyncModifyDnControl moveAndRename choice" )
+        super.transitions[SyncModifyDnStatesEnum.ENTRY_DN_STATE.ordinal()][SyncModifyDnTags.MOVEANDRENAME_TAG.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.ENTRY_DN_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_STATE,
+            SyncModifyDnTags.MOVEANDRENAME_TAG.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "enter SyncModifyDnControl moveAndRename choice" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setModDnType( SyncModifyDnType.MOVEANDRENAME );
-
-                    syncModifyDnControlContainer.setGrammarEndAllowed( false );
+                    container.getSyncModifyDnControl().setModDnType( SyncModifyDnType.MOVEANDRENAME );
+                    container.setGrammarEndAllowed( false );
                 }
             } );
 
@@ -282,14 +278,14 @@ public final class SyncModifyDnControlGr
          *            
          * Stores the newRdn value
          */
-        super.transitions[SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_STATE, SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE,
-            UniversalTag.OCTET_STRING.getValue(), new GrammarAction( "Set SyncModifyDnControl moveAndRename state's newSuperirorDN value" )
+        super.transitions[SyncModifyDnStatesEnum.MOVE_AND_RENAME_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.MOVE_AND_RENAME_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE,
+            UniversalTag.OCTET_STRING.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl moveAndRename state's newSuperirorDN value" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    Value value = syncModifyDnControlContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     String newSuperirorDn = Strings.utf8ToString(value.getData());
 
@@ -298,10 +294,10 @@ public final class SyncModifyDnControlGr
                         LOG.debug( "newSuperirorDn = {}", newSuperirorDn );
                     }
 
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setNewSuperiorDn( newSuperirorDn );
+                    container.getSyncModifyDnControl().setNewSuperiorDn( newSuperirorDn );
 
                     // terminal state
-                    syncModifyDnControlContainer.setGrammarEndAllowed( false );
+                    container.setGrammarEndAllowed( false );
                 }
             } );
 
@@ -314,14 +310,14 @@ public final class SyncModifyDnControlGr
          *            
          * Stores the newRdn value
          */
-        super.transitions[SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE, SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE,
-            UniversalTag.OCTET_STRING.getValue(), new GrammarAction( "Set SyncModifyDnControl moveAndRename state's newRdn value" )
+        super.transitions[SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE.ordinal()][UniversalTag.OCTET_STRING.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_SUPERIOR_DN_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE,
+            UniversalTag.OCTET_STRING.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl moveAndRename state's newRdn value" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    Value value = syncModifyDnControlContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     String newRdn = Strings.utf8ToString(value.getData());
 
@@ -330,10 +326,10 @@ public final class SyncModifyDnControlGr
                         LOG.debug( "newRdn = {}", newRdn );
                     }
 
-                    syncModifyDnControlContainer.getSyncModifyDnControl().setNewRdn( newRdn );
+                    container.getSyncModifyDnControl().setNewRdn( newRdn );
 
                     // terminal state
-                    syncModifyDnControlContainer.setGrammarEndAllowed( false );
+                    container.setGrammarEndAllowed( false );
                 }
             } );
         
@@ -346,14 +342,14 @@ public final class SyncModifyDnControlGr
          *     
          * Stores the deleteOldRdn flag
          */
-        super.transitions[SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = new GrammarTransition(
-            SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE, SyncModifyDnControlStatesEnum.MOVE_AND_RENAME_DEL_OLD_RDN_STATE,
-            UniversalTag.BOOLEAN.getValue(), new GrammarAction( "Set SyncModifyDnControl deleteOldRdn value" )
+        super.transitions[SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE.ordinal()][UniversalTag.BOOLEAN.getValue()] = new GrammarTransition(
+            SyncModifyDnStatesEnum.MOVE_AND_RENAME_NEW_RDN_STATE, SyncModifyDnStatesEnum.MOVE_AND_RENAME_DEL_OLD_RDN_STATE,
+            UniversalTag.BOOLEAN.getValue(), 
+            new GrammarAction<SyncModifyDnContainer>( "Set SyncModifyDnControl deleteOldRdn value" )
             {
-                public void action( Asn1Container container ) throws DecoderException
+                public void action( SyncModifyDnContainer container ) throws DecoderException
                 {
-                    SyncModifyDnControlContainer syncModifyDnControlContainer = ( SyncModifyDnControlContainer ) container;
-                    Value value = syncModifyDnControlContainer.getCurrentTLV().getValue();
+                    Value value = container.getCurrentTLV().getValue();
 
                     byte deleteOldRdn = value.getData()[0];
 
@@ -364,11 +360,11 @@ public final class SyncModifyDnControlGr
 
                     if( deleteOldRdn != 0 )
                     {
-                        syncModifyDnControlContainer.getSyncModifyDnControl().setDeleteOldRdn( true );
+                        container.getSyncModifyDnControl().setDeleteOldRdn( true );
                     }
 
                     // terminal state
-                    syncModifyDnControlContainer.setGrammarEndAllowed( true );
+                    container.setGrammarEndAllowed( true );
                 }
             } );
 

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnStatesEnum.java (from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlStatesEnum.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnStatesEnum.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnStatesEnum.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlStatesEnum.java&r1=1064846&r2=1064985&rev=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlStatesEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnStatesEnum.java Sat Jan 29 09:11:15 2011
@@ -30,7 +30,7 @@ import org.apache.directory.shared.asn1.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum SyncModifyDnControlStatesEnum implements States
+public enum SyncModifyDnStatesEnum implements States
 {
     // ~ Static fields/initializers
     // -----------------------------------------------------------------
@@ -97,7 +97,7 @@ public enum SyncModifyDnControlStatesEnu
      */
     public String getGrammarName( Grammar grammar )
     {
-        if ( grammar instanceof SyncModifyDnControlGrammar )
+        if ( grammar instanceof SyncModifyDnGrammar )
         {
             return "SYNC_MODIFYDN_GRAMMAR";
         }
@@ -130,7 +130,7 @@ public enum SyncModifyDnControlStatesEnu
     /**
      * {@inheritDoc}
      */
-    public SyncModifyDnControlStatesEnum getStartState()
+    public SyncModifyDnStatesEnum getStartState()
     {
         return START_SYNC_MODDN;
     }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnTags.java (from r1064846, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlTags.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnTags.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnTags.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlTags.java&r1=1064846&r2=1064985&rev=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnControlTags.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/replication/syncmodifydn/SyncModifyDnTags.java Sat Jan 29 09:11:15 2011
@@ -26,7 +26,7 @@ package org.apache.directory.shared.ldap
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public enum SyncModifyDnControlTags
+public enum SyncModifyDnTags
 {
     MOVE_TAG(0x0080), RENAME_TAG(0x00A1), MOVEANDRENAME_TAG(0x00A2);
 
@@ -34,7 +34,7 @@ public enum SyncModifyDnControlTags
     private int value;
 
 
-    private SyncModifyDnControlTags( int value )
+    private SyncModifyDnTags( int value )
     {
         this.value = value;
     }

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java?rev=1064985&r1=1064984&r2=1064985&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/codec/controls/replication/SyncModifyDnControlTest.java Sat Jan 29 09:11:15 2011
@@ -32,9 +32,9 @@ import org.apache.directory.junit.tools.
 import org.apache.directory.shared.asn1.DecoderException;
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.asn1.EncoderException;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControl;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControlContainer;
-import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnControlDecoder;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnContainer;
+import org.apache.directory.shared.ldap.codec.controls.replication.syncmodifydn.SyncModifyDnDecorator;
 import org.apache.directory.shared.util.Strings;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -63,8 +63,8 @@ public class SyncModifyDnControlTest
             } );
         bb.flip();
 
-        SyncModifyDnControlContainer container = new SyncModifyDnControlContainer();
-        container.setSyncModifyDnControl( new SyncModifyDnControl() );
+        SyncModifyDnContainer container = new SyncModifyDnContainer();
+        container.setSyncModifyDnDecorator( new SyncModifyDnDecorator() );
 
         try
         {
@@ -76,7 +76,7 @@ public class SyncModifyDnControlTest
             fail( de.getMessage() );
         }
 
-        SyncModifyDnControl syncmodDnControl = container.getSyncModifyDnControl();
+        SyncModifyDnDecorator syncmodDnControl = container.getSyncModifyDnControl();
         assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
         assertEquals( "ou=dc", syncmodDnControl.getNewSuperiorDn() );
         assertFalse( syncmodDnControl.isDeleteOldRdn() );
@@ -126,8 +126,8 @@ public class SyncModifyDnControlTest
             } );
         bb.flip();
 
-        SyncModifyDnControlContainer container = new SyncModifyDnControlContainer();
-        container.setSyncModifyDnControl( new SyncModifyDnControl() );
+        SyncModifyDnContainer container = new SyncModifyDnContainer();
+        container.setSyncModifyDnDecorator( new SyncModifyDnDecorator() );
 
         try
         {
@@ -139,7 +139,7 @@ public class SyncModifyDnControlTest
             fail( de.getMessage() );
         }
 
-        SyncModifyDnControl syncmodDnControl = container.getSyncModifyDnControl();
+        SyncModifyDnDecorator syncmodDnControl = container.getSyncModifyDnControl();
         assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
         assertEquals( "uid=j", syncmodDnControl.getNewRdn() );
         assertTrue( syncmodDnControl.isDeleteOldRdn() );
@@ -191,8 +191,8 @@ public class SyncModifyDnControlTest
             } );
         bb.flip();
 
-        SyncModifyDnControlContainer container = new SyncModifyDnControlContainer();
-        container.setSyncModifyDnControl( new SyncModifyDnControl() );
+        SyncModifyDnContainer container = new SyncModifyDnContainer();
+        container.setSyncModifyDnDecorator( new SyncModifyDnDecorator() );
 
         try
         {
@@ -204,7 +204,7 @@ public class SyncModifyDnControlTest
             fail( de.getMessage() );
         }
 
-        SyncModifyDnControl syncmodDnControl = container.getSyncModifyDnControl();
+        SyncModifyDnDecorator syncmodDnControl = container.getSyncModifyDnControl();
         assertEquals( "uid=jim", syncmodDnControl.getEntryDn() );
         assertEquals( "ou=dc", syncmodDnControl.getNewSuperiorDn() );
         assertEquals( "uid=j", syncmodDnControl.getNewRdn() );
@@ -255,8 +255,8 @@ public class SyncModifyDnControlTest
             } );
         bb.flip();
 
-        SyncModifyDnControlContainer container = new SyncModifyDnControlContainer();
-        container.setSyncModifyDnControl( new SyncModifyDnControl() );
+        SyncModifyDnContainer container = new SyncModifyDnContainer();
+        container.setSyncModifyDnDecorator( new SyncModifyDnDecorator() );
 
         decoder.decode( bb, container );
     }



Mime
View raw message