directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r891631 - in /directory: apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/...
Date Thu, 17 Dec 2009 11:07:03 GMT
Author: elecharny
Date: Thu Dec 17 11:07:02 2009
New Revision: 891631

URL: http://svn.apache.org/viewvc?rev=891631&view=rev
Log:
Renamed hasOid() method to contains() for consistency

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java?rev=891631&r1=891630&r2=891631&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AbstractRegistrySynchronizer.java
Thu Dec 17 11:07:02 2009
@@ -164,7 +164,7 @@
     {
         String oid = getOid( entry );
 
-        if ( schemaManager.getOidRegistry().hasOid( oid ) )
+        if ( schemaManager.getOidRegistry().contains( oid ) )
         {
             throw new LdapNamingException( "Oid " + oid + " for new schema entity is not
unique.",
                 ResultCodeEnum.OTHER );
@@ -180,7 +180,7 @@
     {
         String oid = getOid( entry );
 
-        if ( schemaManager.getOidRegistry().hasOid( oid ) )
+        if ( schemaManager.getOidRegistry().contains( oid ) )
         {
             return schemaManager.getOidRegistry().getSchemaObject( oid );
         }
@@ -225,7 +225,7 @@
     {
         String oid = schemaObject.getOid();
 
-        if ( schemaManager.getOidRegistry().hasOid( oid ) )
+        if ( schemaManager.getOidRegistry().contains( oid ) )
         {
             throw new LdapSchemaViolationException( "Oid " + oid + " for new schema entity
is not unique.",
                 ResultCodeEnum.OTHER );
@@ -235,7 +235,7 @@
 
     protected void checkOidIsUnique( String oid ) throws Exception
     {
-        if ( schemaManager.getOidRegistry().hasOid( oid ) )
+        if ( schemaManager.getOidRegistry().contains( oid ) )
         {
             throw new LdapSchemaViolationException( "Oid " + oid + " for new schema entity
is not unique.",
                 ResultCodeEnum.OTHER );

Modified: directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java?rev=891631&r1=891630&r2=891631&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-integ/src/test/java/org/apache/directory/server/core/schema/MetaAttributeTypeHandlerIT.java
Thu Dec 17 11:07:02 2009
@@ -203,6 +203,9 @@
         assertFalse( "adding new attributeType to disabled schema should not register it
into the registries", 
             service.getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
         
+        // The GlobalOidRegistries must not contain the AT
+        assertFalse( service.getSchemaManager().getOidRegistry().contains( OID ) );
+        
         // The added entry must be present on disk
         assertTrue( isOnDisk( dn ) );
     }
@@ -237,6 +240,12 @@
     }
     
     
+    /**
+     * Try to delete an AT from a disabled schema. The AT is first
+     * added, then deleted. The AT should be present on disk but not
+     * in the registries before the deletion, and removed from disk
+     * after the deletion.
+     */
     @Test
     public void testDeleteAttributeTypeFromDisabledSchema() throws Exception
     {
@@ -258,6 +267,7 @@
         // Check in Registries
         assertFalse( "attributeType should be removed from the registry after being deleted",

             service.getSchemaManager().getAttributeTypeRegistry().contains( OID ) );
+        assertFalse( service.getSchemaManager().getOidRegistry().contains( OID ) );
         
         // Check on disk that the deleted SchemaObject does not exist anymore
         assertFalse( isOnDisk( dn ) );

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=891631&r1=891630&r2=891631&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Thu Dec 17 11:07:02 2009
@@ -834,7 +834,7 @@
     {
         OidRegistry oidRegistry = schemaManager.getOidRegistry();
 
-        if ( !oidRegistry.hasOid( attrId ) )
+        if ( !oidRegistry.contains( attrId ) )
         {
             return false;
         }

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=891631&r1=891630&r2=891631&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Thu Dec 17 11:07:02 2009
@@ -1380,7 +1380,7 @@
     {
         if ( !( schemaObject instanceof LoadableSchemaObject ) )
         {
-            return registries.getGlobalOidRegistry().hasOid( schemaObject.getOid() );
+            return registries.getGlobalOidRegistry().contains( schemaObject.getOid() );
         }
 
         if ( schemaObject instanceof LdapComparator<?> )

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java?rev=891631&r1=891630&r2=891631&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultSchemaObjectRegistry.java
Thu Dec 17 11:07:02 2009
@@ -376,7 +376,7 @@
                 T copiedValue = null;
 
                 // Copy the value if it's not already in the oidRegistry
-                if ( oidRegistry.hasOid( value.getOid() ) )
+                if ( oidRegistry.contains( value.getOid() ) )
                 {
                     try
                     {

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java?rev=891631&r1=891630&r2=891631&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
Thu Dec 17 11:07:02 2009
@@ -60,7 +60,7 @@
      * @param oid The OID to lookup
      * @return true if the OID alreadyexists
      */
-    public boolean hasOid( String oid )
+    public boolean contains( String oid )
     {
         return byOid.containsKey( oid );
     }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=891631&r1=891630&r2=891631&view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Thu Dec 17 11:07:02 2009
@@ -1525,7 +1525,7 @@
         }
         else
         {
-            if ( globalOidRegistry.hasOid( schemaObject.getOid() ) )
+            if ( globalOidRegistry.contains( schemaObject.getOid() ) )
             {
                 // TODO : throw an exception here
                 String msg = "Registering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
@@ -1606,7 +1606,7 @@
         LOG.debug( "Registering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
         // Check that the SchemaObject is not already registered
-        if ( !( schemaObject instanceof LoadableSchemaObject ) && globalOidRegistry.hasOid(
schemaObject.getOid() ) )
+        if ( !( schemaObject instanceof LoadableSchemaObject ) && globalOidRegistry.contains(
schemaObject.getOid() ) )
         {
             // TODO : throw an exception here
             String msg = "Registering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
@@ -1676,7 +1676,7 @@
         LOG.debug( "Unregistering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
         // Check that the SchemaObject is already registered
-        if ( !( schemaObject instanceof LoadableSchemaObject ) && !globalOidRegistry.hasOid(
schemaObject.getOid() ) )
+        if ( !( schemaObject instanceof LoadableSchemaObject ) && !globalOidRegistry.contains(
schemaObject.getOid() ) )
         {
             // TODO : throw an exception here
             String msg = "Unregistering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
@@ -1745,7 +1745,7 @@
         }
         else
         {
-            if ( !globalOidRegistry.hasOid( schemaObject.getOid() ) )
+            if ( !globalOidRegistry.contains( schemaObject.getOid() ) )
             {
                 // TODO : throw an exception here
                 String msg = "Unregistering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()



Mime
View raw message