directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r1063574 - in /directory: apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ apacheds/trunk/core-jndi/src/main/java/org/apache/directory/server/core/jndi/ apacheds/trunk/core/src/main/java/org/apache...
Date Wed, 26 Jan 2011 02:43:59 GMT
Author: akarasulu
Date: Wed Jan 26 02:43:58 2011
New Revision: 1063574

URL: http://svn.apache.org/viewvc?rev=1063574&view=rev
Log:
preparing to fix some issues with controls

Added:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/DefaultControl.java   (contents, props changed)
      - copied, changed from r1063566, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/AbstractControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaIT.java
      - copied, changed from r1063568, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecoder.java   (contents, props changed)
      - copied, changed from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControlDecoder.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java   (contents, props changed)
      - copied, changed from r1063568, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java
Removed:
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControlDecoder.java
Modified:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
    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/changelog/ChangeLogInterceptor.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/handlers/SearchHandler.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/integ/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java
    directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=system/ou=syntaxcheckers/m-oid=1.3.6.1.4.1.1466.115.121.1.1.ldif
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CodecControlDecorator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java
    directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/AddOperationContext.java Wed Jan 26 02:43:58 2011
@@ -22,10 +22,10 @@ package org.apache.directory.server.core
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.message.AddRequest;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -97,7 +97,7 @@ public class AddOperationContext extends
         dn = addRequest.getEntry().getDn();
         requestControls = addRequest.getControls();
         
-        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
+        if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/CompareOperationContext.java Wed Jan 26 02:43:58 2011
@@ -21,10 +21,10 @@ package org.apache.directory.server.core
 
 
 import org.apache.directory.server.core.CoreSession;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.message.CompareRequest;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.model.entry.BinaryValue;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.schema.AttributeType;
@@ -115,7 +115,7 @@ public class CompareOperationContext ext
         this.value = compareRequest.getAssertionValue();
         this.requestControls = compareRequest.getControls();
         
-        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
+        if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/DeleteOperationContext.java Wed Jan 26 02:43:58 2011
@@ -22,9 +22,9 @@ package org.apache.directory.server.core
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.message.DeleteRequest;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.model.name.Dn;
 
 
@@ -68,7 +68,7 @@ public class DeleteOperationContext exte
         super( session, deleteRequest.getName() );
         requestControls = deleteRequest.getControls();
         
-        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
+        if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/ModifyOperationContext.java Wed Jan 26 02:43:58 2011
@@ -25,10 +25,10 @@ import java.util.List;
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.entry.ServerEntryUtils;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.entry.*;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.model.entry.Modification;
 import org.apache.directory.shared.ldap.model.message.ModifyRequest;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -83,7 +83,7 @@ public class ModifyOperationContext exte
 
         requestControls = modifyRequest.getControls();
 
-        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
+        if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveAndRenameOperationContext.java Wed Jan 26 02:43:58 2011
@@ -22,7 +22,7 @@ package org.apache.directory.server.core
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.i18n.I18n;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -76,7 +76,7 @@ public class MoveAndRenameOperationConte
             throw new IllegalStateException( I18n.err( I18n.ERR_325, modifyDnRequest ) );
         }
 
-        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
+        if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/MoveOperationContext.java Wed Jan 26 02:43:58 2011
@@ -22,8 +22,8 @@ package org.apache.directory.server.core
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
@@ -89,7 +89,7 @@ public class MoveOperationContext extend
             throw new IllegalArgumentException( I18n.err( I18n.ERR_327_MOVE_AND_RENAME_OPERATION, modifyDnRequest ) );
         }
         
-        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
+        if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/RenameOperationContext.java Wed Jan 26 02:43:58 2011
@@ -22,8 +22,8 @@ package org.apache.directory.server.core
 
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.message.MessageTypeEnum;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.model.message.ModifyDnRequest;
 import org.apache.directory.shared.ldap.model.name.Dn;
 import org.apache.directory.shared.ldap.model.name.Rdn;
@@ -85,7 +85,7 @@ public class RenameOperationContext exte
         this.deleteOldRdn = modifyDnRequest.getDeleteOldRdn();
         this.requestControls = modifyDnRequest.getControls();
         
-        if ( requestControls.containsKey( ManageDsaITControl.CONTROL_OID ) )
+        if ( requestControls.containsKey( ManageDsaIT.OID ) )
         {
             ignoreReferral();
         }

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java (original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/interceptor/context/SearchOperationContext.java Wed Jan 26 02:43:58 2011
@@ -28,7 +28,7 @@ import java.util.Set;
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.core.CoreSession;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
 import org.apache.directory.shared.ldap.model.filter.ExprNode;
@@ -92,7 +92,7 @@ public class SearchOperationContext exte
         
         setReturningAttributes( ats );
         
-        throwReferral = !requestControls.containsKey( ManageDsaITControl.CONTROL_OID );
+        throwReferral = !requestControls.containsKey( ManageDsaIT.OID );
     }
 
 
@@ -150,7 +150,7 @@ public class SearchOperationContext exte
      */
     public boolean hasManageDsaItControl()
     {
-        return super.hasRequestControl( ManageDsaITControl.CONTROL_OID );
+        return super.hasRequestControl( ManageDsaIT.OID );
     }
     
     

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=1063574&r1=1063573&r2=1063574&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 Wed Jan 26 02:43:58 2011
@@ -76,7 +76,8 @@ import org.apache.directory.shared.asn1.
 import org.apache.directory.shared.asn1.ber.Asn1Decoder;
 import org.apache.directory.shared.ldap.codec.controls.CascadeControl;
 import org.apache.directory.shared.ldap.codec.controls.ControlEnum;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaITDecorator;
 import org.apache.directory.shared.ldap.codec.controls.ppolicy.PasswordPolicyRequestControl;
 import org.apache.directory.shared.ldap.codec.controls.ppolicy.PasswordPolicyResponseControl;
 import org.apache.directory.shared.ldap.codec.controls.ppolicy.PasswordPolicyResponseControlContainer;
@@ -180,7 +181,7 @@ public abstract class ServerContext impl
     {
         ADS_CONTROLS.put( CascadeControl.CONTROL_OID, ControlEnum.CASCADE_CONTROL );
         ADS_CONTROLS.put( EntryChangeControl.CONTROL_OID, ControlEnum.ENTRY_CHANGE_CONTROL );
-        ADS_CONTROLS.put( ManageDsaITControl.CONTROL_OID, ControlEnum.MANAGE_DSA_IT_CONTROL );
+        ADS_CONTROLS.put( ManageDsaIT.OID, ControlEnum.MANAGE_DSA_IT_CONTROL );
         ADS_CONTROLS.put( PagedResultsControl.CONTROL_OID, ControlEnum.PAGED_RESULTS_CONTROL );
         ADS_CONTROLS.put( PasswordPolicyRequestControl.CONTROL_OID, ControlEnum.PASSWORD_POLICY_REQUEST_CONTROL );
         ADS_CONTROLS.put( PersistentSearchControl.CONTROL_OID, ControlEnum.PERSISTENT_SEARCH_CONTROL );
@@ -401,7 +402,7 @@ public abstract class ServerContext impl
                 break;
 
             case MANAGE_DSA_IT_CONTROL:
-                control = new ManageDsaITControl();
+                control = new ManageDsaITDecorator();
                 break;
 
             case PAGED_RESULTS_CONTROL:

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/changelog/ChangeLogInterceptor.java Wed Jan 26 02:43:58 2011
@@ -37,7 +37,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.partition.ByPassConstants;
 import org.apache.directory.server.core.schema.SchemaService;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaITDecorator;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
@@ -352,9 +352,9 @@ public class ChangeLogInterceptor extend
         
         if ( moveAndRenameContext.isReferralIgnored() )
         {
-            forward.addControl( new ManageDsaITControl() );
+            forward.addControl( new ManageDsaITDecorator() );
             LdifEntry reversedEntry = reverses.get( 0 );
-            reversedEntry.addControl( new ManageDsaITControl() );
+            reversedEntry.addControl( new ManageDsaITDecorator() );
         }
         
         moveAndRenameContext.setChangeLogEvent( changeLog.log( getPrincipal(), forward, reverses ) );

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=1063574&r1=1063573&r2=1063574&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 Wed Jan 26 02:43:58 2011
@@ -57,6 +57,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.server.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.cursor.SingletonCursor;
 import org.apache.directory.shared.ldap.model.exception.*;
@@ -68,7 +69,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.util.exception.MultiException;
 import org.apache.directory.shared.util.exception.NotImplementedException;
 import org.apache.directory.shared.ldap.codec.controls.CascadeControl;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControl;
@@ -175,7 +175,7 @@ public class DefaultPartitionNexus exten
 
         // Add the supported controls
         rootDSE.put( SchemaConstants.SUPPORTED_CONTROL_AT, PersistentSearchControl.CONTROL_OID,
-            EntryChangeControl.CONTROL_OID, SubentriesControl.CONTROL_OID, ManageDsaITControl.CONTROL_OID,
+            EntryChangeControl.CONTROL_OID, SubentriesControl.CONTROL_OID, ManageDsaIT.OID,
             CascadeControl.CONTROL_OID, PagedResultsControl.CONTROL_OID,
             // Replication controls
             SyncDoneValueControl.CONTROL_OID, SyncInfoValueControl.CONTROL_OID, SyncRequestValueControl.CONTROL_OID,

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=1063574&r1=1063573&r2=1063574&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 Wed Jan 26 02:43:58 2011
@@ -61,7 +61,7 @@ import org.apache.directory.server.proto
 import org.apache.directory.server.protocol.shared.transport.Transport;
 import org.apache.directory.server.protocol.shared.transport.UdpTransport;
 import org.apache.directory.shared.ldap.codec.controls.CascadeControl;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControl;
@@ -238,7 +238,7 @@ public class LdapServer extends Director
         this.supportedControls.add( PersistentSearchControl.CONTROL_OID );
         this.supportedControls.add( EntryChangeControl.CONTROL_OID );
         this.supportedControls.add( SubentriesControl.CONTROL_OID );
-        this.supportedControls.add( ManageDsaITControl.CONTROL_OID );
+        this.supportedControls.add( ManageDsaIT.OID );
         this.supportedControls.add( CascadeControl.CONTROL_OID );
         this.supportedControls.add( PagedResultsControl.CONTROL_OID );
         // Replication controls

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java (original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/SearchHandler.java Wed Jan 26 02:43:58 2011
@@ -38,7 +38,7 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.handlers.controls.PagedSearchContext;
 import org.apache.directory.server.ldap.replication.ReplicationProvider;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControl;
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
 import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
@@ -174,7 +174,7 @@ public class SearchHandler extends LdapR
         }
         // if we have the ManageDSAIt control, go directly
         // to the handling without pre-processing the request
-        else if ( req.getControls().containsKey( ManageDsaITControl.CONTROL_OID ) )
+        else if ( req.getControls().containsKey( ManageDsaIT.OID ) )
         {
             // If the ManageDsaIT control is present, we will
             // consider that the user wants to get entry which
@@ -820,7 +820,7 @@ public class SearchHandler extends LdapR
     private Response generateResponse( LdapSession session, SearchRequest req, Entry entry ) throws Exception
     {
         EntryAttribute ref = ( ( ClonedServerEntry ) entry ).getOriginalEntry().get( SchemaConstants.REF_AT );
-        boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaITControl.CONTROL_OID );
+        boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaIT.OID );
 
         if ( ( ref != null ) && !hasManageDsaItControl )
         {
@@ -909,7 +909,7 @@ public class SearchHandler extends LdapR
      */
     private void modifyFilter( LdapSession session, SearchRequest req ) throws Exception
     {
-        if ( req.hasControl( ManageDsaITControl.CONTROL_OID ) )
+        if ( req.hasControl( ManageDsaIT.OID ) )
         {
             return;
         }

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=1063574&r1=1063573&r2=1063574&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 Wed Jan 26 02:43:58 2011
@@ -39,7 +39,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+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.SyncDoneValueControlDecoder;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl;
@@ -274,7 +274,7 @@ public class SyncReplConsumer implements
 
         if ( !config.isChaseReferrals() )
         {
-            searchRequest.addControl( new ManageDsaITControl() );
+            searchRequest.addControl( new ManageDsaITDecorator() );
         }
     }
 

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=1063574&r1=1063573&r2=1063574&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 Wed Jan 26 02:43:58 2011
@@ -47,7 +47,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.LdapSession;
 import org.apache.directory.server.ldap.handlers.SearchAbandonListener;
 import org.apache.directory.server.ldap.handlers.SearchTimeLimitingMonitor;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaIT;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncDoneValue.SyncDoneValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncInfoValue.SyncInfoValueControl;
 import org.apache.directory.shared.ldap.codec.controls.replication.syncRequestValue.SyncRequestValueControl;
@@ -593,7 +593,7 @@ public class SyncReplProvider implements
     private Response generateResponse( LdapSession session, SearchRequest req, Entry entry ) throws Exception
     {
         EntryAttribute ref = entry.get( SchemaConstants.REF_AT );
-        boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaITControl.CONTROL_OID );
+        boolean hasManageDsaItControl = req.getControls().containsKey( ManageDsaIT.OID );
 
         if ( ( ref != null ) && !hasManageDsaItControl )
         {
@@ -775,7 +775,7 @@ public class SyncReplProvider implements
         }
 
         ExprNode filter = req.getFilter();
-        if ( !req.hasControl( ManageDsaITControl.CONTROL_OID ) && !isOcPresenceFilter )
+        if ( !req.hasControl( ManageDsaIT.OID ) && !isOcPresenceFilter )
         {
             filter = new OrNode( req.getFilter(), newIsReferralEqualityNode( session ) );
         }

Modified: directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java (original)
+++ directory/shared/trunk/integ/src/test/java/org/apache/directory/shared/ldap/schema/syntaxCheckers/ACIItemSyntaxCheckerTest.java Wed Jan 26 02:43:58 2011
@@ -26,7 +26,7 @@ import static org.junit.Assert.assertTru
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
-import org.apache.directory.shared.ldap.model.schema.syntaxCheckers.ACIItemSyntaxChecker;
+import org.apache.directory.shared.ldap.aci.ACIItemSyntaxChecker;
 import org.apache.directory.shared.ldap.schemaloader.JarLdifSchemaLoader;
 import org.apache.directory.shared.ldap.schemamanager.impl.DefaultSchemaManager;
 import org.junit.BeforeClass;
@@ -51,7 +51,7 @@ public class ACIItemSyntaxCheckerTest
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
         SchemaManager schemaManager = new DefaultSchemaManager( loader );
         schemaManager.loadAllEnabled();
-        checker = new ACIItemSyntaxChecker();
+        checker = new org.apache.directory.shared.ldap.aci.ACIItemSyntaxChecker();
         checker.setSchemaManager( schemaManager );
     }
 

Modified: directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=system/ou=syntaxcheckers/m-oid=1.3.6.1.4.1.1466.115.121.1.1.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dsystem/ou%3Dsyntaxcheckers/m-oid%3D1.3.6.1.4.1.1466.115.121.1.1.ldif?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=system/ou=syntaxcheckers/m-oid=1.3.6.1.4.1.1466.115.121.1.1.ldif (original)
+++ directory/shared/trunk/ldap-schema/src/main/resources/schema/ou=schema/cn=system/ou=syntaxcheckers/m-oid=1.3.6.1.4.1.1466.115.121.1.1.ldif Wed Jan 26 02:43:58 2011
@@ -1,7 +1,7 @@
 version: 1
 dn: m-oid=1.3.6.1.4.1.1466.115.121.1.1,ou=syntaxCheckers,cn=system,ou=schema
 m-oid: 1.3.6.1.4.1.1466.115.121.1.1
-m-fqcn: org.apache.directory.shared.ldap.model.schema.syntaxCheckers.ACIItemSyntaxChecker
+m-fqcn: org.apache.directory.shared.ldap.aci.ACIItemSyntaxChecker
 objectclass: metaSyntaxChecker
 objectclass: metaTop
 objectclass: top

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CodecControlDecorator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CodecControlDecorator.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CodecControlDecorator.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/CodecControlDecorator.java Wed Jan 26 02:43:58 2011
@@ -43,7 +43,7 @@ import java.nio.ByteBuffer;
 public class CodecControlDecorator extends AbstractAsn1Object implements Control, CodecControl
 {
     /** The decorated Control */
-    private final Control decoratedComponent;
+    private final Control decorated;
 
     /** The encoded value length */
     protected int valueLength;
@@ -62,7 +62,7 @@ public class CodecControlDecorator exten
      */
     public CodecControlDecorator( Control decoratedControl )
     {
-        this.decoratedComponent = decoratedControl;
+        this.decorated = decoratedControl;
     }
 
 
@@ -74,7 +74,7 @@ public class CodecControlDecorator exten
      */
     public CodecControlDecorator( Control decoratedControl, ControlDecoder decoder )
     {
-        this.decoratedComponent = decoratedControl;
+        this.decorated = decoratedControl;
         this.decoder = decoder;
     }
 
@@ -120,7 +120,7 @@ public class CodecControlDecorator exten
      */
     public String getOid()
     {
-        return decoratedComponent.getOid();
+        return decorated.getOid();
     }
 
 
@@ -129,7 +129,7 @@ public class CodecControlDecorator exten
      */
     public boolean hasValue()
     {
-        return decoratedComponent.hasValue();
+        return decorated.hasValue();
     }
 
 
@@ -140,7 +140,7 @@ public class CodecControlDecorator exten
      */
     public byte[] getValue()
     {
-        return decoratedComponent.getValue();
+        return decorated.getValue();
     }
 
 
@@ -155,11 +155,11 @@ public class CodecControlDecorator exten
         {
             byte[] copy = new byte[ value.length ];
             System.arraycopy( value, 0, copy, 0, value.length );
-            decoratedComponent.setValue( copy );
+            decorated.setValue( copy );
         } 
         else 
         {
-            decoratedComponent.setValue( null );
+            decorated.setValue( null );
         }
     }
 
@@ -171,7 +171,7 @@ public class CodecControlDecorator exten
      */
     public boolean isCritical()
     {
-        return decoratedComponent.isCritical();
+        return decorated.isCritical();
     }
 
 
@@ -182,7 +182,7 @@ public class CodecControlDecorator exten
      */
     public void setCritical( boolean criticality )
     {
-        decoratedComponent.setCritical( criticality );
+        decorated.setCritical( criticality );
     }
 
     
@@ -292,18 +292,6 @@ public class CodecControlDecorator exten
      */
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "    Control\n" );
-        sb.append( "        Control oid : '" ).append( getOid() ).append( "'\n" );
-        sb.append( "        Criticality : '" ).append( isCritical() ).append( "'\n" );
-
-        if ( getValue() != null )
-        {
-            sb.append( "        Control value : '" ).append( Strings.dumpBytes( getValue() ) )
-                .append( "'\n" );
-        }
-
-        return sb.toString();
+        return decorated.toString();
     }
 }

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlEnum.java Wed Jan 26 02:43:58 2011
@@ -40,7 +40,7 @@ public enum ControlEnum
 {
     CASCADE_CONTROL( CascadeControl.CONTROL_OID ),
     ENTRY_CHANGE_CONTROL( EntryChangeControl.CONTROL_OID ),
-    MANAGE_DSA_IT_CONTROL( ManageDsaITControl.CONTROL_OID ),
+    MANAGE_DSA_IT_CONTROL( ManageDsaIT.OID ),
     PAGED_RESULTS_CONTROL( PagedResultsControl.CONTROL_OID ),
     PASSWORD_POLICY_REQUEST_CONTROL( PasswordPolicyRequestControl.CONTROL_OID ),
     PERSISTENT_SEARCH_CONTROL(PersistentSearchControl.CONTROL_OID),

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ControlFactory.java Wed Jan 26 02:43:58 2011
@@ -43,7 +43,7 @@ public class ControlFactory
      * a concrete Control instance is returned, otherwise an instance of 
      * ControlImpl is returned. The following Controls are known:
      * <ul>
-     * <li>ManageDsaITControl</li>
+     * <li>ManageDsaITControlDecorator</li>
      * <li>PagedResultsControl</li>
      * <li>PersistentSearchControl</li>
      * <li>SubentriesControl</li>
@@ -61,9 +61,9 @@ public class ControlFactory
      */
     public static Control createControl( String oid )
     {
-        if ( ManageDsaITControl.CONTROL_OID.equals( oid ) )
+        if ( ManageDsaIT.OID.equals( oid ) )
         {
-            return new ManageDsaITControl();
+            return new ManageDsaITDecorator();
         }
 
         if ( PagedResultsControl.CONTROL_OID.equals( oid ) )

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/DefaultControl.java (from r1063566, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/AbstractControl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/DefaultControl.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/DefaultControl.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/AbstractControl.java&r1=1063566&r2=1063574&rev=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/AbstractControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/DefaultControl.java Wed Jan 26 02:43:58 2011
@@ -20,28 +20,17 @@
 package org.apache.directory.shared.ldap.codec.controls;
 
 
-import java.nio.BufferOverflowException;
-import java.nio.ByteBuffer;
-
-import org.apache.directory.shared.asn1.AbstractAsn1Object;
-import org.apache.directory.shared.asn1.EncoderException;
-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.model.message.Control;
 import org.apache.directory.shared.util.Strings;
 
 
 /**
- * A Asn1Object to store a Control.
+ * A Control base class.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class AbstractControl extends AbstractAsn1Object implements Control, CodecControl
+public class DefaultControl implements Control
 {
-    // ~ Instance fields
-    // ----------------------------------------------------------------------------
     /** The control type */
     private String oid;
 
@@ -50,24 +39,19 @@ public abstract class AbstractControl ex
 
     /** Optional control value */
     protected byte[] value;
-    
-    /** The encoded value length */
-    protected int valueLength;
 
-    /** The control length */
-    private int controlLength;
-    
-    /** The control decoder */
-    protected ControlDecoder decoder;
 
     /**
-     * Default constructor.
+     * Creates a Control with a specific OID.
+     *
+     * @param oid The OID of this Control.
      */
-    public AbstractControl( String oid )
+    public DefaultControl( String oid )
     {
         this.oid = oid;
     }
 
+
     /**
      * Get the OID
      * 
@@ -134,93 +118,10 @@ public abstract class AbstractControl ex
     /**
      * {@inheritDoc}
      */
-    public int computeLength()
-    {
-        return 0;
-    }
-
-
-    /**
-     * Computes the length of the Control given the length of its value.
-     *
-     * @param valueLength The length of the Control's value.
-     * @return The length of the Control including its value.
-     */
-    public int computeLength( int valueLength )
-    {
-        // The OID
-        int oidLengh = Strings.getBytesUtf8(oid).length;
-        controlLength = 1 + TLV.getNbBytes( oidLengh ) + oidLengh;
-
-        // The criticality, only if true
-        if ( criticality )
-        {
-            controlLength += 1 + 1 + 1; // Always 3 for a boolean
-        }
-
-        this.valueLength = valueLength;
-        
-        if ( valueLength != 0 )
-        {
-            controlLength += 1 + TLV.getNbBytes( valueLength ) + valueLength;
-        }
-        
-        return 1 + TLV.getNbBytes( controlLength ) + controlLength;
-    }
-
-
-    /**
-     * {@inheritDoc}
-     */
-    public ByteBuffer encode( ByteBuffer buffer ) throws EncoderException
-    {
-        if ( buffer == null )
-        {
-            throw new EncoderException( I18n.err( I18n.ERR_04023 ) );
-        }
-
-        try
-        {
-            // The LdapMessage Sequence
-            buffer.put( UniversalTag.SEQUENCE.getValue() );
-
-            // The length has been calculated by the computeLength method
-            buffer.put( TLV.getBytes( controlLength ) );
-        }
-        catch ( BufferOverflowException boe )
-        {
-            throw new EncoderException( I18n.err( I18n.ERR_04005 ) );
-        }
-
-        // The control type
-        Value.encode( buffer, getOid().getBytes() );
-
-        // The control criticality, if true
-        if ( criticality )
-        {
-            Value.encode( buffer, criticality );
-        }
-
-        return buffer;
-    }
-    
-    
-    /**
-     * {@inheritDoc}
-     */
     public boolean hasValue()
     {
         return value != null;
     }
-    
-    
-    /**
-     * {@inheritDoc}
-     */
-    public ControlDecoder getDecoder()
-    {
-        return decoder;
-    }
 
 
     /**
@@ -250,6 +151,7 @@ public abstract class AbstractControl ex
             return false;
         }
 
+        //noinspection SimplifiableIfStatement
         if ( criticality != otherControl.isCritical() )
         {
             return false;
@@ -266,13 +168,14 @@ public abstract class AbstractControl ex
     {
         StringBuffer sb = new StringBuffer();
 
-        sb.append( "    Control\n" );
-        sb.append( "        Control oid : '" ).append( oid ).append( "'\n" );
+        sb.append( "    " ).append( getClass().getSimpleName() ).append( " " );
+        sb.append( "Control\n" );
+        sb.append( "        Type OID    : '" ).append( oid ).append( "'\n" );
         sb.append( "        Criticality : '" ).append( criticality ).append( "'\n" );
 
         if ( value != null )
         {
-            sb.append( "        Control value : '" ).append( Strings.dumpBytes(value) )
+            sb.append( "        Value (HEX) : '" ).append( Strings.dumpBytes(value) )
                 .append( "'\n" );
         }
 

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/DefaultControl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaIT.java (from r1063568, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaIT.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaIT.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java&r1=1063568&r2=1063574&rev=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaIT.java Wed Jan 26 02:43:58 2011
@@ -57,43 +57,31 @@ package org.apache.directory.shared.ldap
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ManageDsaITControl extends AbstractControl
+public class ManageDsaIT extends DefaultControl
 {
     /** This control OID */
-    public static final String CONTROL_OID = "2.16.840.1.113730.3.4.2";
+    public static final String OID = "2.16.840.1.113730.3.4.2";
+
+    /** An instance of this constant control which never changes */
+    public static final ManageDsaIT INSTANCE = new ManageDsaIT();
+
 
     /**
      * Default constructor
-     *
      */
-    public ManageDsaITControl()
+    private ManageDsaIT()
     {
-        super( CONTROL_OID );
-        
-        decoder = new ManageDsaITControlDecoder();
+        super( OID );
     }
 
-    /**
-     * Returns 0 every time.
-     */
-    public int computeLength()
+
+    public void setValue( byte [] value )
     {
-        // Call the super class to compute the global control length
-        return super.computeLength( 0 );
     }
 
 
-    /**
-     * Return a String representing this ManageDsaIt Control.
-     */
-    public String toString()
+    public boolean hasValue()
     {
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "    ManageDsaIt Control\n" );
-        sb.append( "        oid : " ).append( getOid() ).append( '\n' );
-        sb.append( "        critical : " ).append( isCritical() ).append( '\n' );
-        
-        return sb.toString();
+        return false;
     }
 }

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecoder.java (from r1063551, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControlDecoder.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecoder.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecoder.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControlDecoder.java&r1=1063551&r2=1063574&rev=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControlDecoder.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecoder.java Wed Jan 26 02:43:58 2011
@@ -26,14 +26,14 @@ import org.apache.directory.shared.ldap.
 
 
 /**
- * A decoder for EntryChangeControls.
+ * A ControlDecoder for the {@link ManageDsaIT} Control.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ManageDsaITControlDecoder implements ControlDecoder
+public class ManageDsaITDecoder implements ControlDecoder
 {
     public Asn1Object decode( byte[] controlBytes, Control control ) throws DecoderException
     {
-        return new ManageDsaITControl();
+        return new ManageDsaITDecorator();
     }
 }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecoder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java (from r1063568, directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java)
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java?p2=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java&p1=directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java&r1=1063568&r2=1063574&rev=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITControl.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java Wed Jan 26 02:43:58 2011
@@ -57,22 +57,22 @@ package org.apache.directory.shared.ldap
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ManageDsaITControl extends AbstractControl
+public class ManageDsaITDecorator extends CodecControlDecorator
 {
-    /** This control OID */
-    public static final String CONTROL_OID = "2.16.840.1.113730.3.4.2";
+    // @TODO We should not bother encoding and decoding marker controls that always
+    // encode and decode into the same TLV/byte sequence. Can't the control just
+    // supply the canned PDU element?
 
     /**
      * Default constructor
-     *
      */
-    public ManageDsaITControl()
+    public ManageDsaITDecorator()
     {
-        super( CONTROL_OID );
-        
-        decoder = new ManageDsaITControlDecoder();
+        super( ManageDsaIT.INSTANCE );
+        decoder = new ManageDsaITDecoder();
     }
 
+
     /**
      * Returns 0 every time.
      */
@@ -81,19 +81,4 @@ public class ManageDsaITControl extends 
         // Call the super class to compute the global control length
         return super.computeLength( 0 );
     }
-
-
-    /**
-     * Return a String representing this ManageDsaIt Control.
-     */
-    public String toString()
-    {
-        StringBuffer sb = new StringBuffer();
-
-        sb.append( "    ManageDsaIt Control\n" );
-        sb.append( "        oid : " ).append( getOid() ).append( '\n' );
-        sb.append( "        critical : " ).append( isCritical() ).append( '\n' );
-        
-        return sb.toString();
-    }
 }

Propchange: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/controls/ManageDsaITDecorator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java?rev=1063574&r1=1063573&r2=1063574&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java (original)
+++ directory/shared/trunk/ldap/src/test/java/org/apache/directory/shared/ldap/model/ldif/LdifUtilsTest.java Wed Jan 26 02:43:58 2011
@@ -19,24 +19,10 @@
  */
 package org.apache.directory.shared.ldap.model.ldif;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-
-import javax.naming.NamingException;
-import javax.naming.directory.Attribute;
-import javax.naming.directory.Attributes;
-import javax.naming.directory.BasicAttribute;
-import javax.naming.directory.BasicAttributes;
 
 import org.apache.directory.junit.tools.Concurrent;
 import org.apache.directory.junit.tools.ConcurrentJunitRunner;
-import org.apache.directory.shared.ldap.codec.controls.ManageDsaITControl;
+import org.apache.directory.shared.ldap.codec.controls.ManageDsaITDecorator;
 import org.apache.directory.shared.ldap.model.entry.DefaultEntry;
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
@@ -47,6 +33,20 @@ import org.apache.directory.shared.util.
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 
 /**
  * Tests the LdifUtils methods
@@ -540,7 +540,7 @@ public class LdifUtilsTest
         entry.addAttribute( "m-oid", "1.2.3.4" );
         entry.addAttribute( "m-description", "description" );
         
-        ManageDsaITControl control = new ManageDsaITControl();
+        ManageDsaITDecorator control = new ManageDsaITDecorator();
         
         entry.addControl( control );
         



Mime
View raw message