directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r780471 - in /directory: apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ apacheds/trunk/core/src/main/java/org/apache/directory/server/core/ apacheds/trunk/core/src/main/java/org/apache/direc...
Date Sun, 31 May 2009 16:56:45 GMT
Author: elecharny
Date: Sun May 31 16:56:44 2009
New Revision: 780471

URL: http://svn.apache.org/viewvc?rev=780471&view=rev
Log:
o Registries now extend Iterable
o Renamed the oidIterator() method to iterator accordingly to the Iterable interfaceo 
o Fixed the UUID conversion to byte[]
o Injected the csnMatch, csnOrderingMatch, uuidMatch, uuidOrderingmatch and csnSidMatch matching rules
o Added the associated normalizers
o Added the ApacheSyntaxCheckerProducer class
o Added a CsnSidSyntaxChecker class (to be completed)
o Added a CsnSidComparator class (to be completed)

Added:
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxCheckerProducer.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/CsnSidComparator.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxes/CsnSidSyntaxChecker.java
Modified:
    directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MockComparatorRegistry.java
    directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheComparatorProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheMatchingRuleProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheNormalizerProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java
    directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java
    directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java
    directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java
    directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
    directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java

Modified: directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java (original)
+++ directory/apacheds/trunk/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java Sun May 31 16:56:44 2009
@@ -79,10 +79,10 @@
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.ObjectClass;
 import org.apache.directory.shared.ldap.schema.SchemaObject;
+import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.Syntax;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.util.DateUtils;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
@@ -462,20 +462,17 @@
 
         AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry();
 
-        Iterator<AttributeType> ii = attributeTypeRegistry.iterator();
-
-        while ( ii.hasNext() )
+        for ( AttributeType attributeType:attributeTypeRegistry )
         {
-            AttributeType at = ii.next();
-            String schemaName = attributeTypeRegistry.getSchemaName( at.getOid() );
+            String schemaName = attributeTypeRegistry.getSchemaName( attributeType.getOid() );
             Schema schema = registries.getLoadedSchemas().get( schemaName );
-            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( at ) );
+            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( attributeType ) );
             LdapDN dn = checkCreateSchema( schemaName );
             dn.add( SchemaConstants.OU_AT + "=attributeTypes" );
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             checkCreateContainer( dn );
-            ServerEntry entry = attributesFactory.getAttributes( at, schema, registries );
-            dn.add( MetaSchemaConstants.M_OID_AT + "=" + at.getOid() );
+            ServerEntry entry = attributesFactory.getAttributes( attributeType, schema, registries );
+            dn.add( MetaSchemaConstants.M_OID_AT + "=" + attributeType.getOid() );
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             entry.setDn( dn );
             injectEntryInStore( store, entry );
@@ -493,20 +490,18 @@
         getLog().info( "" );
 
         ObjectClassRegistry objectClassRegistry = registries.getObjectClassRegistry();
-        Iterator<ObjectClass> ii = objectClassRegistry.iterator();
 
-        while ( ii.hasNext() )
+        for ( ObjectClass objectClass:objectClassRegistry )
         {
-            ObjectClass oc = ii.next();
-            String schemaName = objectClassRegistry.getSchemaName( oc.getOid() );
+            String schemaName = objectClassRegistry.getSchemaName( objectClass.getOid() );
             Schema schema = registries.getLoadedSchemas().get( schemaName );
-            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( oc ) );
+            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( objectClass ) );
             LdapDN dn = checkCreateSchema( schemaName );
             dn.add( SchemaConstants.OU_AT + "=objectClasses" );
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             checkCreateContainer( dn );
-            ServerEntry entry = attributesFactory.getAttributes( oc, schema, registries );
-            dn.add( MetaSchemaConstants.M_OID_AT + "=" + oc.getOid() );
+            ServerEntry entry = attributesFactory.getAttributes( objectClass, schema, registries );
+            dn.add( MetaSchemaConstants.M_OID_AT + "=" + objectClass.getOid() );
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             entry.setDn( dn );
             injectEntryInStore( store, entry );
@@ -524,20 +519,18 @@
         getLog().info( "" );
 
         MatchingRuleRegistry matchingRuleRegistry = registries.getMatchingRuleRegistry();
-        Iterator<MatchingRule> ii = matchingRuleRegistry.iterator();
 
-        while ( ii.hasNext() )
+        for ( MatchingRule matchingRule : matchingRuleRegistry )
         {
-            MatchingRule mr = ii.next();
-            String schemaName = matchingRuleRegistry.getSchemaName( mr.getOid() );
+            String schemaName = matchingRuleRegistry.getSchemaName( matchingRule.getOid() );
             Schema schema = registries.getLoadedSchemas().get( schemaName );
-            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( mr ) );
+            getLog().info( "\t\t o [" + schemaName + "] - " + getNameOrNumericoid( matchingRule ) );
             LdapDN dn = checkCreateSchema( schemaName );
             dn.add( SchemaConstants.OU_AT + "=matchingRules" );
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             checkCreateContainer( dn );
-            ServerEntry entry = attributesFactory.getAttributes( mr, schema, registries );
-            dn.add( MetaSchemaConstants.M_OID_AT + "=" + mr.getOid() );
+            ServerEntry entry = attributesFactory.getAttributes( matchingRule, schema, registries );
+            dn.add( MetaSchemaConstants.M_OID_AT + "=" + matchingRule.getOid() );
             dn.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
             entry.setDn( dn );
             injectEntryInStore( store, entry );
@@ -555,11 +548,9 @@
         getLog().info( "" );
 
         ComparatorRegistry comparatorRegistry = registries.getComparatorRegistry();
-        Iterator<String> ii = comparatorRegistry.oidIterator();
 
-        while ( ii.hasNext() )
+        for ( String oid : comparatorRegistry )
         {
-            String oid = ii.next();
             String schemaName = comparatorRegistry.getSchemaName( oid );
             Schema schema = registries.getLoadedSchemas().get( schemaName );
             getLog().info( "\t\t o [" + schemaName + "] - " + oid );
@@ -586,11 +577,9 @@
         getLog().info( "" );
 
         NormalizerRegistry normalizerRegistry = registries.getNormalizerRegistry();
-        Iterator<String> ii = normalizerRegistry.oidIterator();
 
-        while ( ii.hasNext() )
+        for ( String oid : normalizerRegistry )
         {
-            String oid = ii.next();
             String schemaName = normalizerRegistry.getSchemaName( oid );
             Schema schema = registries.getLoadedSchemas().get( schemaName );
             getLog().info( "\t\t o [" + schemaName + "] - " + oid );
@@ -618,11 +607,9 @@
         getLog().info( "" );
 
         SyntaxRegistry syntaxRegistry = registries.getSyntaxRegistry();
-        Iterator<Syntax> ii = syntaxRegistry.iterator();
 
-        while ( ii.hasNext() )
+        for ( Syntax syntax : syntaxRegistry )
         {
-            Syntax syntax = ii.next();
             getLog().info( "\t\t o [" + syntax.getSchema() + "] - " + getNameOrNumericoid( syntax ) );
             LdapDN dn = checkCreateSchema( syntax.getSchema() );
             Schema schema = registries.getLoadedSchemas().get( syntax.getSchema() );
@@ -647,11 +634,9 @@
         getLog().info( "" );
 
         SyntaxCheckerRegistry syntaxCheckerRegistry = registries.getSyntaxCheckerRegistry();
-        Iterator<SyntaxChecker> ii = syntaxCheckerRegistry.iterator();
 
-        while ( ii.hasNext() )
+        for ( SyntaxChecker syntaxChecker : syntaxCheckerRegistry )
         {
-            SyntaxChecker syntaxChecker = ii.next();
             String schemaName = syntaxCheckerRegistry.getSchemaName( syntaxChecker.getSyntaxOid() );
             Schema schema = registries.getLoadedSchemas().get( schemaName );
             getLog().info( "\t\t o [" + schemaName + "] - " + syntaxChecker.getSyntaxOid() );
@@ -960,8 +945,8 @@
     private void injectEntryInStore( Store<ServerEntry> store, ServerEntry entry ) throws Exception
     {
         entry.add( ApacheSchemaConstants.ENTRY_CSN_AT, CSN_FACTORY.newInstance( 1 ).toString() );
-        entry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
-        
+        entry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
+
         store.add( entry );
     }
 }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sun May 31 16:56:44 2009
@@ -99,6 +99,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.normalizers.OidNormalizer;
 import org.apache.directory.shared.ldap.util.AttributeUtils;
 import org.apache.directory.shared.ldap.util.DateUtils;
@@ -1079,7 +1080,7 @@
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.put( SchemaConstants.DISPLAY_NAME_AT, "Directory Superuser" );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             TlsKeyGenerator.addKeyPair( serverEntry );
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
@@ -1107,7 +1108,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
         }
@@ -1133,7 +1134,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
         }
@@ -1160,7 +1161,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
 
@@ -1206,7 +1207,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
         }
@@ -1228,7 +1229,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
         }
@@ -1251,7 +1252,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
         }
@@ -1274,7 +1275,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
         }
@@ -1300,7 +1301,7 @@
             serverEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
             serverEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
             serverEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, getCSN().toString() );
-            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+            serverEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
 
             partitionNexus.add( new AddOperationContext( adminSession, serverEntry ) );
         }

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java (original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeInterceptor.java Sun May 31 16:56:44 2009
@@ -63,9 +63,9 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.util.DateUtils;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
  
@@ -196,7 +196,7 @@
         
         // Add the UUID and the entryCSN. The UUID is stored as a byte[] representation of 
         // its String value
-        entry.put( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+        entry.put( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
         entry.put( ApacheSchemaConstants.ENTRY_CSN_AT, service.getCSN().toString() );
         
         nextInterceptor.add( opContext );

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=780471&r1=780470&r2=780471&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 Sun May 31 16:56:44 2009
@@ -83,6 +83,7 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.schema.SchemaUtils;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.util.DateUtils;
 import org.apache.directory.shared.ldap.util.NamespaceTools;
@@ -424,7 +425,7 @@
         systemEntry.put( SchemaConstants.CREATORS_NAME_AT, ServerDNConstants.ADMIN_SYSTEM_DN );
         systemEntry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() );
         systemEntry.add( ApacheSchemaConstants.ENTRY_CSN_AT, directoryService.getCSN().toString() );
-        systemEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+        systemEntry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
         systemEntry.put( NamespaceTools.getRdnAttribute( ServerDNConstants.SYSTEM_DN ),
             NamespaceTools.getRdnValue( ServerDNConstants.SYSTEM_DN ) );
         LdapDN adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/DupsContainerCursorTest.java Sun May 31 16:56:44 2009
@@ -252,7 +252,7 @@
         }
 
 
-        public Iterator<String> oidIterator()
+        public Iterator<String> iterator()
         {
             return null;
         }

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableNoDuplicatesTest.java Sun May 31 16:56:44 2009
@@ -370,7 +370,7 @@
         }
 
 
-        public Iterator<String> oidIterator()
+        public Iterator<String> iterator()
         {
             return null;
         }

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTableWithDuplicatesTest.java Sun May 31 16:56:44 2009
@@ -602,7 +602,7 @@
         }
 
 
-        public Iterator<String> oidIterator()
+        public Iterator<String> iterator()
         {
             return null;
         }

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/KeyTupleBTreeCursorTest.java Sun May 31 16:56:44 2009
@@ -217,7 +217,7 @@
         }
 
 
-        public Iterator<String> oidIterator()
+        public Iterator<String> iterator()
         {
             return null;
         }

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MockComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MockComparatorRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MockComparatorRegistry.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/MockComparatorRegistry.java Sun May 31 16:56:44 2009
@@ -67,7 +67,7 @@
     }
 
 
-    public Iterator<String> oidIterator()
+    public Iterator<String> iterator()
     {
         return null;
     }

Modified: directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java (original)
+++ directory/apacheds/trunk/jdbm-store/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/NoDupsCursorTest.java Sun May 31 16:56:44 2009
@@ -287,7 +287,7 @@
         }
 
 
-        public Iterator<String> oidIterator()
+        public Iterator<String> iterator()
         {
             return null;
         }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheComparatorProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheComparatorProducer.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheComparatorProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheComparatorProducer.java Sun May 31 16:56:44 2009
@@ -28,8 +28,10 @@
 
 import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.comparators.CSNComparator;
 import org.apache.directory.shared.ldap.schema.comparators.ComparableComparator;
-//import org.apache.directory.shared.ldap.util.BigIntegerComparator;
+import org.apache.directory.shared.ldap.schema.comparators.CsnSidComparator;
+import org.apache.directory.shared.ldap.schema.comparators.UUIDComparator;
 import org.apache.directory.shared.ldap.util.LongComparator;
 
 
@@ -71,5 +73,24 @@
         comparator = new StringComparator();
         cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.1.1.3", comparator );
 
+        // For uuidMatch
+        comparator = new UUIDComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.1.16.2", comparator );
+
+        // For uuidOrderingMatch
+        comparator = new UUIDComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.1.16.3", comparator );
+        
+        // For CSNMatch
+        comparator = new CSNComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.666.11.2.2", comparator );
+        
+        // For CSNOrderingMatch
+        comparator = new CSNComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.666.11.2.3", comparator );
+        
+        // For CSNSIDMatch
+        comparator = new CsnSidComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.666.11.2.5", comparator );
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheMatchingRuleProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheMatchingRuleProducer.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheMatchingRuleProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheMatchingRuleProducer.java Sun May 31 16:56:44 2009
@@ -69,5 +69,40 @@
             { "jdbmStringMatch" } );
         mrule.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.15" );
         cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        // For uuidMatch 
+        mrule = new BootstrapMatchingRule( "1.3.6.1.1.16.2", registries );
+        mrule.setNames( new String[]
+            { "uuidMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.1.16.1" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        // For uuidOrderingMatch 
+        mrule = new BootstrapMatchingRule( "1.3.6.1.1.16.3", registries );
+        mrule.setNames( new String[]
+            { "uuidOrderingMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.1.16.1" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+        
+        // For CSNMatch 
+        mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.4203.666.11.2.2", registries );
+        mrule.setNames( new String[]
+            { "csnMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.4.1.4203.666.11.2.1" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        // For CSNOrderingMatch 
+        mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.4203.666.11.2.3", registries );
+        mrule.setNames( new String[]
+            { "csnOrderingMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.4.1.4203.666.11.2.1" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
+
+        // For CSNSidMatch 
+        mrule = new BootstrapMatchingRule( "1.3.6.1.4.1.4203.666.11.2.5", registries );
+        mrule.setNames( new String[]
+            { "csnSidMatch" } );
+        mrule.setSyntaxOid( "1.3.6.1.4.1.4203.666.11.2.4" );
+        cb.schemaObjectProduced( this, mrule.getOid(), mrule );
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheNormalizerProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheNormalizerProducer.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheNormalizerProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheNormalizerProducer.java Sun May 31 16:56:44 2009
@@ -66,5 +66,24 @@
         normalizer = new NoOpNormalizer();
         cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.1.1.3", normalizer );
 
+        // For uuidMatch -> 1.3.6.1.1.16.2
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.1.16.2", normalizer );
+
+        // For uuidOrderingMatch -> 1.3.6.1.1.16.3
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.1.16.3", normalizer );
+
+        // For CSNMatch -> 1.3.6.1.4.1.4203.666.11.2.2
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.666.11.2.2", normalizer );
+
+        // For CSNOrderingMatch -> 1.3.6.1.4.1.4203.666.11.2.3
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.666.11.2.3", normalizer );
+
+        // For CSNSidMatch -> 1.3.6.1.4.1.4203.666.11.2.5
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.4203.666.11.2.5", normalizer );
     }
 }

Added: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxCheckerProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxCheckerProducer.java?rev=780471&view=auto
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxCheckerProducer.java (added)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxCheckerProducer.java Sun May 31 16:56:44 2009
@@ -0,0 +1,72 @@
+/*
+ *  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.server.schema.bootstrap;
+
+
+import javax.naming.NamingException;
+
+import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
+import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.schema.syntaxes.CsnSidSyntaxChecker;
+import org.apache.directory.shared.ldap.schema.syntaxes.CsnSyntaxChecker;
+import org.apache.directory.shared.ldap.schema.syntaxes.UuidSyntaxChecker;
+
+
+/**
+ * A producer of SyntaxCheckers for the apache schema.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 736223 $
+ */
+public class ApacheSyntaxCheckerProducer extends AbstractBootstrapProducer
+{
+    /**
+     * Creates a producer which produces all 58 of the apache schema syntax's
+     * SyntaxCheckers.
+     */
+    public ApacheSyntaxCheckerProducer()
+    {
+        super( ProducerTypeEnum.SYNTAX_CHECKER_PRODUCER );
+    }
+
+
+    public void produce( Registries registries, ProducerCallback cb ) throws NamingException
+    {
+        /*
+         * We are going to need a syntax checker for each and every one of
+         * these syntaxes.  However right now we're probably not going to be
+         * turning on syntax checking or are not as interested in it.  So we
+         * can put in place simple do nothing syntax checkers - which is really
+         * the binary syntax checker.
+         */
+
+        /*
+         * Value being represented        H-R OBJECT IDENTIFIER
+         * ===========================================================
+         * 0 UUID                          N  1.3.6.1.4.1..1.16.1
+         * 1 CSN                           Y  1.3.6.1.4.1.4203.666.2.1
+         * 2 CSNSID                        Y  1.3.6.1.4.1.4203.666.2.4
+         */
+        cb.schemaObjectProduced( this, SchemaConstants.UUID_AT_OID, new UuidSyntaxChecker() );
+        cb.schemaObjectProduced( this, SchemaConstants.CSN_AT_OID, new CsnSyntaxChecker() );
+        cb.schemaObjectProduced( this, SchemaConstants.CSN_SID_AT_OID, new CsnSidSyntaxChecker() );
+    }
+}

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxProducer.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApacheSyntaxProducer.java Sun May 31 16:56:44 2009
@@ -26,6 +26,7 @@
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.AbstractSyntax;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
+import org.apache.directory.shared.ldap.schema.syntaxes.CsnSidSyntaxChecker;
 import org.apache.directory.shared.ldap.schema.syntaxes.CsnSyntaxChecker;
 import org.apache.directory.shared.ldap.schema.syntaxes.JavaByteSyntaxChecker;
 import org.apache.directory.shared.ldap.schema.syntaxes.JavaIntegerSyntaxChecker;
@@ -242,5 +243,30 @@
         
         syntax.setSchema( "apache" );
         cb.schemaObjectProduced( this, syntax.getOid(), syntax );
+
+        // A Syntax for CSNSid, OID = 1.3.6.1.4.1.4203.666.11.2.5
+        syntax = new AbstractSyntax( SchemaConstants.CSN_SID_SYNTAX, "a syntax for CSN SID values", false )
+        {
+            private static final long serialVersionUID = 1L;
+            private final CsnSidSyntaxChecker CSN_SID_SYNTAX_CHECKER = new CsnSidSyntaxChecker();
+
+            public String getName()
+            {
+                return "CSNSid";
+            }
+            
+            public String[] getNames()
+            {
+                return new String[] { "CSNSid" };
+            }
+            
+            public SyntaxChecker getSyntaxChecker() throws NamingException
+            {
+                return CSN_SID_SYNTAX_CHECKER;
+            }
+        };
+        
+        syntax.setSchema( "apache" );
+        cb.schemaObjectProduced( this, syntax.getOid(), syntax );
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java Sun May 31 16:56:44 2009
@@ -23,6 +23,7 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.normalizers.NoOpNormalizer;
@@ -71,5 +72,13 @@
         
         normalizer = new DeepTrimToLowerNormalizer();
         cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.4", normalizer );
+        
+        // For entryUuid
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, SchemaConstants.ENTRY_UUID_AT_OID, normalizer );
+        
+        // For entryCSN
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, SchemaConstants.ENTRY_CSN_AT_OID, normalizer );
     }
 }

Modified: directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java (original)
+++ directory/apacheds/trunk/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/BootstrapSchemaLoader.java Sun May 31 16:56:44 2009
@@ -41,7 +41,6 @@
 import org.apache.directory.server.schema.bootstrap.AbstractBootstrapProducer.BootstrapObjectClass;
 import org.apache.directory.server.schema.bootstrap.AbstractBootstrapProducer.BootstrapSyntax;
 import org.apache.directory.server.schema.registries.AbstractSchemaLoader;
-import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.ComparatorRegistry;
 import org.apache.directory.server.schema.registries.DefaultRegistries;
 import org.apache.directory.server.schema.registries.MatchingRuleRegistry;

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/AttributeTypeRegistry.java Sun May 31 16:56:44 2009
@@ -34,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface AttributeTypeRegistry extends SchemaObjectRegistry
+public interface AttributeTypeRegistry extends SchemaObjectRegistry, Iterable<AttributeType>
 {
     /**
      * Registers a new AttributeType with this registry.

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ComparatorRegistry.java Sun May 31 16:56:44 2009
@@ -34,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface ComparatorRegistry
+public interface ComparatorRegistry extends Iterable<String>
 {
     /**
      * Gets the name of the schema this schema object is associated with.
@@ -84,7 +84,7 @@
      * 
      * @return Iterator of numeric OID strings 
      */
-    Iterator<String> oidIterator();
+    Iterator<String> iterator();
 
     
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultComparatorRegistry.java Sun May 31 16:56:44 2009
@@ -173,7 +173,7 @@
     /**
      * {@inheritDoc}
      */
-    public Iterator<String> oidIterator()
+    public Iterator<String> iterator()
     {
         return byOidComparator.keySet().iterator();
     }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultNormalizerRegistry.java Sun May 31 16:56:44 2009
@@ -172,7 +172,7 @@
     /**
      * {@inheritDoc}
      */
-    public Iterator<String> oidIterator()
+    public Iterator<String> iterator()
     {
         return byOidNormalizer.keySet().iterator();
     }

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/MatchingRuleRegistry.java Sun May 31 16:56:44 2009
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface MatchingRuleRegistry extends SchemaObjectRegistry
+public interface MatchingRuleRegistry extends SchemaObjectRegistry, Iterable<MatchingRule>
 {
     /**
      * Registers a MatchingRule with this registry.

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/NormalizerRegistry.java Sun May 31 16:56:44 2009
@@ -34,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface NormalizerRegistry
+public interface NormalizerRegistry extends Iterable<String>
 {
     /**
      * Registers a Normalizer with this registry.
@@ -85,7 +85,7 @@
      *  
      * @return an Iterator over the set of OID Strings in this registry
      */
-    Iterator<String> oidIterator();
+    Iterator<String> iterator();
 
     
     /**

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/ObjectClassRegistry.java Sun May 31 16:56:44 2009
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface ObjectClassRegistry extends SchemaObjectRegistry
+public interface ObjectClassRegistry extends SchemaObjectRegistry, Iterable<ObjectClass>
 {
     /**
      * Registers an ObjectClass with this registry.

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxCheckerRegistry.java Sun May 31 16:56:44 2009
@@ -34,7 +34,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface SyntaxCheckerRegistry
+public interface SyntaxCheckerRegistry extends Iterable<SyntaxChecker>
 {
     /**
      * Registers a SyntaxChecker with this registry.

Modified: directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java (original)
+++ directory/apacheds/trunk/schema-registries/src/main/java/org/apache/directory/server/schema/registries/SyntaxRegistry.java Sun May 31 16:56:44 2009
@@ -33,7 +33,7 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public interface SyntaxRegistry extends SchemaObjectRegistry
+public interface SyntaxRegistry extends SchemaObjectRegistry, Iterable<Syntax>
 {
     /**
      * Looks up a Syntax by its unique Object Identifier or by name.

Modified: directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java (original)
+++ directory/apacheds/trunk/xdbm-tools/src/main/java/org/apache/directory/server/xdbm/tools/StoreUtils.java Sun May 31 16:56:44 2009
@@ -39,7 +39,7 @@
 import org.apache.directory.shared.ldap.entry.client.DefaultClientAttribute;
 import org.apache.directory.shared.ldap.entry.client.DefaultClientEntry;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.util.StringTools;
+import org.apache.directory.shared.ldap.schema.SchemaUtils;
 
 
 /**
@@ -299,7 +299,7 @@
     public static void injectEntryInStore( Store<ServerEntry> store, ServerEntry entry ) throws Exception
     {
         entry.add( ApacheSchemaConstants.ENTRY_CSN_AT, CSN_FACTORY.newInstance( 1 ).toString() );
-        entry.add( ApacheSchemaConstants.ENTRY_UUID_AT, StringTools.getBytesUtf8( UUID.randomUUID().toString() ) );
+        entry.add( ApacheSchemaConstants.ENTRY_UUID_AT, SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
         
         store.add( entry );
     }

Modified: directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java (original)
+++ directory/shared/trunk/ldap-constants/src/main/java/org/apache/directory/shared/ldap/constants/SchemaConstants.java Sun May 31 16:56:44 2009
@@ -401,13 +401,29 @@
     String GOVERNING_STRUCTURE_RULE_AT = "governingStructureRule";
     String GOVERNING_STRUCTURE_RULE_AT_OID = "2.5.21.10";
 
+    // UUID
+    String UUID_AT = "UUID";
+    String UUID_AT_OID = "1.3.6.1.1.16.1";
+
     // entryUUID
     String ENTRY_UUID_AT = "entryUUID";
     String ENTRY_UUID_AT_OID = "1.3.6.1.1.16.4";
 
+    // CSN
+    String CSN_AT = "CSN";
+    String CSN_AT_OID = "1.3.6.1.4.1.4203.666.2.1";
+
+    // CSNSID
+    String CSN_SID_AT = "CSN";
+    String CSN_SID_AT_OID = "1.3.6.1.4.1.4203.666.2.4";
+
     // entryCSN
     String ENTRY_CSN_AT = "entryCSN";
-    String ENTRY_CSN_AT_OID = "1.3.6.1.4.1.18060.0.4.1.2.30";
+    String ENTRY_CSN_AT_OID = "1.3.6.1.4.1.4203.666.1.7";
+
+    // contextCSN
+    String CONTEXT_CSN_AT = "contextCSN";
+    String CONTEXT_CSN_AT_OID = "1.3.6.1.4.1.4203.666.1.25";
 
     // entryDN
     String ENTRY_DN_AT = "entryDN";
@@ -427,34 +443,40 @@
     
     // ---- Syntaxes -----------------------------------------------------
 
-    String BINARY_SYNTAX = "1.3.6.1.4.1.1466.115.121.1.5";
-    String BIT_STRING_SYNTAX = "1.3.6.1.4.1.1466.115.121.1.6";
-    String BOOLEAN_SYNTAX = "1.3.6.1.4.1.1466.115.121.1.7";
-    String GENERALIZED_TIME_SYNTAX = "1.3.6.1.4.1.1466.115.121.1.24";
-    String INTEGER_SYNTAX = "1.3.6.1.4.1.1466.115.121.1.27";
-    String UTC_TIME_SYNTAX = "1.3.6.1.4.1.1466.115.121.1.53";
-    String DIRECTORY_STRING_SYNTAX = "1.3.6.1.4.1.1466.115.121.1.15";
-    String UUID_SYNTAX = "1.3.6.1.1.16.1";
-    String CSN_SYNTAX = "1.3.6.1.4.1.4203.666.11.2.1";
-
-    String JAVA_BYTE_SYNTAX = "1.3.6.1.4.1.18060.0.4.1.0.0";
-    String JAVA_CHAR_SYNTAX = "1.3.6.1.4.1.18060.0.4.1.0.1";
-    String JAVA_SHORT_SYNTAX = "1.3.6.1.4.1.18060.0.4.1.0.2";
-    String JAVA_LONG_SYNTAX = "1.3.6.1.4.1.18060.0.4.1.0.3";
-    String JAVA_INT_SYNTAX = "1.3.6.1.4.1.18060.0.4.1.0.4";
+    String BINARY_SYNTAX                    = "1.3.6.1.4.1.1466.115.121.1.5";
+    String BIT_STRING_SYNTAX                = "1.3.6.1.4.1.1466.115.121.1.6";
+    String BOOLEAN_SYNTAX                   = "1.3.6.1.4.1.1466.115.121.1.7";
+    String GENERALIZED_TIME_SYNTAX          = "1.3.6.1.4.1.1466.115.121.1.24";
+    String INTEGER_SYNTAX                   = "1.3.6.1.4.1.1466.115.121.1.27";
+    String UTC_TIME_SYNTAX                  = "1.3.6.1.4.1.1466.115.121.1.53";
+    String DIRECTORY_STRING_SYNTAX          = "1.3.6.1.4.1.1466.115.121.1.15";
+    String UUID_SYNTAX                      = "1.3.6.1.1.16.1";
+    String CSN_SYNTAX                       = "1.3.6.1.4.1.4203.666.11.2.1";
+    String CSN_SID_SYNTAX                   = "1.3.6.1.4.1.4203.666.11.2.4";
+
+    String JAVA_BYTE_SYNTAX                 = "1.3.6.1.4.1.18060.0.4.1.0.0";
+    String JAVA_CHAR_SYNTAX                 = "1.3.6.1.4.1.18060.0.4.1.0.1";
+    String JAVA_SHORT_SYNTAX                = "1.3.6.1.4.1.18060.0.4.1.0.2";
+    String JAVA_LONG_SYNTAX                 = "1.3.6.1.4.1.18060.0.4.1.0.3";
+    String JAVA_INT_SYNTAX                  = "1.3.6.1.4.1.18060.0.4.1.0.4";
 
     // ---- MatchingRules -----------------------------------------------------
 
-    String CASE_IGNORE_MR = "caseIgnoreMatch";
-    String CASE_IGNORE_SUBSTRING_MR = "caseIgnoreSubstringsMatch";
-    String CASE_EXACT_MR = "caseExactMatch";
-    String CASE_EXACT_SUBSTRING_MR = "caseExactSubstringsMatch";
-    String INTEGER_MR = "integerMatch";
-    String INTEGER_ORDERING_MR = "integerOrderingMatch";
-    String BOOLEAN_MR = "booleanMatch";
-    String BIT_STRING_MR = "bitStringMatch";
-    String GENERALIZED_TIME_MR = "generalizedTimeMatch";
-    String GENERALIZED_TIME_ORDERING_MR = "generalizedTimeOrderingMatch";
+    String CASE_IGNORE_MR                   = "caseIgnoreMatch";
+    String CASE_IGNORE_SUBSTRING_MR         = "caseIgnoreSubstringsMatch";
+    String CASE_EXACT_MR                    = "caseExactMatch";
+    String CASE_EXACT_SUBSTRING_MR          = "caseExactSubstringsMatch";
+    String INTEGER_MR                       = "integerMatch";
+    String INTEGER_ORDERING_MR              = "integerOrderingMatch";
+    String BOOLEAN_MR                       = "booleanMatch";
+    String BIT_STRING_MR                    = "bitStringMatch";
+    String GENERALIZED_TIME_MR              = "generalizedTimeMatch";
+    String GENERALIZED_TIME_ORDERING_MR     = "generalizedTimeOrderingMatch";
+    String UUID_MATCH                       = "uuidMatch";
+    String UUID_ORDERING_MATCH              = "uuidOrderingMatch";
+    String CSN_MATCH                        = "csndMatch";
+    String CSN_ORDERING_MATCH               = "csnOrderingMatch";
+    String CSN_SID_MATCH                    = "csnSidMatch";
     
     // ---- Features ----------------------------------------------------------
     String FEATURE_ALL_OPERATIONAL_ATTRIBUTES = "1.3.6.1.4.1.4203.1.5.1";

Modified: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java?rev=780471&r1=780470&r2=780471&view=diff
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java (original)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaUtils.java Sun May 31 16:56:44 2009
@@ -24,6 +24,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.UUID;
 
 import javax.naming.NamingException;
 
@@ -1078,4 +1079,36 @@
             return null;
         }
     }
+    
+    
+    /**
+     * Transform an UUID in a byte array
+     * @param uuid The UUID to transform
+     * @return The byte[] representing the UUID
+     */
+    public static byte[] uuidToBytes( UUID uuid )
+    {
+        Long low = uuid.getLeastSignificantBits();
+        Long high = uuid.getMostSignificantBits();
+        byte[] bytes=new byte[16];
+        
+        bytes[0]  = (byte) ((high & 0xff00000000000000L)>>56);
+        bytes[1]  = (byte) ((high & 0x00ff000000000000L)>>48);
+        bytes[2]  = (byte) ((high & 0x0000ff0000000000L)>>40);
+        bytes[3]  = (byte) ((high & 0x000000ff00000000L)>>32);
+        bytes[4]  = (byte) ((high & 0x00000000ff000000L)>>24);
+        bytes[5]  = (byte) ((high & 0x0000000000ff0000L)>>16);
+        bytes[6]  = (byte) ((high & 0x000000000000ff00L)>>8);
+        bytes[7]  = (byte) (high & 0x00000000000000ffL);
+        bytes[8]  = (byte) ((low & 0xff00000000000000L)>>56);
+        bytes[9]  = (byte) ((low & 0x00ff000000000000L)>>48);
+        bytes[10] = (byte) ((low & 0x0000ff0000000000L)>>40);
+        bytes[11] = (byte) ((low & 0x000000ff00000000L)>>32);
+        bytes[12] = (byte) ((low & 0x00000000ff000000L)>>24);
+        bytes[13] = (byte) ((low & 0x0000000000ff0000L)>>16);
+        bytes[14] = (byte) ((low & 0x000000000000ff00L)>>8);
+        bytes[15] = (byte) (low & 0x00000000000000ffL);
+        
+        return bytes;
+    }
 }

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/CsnSidComparator.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/CsnSidComparator.java?rev=780471&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/CsnSidComparator.java (added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/comparators/CsnSidComparator.java Sun May 31 16:56:44 2009
@@ -0,0 +1,87 @@
+/*
+ *  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.schema.comparators;
+
+
+import java.util.Comparator;
+
+import org.apache.directory.shared.ldap.csn.CSN;
+
+
+/**
+ * A comparator for CSN SID.
+ *
+ * The CSN are ordered depending on an evaluation of its component, in this order :
+ * - time, 
+ * - changeCount,
+ * - sid
+ * - modifierNumber
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+public class CsnSidComparator implements Comparator<CSN>
+{
+    /** A static instance of this comparator */
+    public static final Comparator<CSN> INSTANCE = new CsnSidComparator();
+    
+    
+    /**
+     * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+     */
+    public int compare( CSN csn1, CSN csn2 )
+    {
+        // -------------------------------------------------------------------
+        // Handle some basis cases
+        // -------------------------------------------------------------------
+
+        if ( csn1 == null )
+        {
+            return ( csn2 == null ) ? 0 : -1;
+        }
+        
+        if ( csn2 == null )
+        {
+            return 1;
+        }
+        
+        if ( csn1.getTimestamp() != csn2.getTimestamp() )
+        {
+            return ( csn1.getTimestamp() < csn2.getTimestamp() ? -1 : 1 );
+        }
+        
+        if ( csn1.getChangeCount() != csn2.getChangeCount() )
+        {
+            return ( csn1.getChangeCount() < csn2.getChangeCount() ? -1 : 1 );
+        }
+        
+        if ( csn1.getReplicaId() != csn2.getReplicaId() )
+        {
+            return ( csn1.getReplicaId() < csn2.getReplicaId() ? -1 : 1 );
+        }
+        
+        if ( csn1.getOperationNumber() != csn2.getOperationNumber() )
+        {
+            return ( csn1.getOperationNumber() < csn2.getOperationNumber() ? -1 : 1 );
+        }
+        
+        return 0;
+    }
+}

Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxes/CsnSidSyntaxChecker.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxes/CsnSidSyntaxChecker.java?rev=780471&view=auto
==============================================================================
--- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxes/CsnSidSyntaxChecker.java (added)
+++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/schema/syntaxes/CsnSidSyntaxChecker.java Sun May 31 16:56:44 2009
@@ -0,0 +1,84 @@
+/*
+ *  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, eCopyOfUuidSyntaxCheckerither express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.shared.ldap.schema.syntaxes;
+
+import org.apache.directory.shared.ldap.constants.SchemaConstants;
+import org.apache.directory.shared.ldap.schema.AbstractSyntaxChecker;
+import org.apache.directory.shared.ldap.schema.SyntaxChecker;
+
+
+/**
+ * An CSN SID syntax checker.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev: 736240 $
+ */
+public class CsnSidSyntaxChecker extends AbstractSyntaxChecker
+{
+    /** the Apache assigned internal OID for this syntax checker */
+    public static final SyntaxChecker INSTANCE = new CsnSidSyntaxChecker();
+
+
+    /**
+     * Creates a new instance of CsnSyntaxChecker.
+     */
+    public CsnSidSyntaxChecker()
+    {
+        super( SchemaConstants.CSN_SID_SYNTAX );
+    }
+
+
+    /**
+     * 
+     * Creates a new instance of CsnSidSyntaxChecker.
+     * 
+     * @param oid the oid to associate with this new SyntaxChecker
+     *
+     */
+    protected CsnSidSyntaxChecker( String oid )
+    {
+        super( oid );
+    }
+
+    
+    /**
+     * @see org.apache.directory.shared.ldap.schema.SyntaxChecker#isValidSyntax(Object)
+     * 
+     * The value is stored as a String internally.
+     * 
+     * @param value the value of some attribute with the syntax
+     * @return true if the value is in the valid syntax, false otherwise
+     */
+    public boolean isValidSyntax( Object value )
+    {
+        if ( value == null )
+        {
+            return false;
+        }
+        
+        if ( ! ( value instanceof String ) )
+        {
+            return false;
+        }
+
+        // TODO : add the check
+        return false;
+    }
+}



Mime
View raw message