directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gokt...@apache.org
Subject svn commit: r1355191 - in /directory: apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/ apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/ shared/branche...
Date Thu, 28 Jun 2012 23:11:23 GMT
Author: gokturk
Date: Thu Jun 28 23:11:21 2012
New Revision: 1355191

URL: http://svn.apache.org/viewvc?rev=1355191&view=rev
Log:
* Naming a DirectoryComponent is made more natural with ability to use any attribute as naming
attribute. Schema for ads-component is altered to treat ads-instance as optional.

Modified:
    directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java
    directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java
    directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreDcBuilder.java
    directory/shared/branches/shared-osgi/ldap/schema/data/src/main/resources/schema/ou=schema/cn=componenthub/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.4.0.2.1.ldif

Modified: directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java?rev=1355191&r1=1355190&r2=1355191&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/api/src/main/java/org/apache/directory/server/hub/api/component/DirectoryComponent.java
Thu Jun 28 23:11:21 2012
@@ -21,20 +21,14 @@
 package org.apache.directory.server.hub.api.component;
 
 
-import java.util.ArrayList;
-import java.util.List;
-
-
 public class DirectoryComponent
 {
     private String componentManagerPID;
     private String componentName;
+    private String namerAttribute = null;
     private String configLocation;
     private DcConfiguration configuration;
 
-    private List<String> errors = new ArrayList<String>();
-    private List<String> warnings = new ArrayList<String>();
-
     private boolean instantiationFailure;
 
     private boolean dirty;
@@ -135,34 +129,14 @@ public class DirectoryComponent
     }
 
 
-    public void clearErrorsAndWarns()
-    {
-        errors.clear();
-        warnings.clear();
-    }
-
-
-    public void addError( String error )
-    {
-        errors.add( error );
-    }
-
-
-    public void addWarn( String warn )
-    {
-        warnings.add( warn );
-    }
-
-
-    public List<String> getErrors()
+    public String getNamerAttribute()
     {
-        return errors;
+        return namerAttribute;
     }
 
 
-    public List<String> getWarnings()
+    public void setNamerAttribute( String customNamerId )
     {
-        return warnings;
+        this.namerAttribute = customNamerId;
     }
-
 }

Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java?rev=1355191&r1=1355190&r2=1355191&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreConfigManager.java
Thu Jun 28 23:11:21 2012
@@ -240,7 +240,7 @@ public class StoreConfigManager
 
         Entry componentEntry = new DefaultEntry( schemaManager, componentDn );
         componentEntry.add( schemaManager.getAttributeType( "objectclass" ), component.getComponentManagerPID()
);
-        componentEntry.add( schemaManager.getAttributeType( StoreSchemaConstants.HUB_AT_COMPONENT_NAME
),
+        componentEntry.add( schemaManager.getAttributeType( component.getNamerAttribute()
),
             component.getComponentName() );
 
         Integer itemIndex = component.getConfiguration().getCollectionIndex();

Modified: directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreDcBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreDcBuilder.java?rev=1355191&r1=1355190&r2=1355191&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreDcBuilder.java
(original)
+++ directory/apacheds/branches/apacheds-osgi/hub/core/src/main/java/org/apache/directory/server/hub/core/store/StoreDcBuilder.java
Thu Jun 28 23:11:21 2012
@@ -33,6 +33,7 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.entry.Entry;
 import org.apache.directory.shared.ldap.model.entry.Value;
 import org.apache.directory.shared.ldap.model.exception.LdapException;
+import org.apache.directory.shared.ldap.model.name.Rdn;
 import org.apache.directory.shared.ldap.model.schema.ObjectClass;
 import org.apache.directory.shared.ldap.model.schema.SchemaManager;
 
@@ -76,20 +77,24 @@ public class StoreDcBuilder
             }
         }
 
+        // Parsing name and namer attribute out of Dn.
+        Rdn name = componentEntry.getDn().getRdn();
+        componentName = name.getValue().getString();
+
+        String namer = name.getType();
+
         List<DcProperty> properties = new ArrayList<DcProperty>();
 
         Collection<Attribute> attribs = componentEntry.getAttributes();
         for ( Attribute attrib : attribs )
         {
-            if ( attrib.getUpId().equals( StoreSchemaConstants.HUB_AT_COMPONENT_NAME.toLowerCase()
) )
-            {
-                componentName = attrib.getString();
-            }
-            else if ( attrib.getUpId().equals( StoreSchemaConstants.HUB_AT_COLL_ITEM_INDEX.toLowerCase()
) )
+
+            if ( attrib.getUpId().equals( StoreSchemaConstants.HUB_AT_COLL_ITEM_INDEX.toLowerCase()
) )
             {
                 collectionIndex = Integer.parseInt( attrib.getString() );
             }
-            else if ( attrib.getUpId().equals( SchemaConstants.ENTRY_UUID_AT.toLowerCase()
)
+            else if ( attrib.getUpId().equals( namer )
+                || attrib.getUpId().equals( SchemaConstants.ENTRY_UUID_AT.toLowerCase() )
                 || attrib.getUpId().equals( SchemaConstants.ENTRY_CSN_AT.toLowerCase() )
                 || attrib.getUpId().equals( SchemaConstants.CREATORS_NAME_AT.toLowerCase()
)
                 || attrib.getUpId().equals( SchemaConstants.CREATE_TIMESTAMP_AT.toLowerCase()
)
@@ -111,6 +116,7 @@ public class StoreDcBuilder
 
         DirectoryComponent component = new DirectoryComponent( managerPID, componentName,
componentConf );
         component.setConfigLocation( componentEntry.getDn().getName() );
+        component.setNamerAttribute( namer );
 
         return component;
     }

Modified: directory/shared/branches/shared-osgi/ldap/schema/data/src/main/resources/schema/ou=schema/cn=componenthub/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.4.0.2.1.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-osgi/ldap/schema/data/src/main/resources/schema/ou%3Dschema/cn%3Dcomponenthub/ou%3Dobjectclasses/m-oid%3D1.3.6.1.4.1.18060.0.4.4.0.2.1.ldif?rev=1355191&r1=1355190&r2=1355191&view=diff
==============================================================================
--- directory/shared/branches/shared-osgi/ldap/schema/data/src/main/resources/schema/ou=schema/cn=componenthub/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.4.0.2.1.ldif
(original)
+++ directory/shared/branches/shared-osgi/ldap/schema/data/src/main/resources/schema/ou=schema/cn=componenthub/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.4.0.2.1.ldif
Thu Jun 28 23:11:21 2012
@@ -1,6 +1,6 @@
 dn: m-oid=1.3.6.1.4.1.18060.0.4.4.0.2.1,ou=objectclasses,cn=componenthub,ou=sche
  ma
-m-must: ads-instance
+m-may: ads-instance
 m-typeObjectClass: ABSTRACT
 objectclass: metaObjectClass
 objectclass: metaTop



Mime
View raw message