directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1393269 - /directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Date Wed, 03 Oct 2012 03:10:26 GMT
Author: elecharny
Date: Wed Oct  3 03:10:26 2012
New Revision: 1393269

URL: http://svn.apache.org/viewvc?rev=1393269&view=rev
Log:
Modified the Index addition so that if the indexed Attribute does not exists in the Schema,
it does not forbid the server to start. Now, we get an error, but the server can be launched.
(of course, no index is created)

Modified:
    directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java

Modified: directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java?rev=1393269&r1=1393268&r2=1393269&view=diff
==============================================================================
--- directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
(original)
+++ directory/apacheds/trunk/xdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/AbstractBTreePartition.java
Wed Oct  3 03:10:26 2012
@@ -73,6 +73,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapContextNotEmptyException;
 import org.apache.directory.shared.ldap.model.exception.LdapEntryAlreadyExistsException;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.exception.LdapNoSuchAttributeException;
 import org.apache.directory.shared.ldap.model.exception.LdapNoSuchObjectException;
 import org.apache.directory.shared.ldap.model.exception.LdapOperationErrorException;
 import org.apache.directory.shared.ldap.model.exception.LdapSchemaViolationException;
@@ -2281,11 +2282,18 @@ public abstract class AbstractBTreeParti
         checkInitialized( "addIndex" );
 
         // Check that the index String is valid
-        AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( index.getAttributeId()
);
+        AttributeType attributeType = null;
 
-        if ( attributeType == null )
+        try
+        {
+            attributeType = schemaManager.lookupAttributeTypeRegistry( index.getAttributeId()
);
+        }
+        catch ( LdapNoSuchAttributeException lnsae )
         {
-            throw new IllegalArgumentException( I18n.err( I18n.ERR_309, index.getAttributeId()
) );
+            LOG.error( "Cannot initialize the index for AttributeType {}, this value does
not exist",
+                index.getAttributeId() );
+
+            return;
         }
 
         String oid = attributeType.getOid();



Mime
View raw message