You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ka...@apache.org on 2010/05/25 16:20:41 UTC

svn commit: r948056 - in /directory/apacheds/trunk/default-config/src/main: java/org/apache/directory/server/config/ resources/config/ou=config/ou=directoryservice/ resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partit...

Author: kayyagari
Date: Tue May 25 14:20:40 2010
New Revision: 948056

URL: http://svn.apache.org/viewvc?rev=948056&view=rev
Log:
o removed the attributes which are used for pointing to the configuration of entries required in configuring a service/server
o updated the config partition reader's code accordingly 

Modified:
    directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=example.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=system.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=changepasswordserver.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=dns.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=kerberos.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif
    directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ntp.ldif

Modified: directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java (original)
+++ directory/apacheds/trunk/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java Tue May 25 14:20:40 2010
@@ -191,9 +191,7 @@ public class ConfigPartitionReader
         LdapServer server = new LdapServer();
         server.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, ldapServerEntry ) );
 
-        DN transportsDN = new DN( getString( ConfigSchemaConstants.ADS_TRANSPORTS, ldapServerEntry ) );
-        transportsDN.normalize( schemaManager.getNormalizerMapping() );
-        Transport[] transports = getTransports( transportsDN );
+        Transport[] transports = getTransports( ldapServerEntry.getDn() );
         server.setTransports( transports );
 
         EntryAttribute replProvImplAttr = ldapServerEntry.get( ConfigSchemaConstants.ADS_REPL_PROVIDER_IMPL );
@@ -297,9 +295,7 @@ public class ConfigPartitionReader
 
         kdcServer.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, kdcEntry ) );
 
-        DN transportsDN = new DN( getString( ConfigSchemaConstants.ADS_TRANSPORTS, kdcEntry ) );
-        transportsDN.normalize( schemaManager.getNormalizerMapping() );
-        Transport[] transports = getTransports( transportsDN );
+        Transport[] transports = getTransports( kdcEntry.getDn() );
         kdcServer.setTransports( transports );
 
         // MAY attributes
@@ -446,9 +442,7 @@ public class ConfigPartitionReader
 
         dnsServer.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, dnsEntry ) );
 
-        DN transportsDN = new DN( getString( ConfigSchemaConstants.ADS_TRANSPORTS, dnsEntry ) );
-        transportsDN.normalize( schemaManager.getNormalizerMapping() );
-        Transport[] transports = getTransports( transportsDN );
+        Transport[] transports = getTransports( dnsEntry.getDn() );
         dnsServer.setTransports( transports );
 
         return dnsServer;
@@ -523,9 +517,7 @@ public class ConfigPartitionReader
 
         ntpServer.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, ntpEntry ) );
 
-        DN transportsDN = new DN( getString( ConfigSchemaConstants.ADS_TRANSPORTS, ntpEntry ) );
-        transportsDN.normalize( schemaManager.getNormalizerMapping() );
-        Transport[] transports = getTransports( transportsDN );
+        Transport[] transports = getTransports( ntpEntry.getDn() );
         ntpServer.setTransports( transports );
 
         return ntpServer;
@@ -563,9 +555,7 @@ public class ConfigPartitionReader
 
         chgPwdServer.setServiceId( getString( ConfigSchemaConstants.ADS_SERVER_ID, chgPwdEntry ) );
 
-        DN transportsDN = new DN( getString( ConfigSchemaConstants.ADS_TRANSPORTS, chgPwdEntry ) );
-        transportsDN.normalize( schemaManager.getNormalizerMapping() );
-        Transport[] transports = getTransports( transportsDN );
+        Transport[] transports = getTransports( chgPwdEntry.getDn() );
         chgPwdServer.setTransports( transports );
 
         // MAY attributes
@@ -733,15 +723,10 @@ public class ConfigPartitionReader
         dirService.setInstanceId( getString( ConfigSchemaConstants.ADS_DIRECTORYSERVICE_ID, dsEntry ) );
         dirService.setReplicaId( getInt( ConfigSchemaConstants.ADS_DS_REPLICA_ID, dsEntry ) );
 
-        DN interceptorsDN = new DN( dsEntry.get( ConfigSchemaConstants.ADS_DSINTERCEPTORS ).getString() );
-        interceptorsDN.normalize( configPartition.getSchemaManager().getNormalizerMapping() );
-        List<Interceptor> interceptors = getInterceptors( interceptorsDN );
+        List<Interceptor> interceptors = getInterceptors( dsEntry.getDn() );
         dirService.setInterceptors( interceptors );
 
-        DN partitionsDN = new DN( dsEntry.get( ConfigSchemaConstants.ADS_DSPARTITIONS ).getString() );
-        partitionsDN.normalize( configPartition.getSchemaManager().getNormalizerMapping() );
-
-        Map<String, Partition> partitions = getPartitions( partitionsDN );
+        Map<String, Partition> partitions = getPartitions( dsEntry.getDn() );
 
         Partition systemPartition = partitions.remove( "system" );
 
@@ -974,16 +959,16 @@ public class ConfigPartitionReader
     /**
      * reads the Interceptor configuration and instantiates them in the order specified
      *
-     * @param interceptorsDN the DN under which interceptors are configured
+     * @param dirServiceDN the DN under which interceptors are configured
      * @return a list of instantiated Interceptor objects
      * @throws Exception
      */
-    private List<Interceptor> getInterceptors( DN interceptorsDN ) throws Exception
+    private List<Interceptor> getInterceptors( DN dirServiceDN ) throws Exception
     {
         PresenceNode filter = new PresenceNode( ConfigSchemaConstants.ADS_INTERCEPTOR_ID );
         SearchControls controls = new SearchControls();
-        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( interceptorsDN, AliasDerefMode.NEVER_DEREF_ALIASES,
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( dirServiceDN, AliasDerefMode.NEVER_DEREF_ALIASES,
             filter, controls );
 
         Set<InterceptorConfig> set = new TreeSet<InterceptorConfig>();
@@ -1029,12 +1014,12 @@ public class ConfigPartitionReader
     }
 
 
-    private Map<String, Partition> getPartitions( DN partitionsDN ) throws Exception
+    private Map<String, Partition> getPartitions( DN dirServiceDN ) throws Exception
     {
         PresenceNode filter = new PresenceNode( ConfigSchemaConstants.ADS_PARTITION_ID );
         SearchControls controls = new SearchControls();
-        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( partitionsDN, AliasDerefMode.NEVER_DEREF_ALIASES,
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( dirServiceDN, AliasDerefMode.NEVER_DEREF_ALIASES,
             filter, controls );
 
         Map<String, Partition> partitions = new HashMap<String, Partition>();
@@ -1099,21 +1084,19 @@ public class ConfigPartitionReader
             partition.setSyncOnWrite( Boolean.parseBoolean( syncAttr.getString() ) );
         }
 
-        String indexesDN = partitionEntry.get( ConfigSchemaConstants.ADS_PARTITION_INDEXED_ATTRIBUTES ).getString();
-
-        Set<Index<?, Entry, Long>> indexedAttributes = getIndexes( new DN( indexesDN ) );
+        Set<Index<?, Entry, Long>> indexedAttributes = getIndexes( partitionEntry.getDn() );
         partition.setIndexedAttributes( indexedAttributes );
 
         return partition;
     }
 
 
-    private Set<Index<?, Entry, Long>> getIndexes( DN indexesDN ) throws Exception
+    private Set<Index<?, Entry, Long>> getIndexes( DN partitionDN ) throws Exception
     {
         PresenceNode filter = new PresenceNode( ConfigSchemaConstants.ADS_INDEX_ATTRIBUTE_ID );
         SearchControls controls = new SearchControls();
-        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( indexesDN, AliasDerefMode.NEVER_DEREF_ALIASES, filter,
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( partitionDN, AliasDerefMode.NEVER_DEREF_ALIASES, filter,
             controls );
 
         Set<Index<?, Entry, Long>> indexes = new HashSet<Index<?, Entry, Long>>();
@@ -1167,12 +1150,12 @@ public class ConfigPartitionReader
     }
 
 
-    private Transport[] getTransports( DN transportsDN ) throws Exception
+    private Transport[] getTransports( DN adsServerDN ) throws Exception
     {
         PresenceNode filter = new PresenceNode( ConfigSchemaConstants.ADS_TRANSPORT_ID );
         SearchControls controls = new SearchControls();
-        controls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        IndexCursor<Long, Entry, Long> cursor = se.cursor( transportsDN, AliasDerefMode.NEVER_DEREF_ALIASES,
+        controls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        IndexCursor<Long, Entry, Long> cursor = se.cursor( adsServerDN, AliasDerefMode.NEVER_DEREF_ALIASES,
             filter, controls );
 
         List<Transport> transports = new ArrayList<Transport>();

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Ddirectoryservice/ads-directoryserviceid%3Ddefault.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default.ldif Tue May 25 14:20:40 2010
@@ -1,7 +1,5 @@
 version: 1
 dn: ads-directoryServiceId=default,ou=directoryService,ou=config
-ads-dspartitions: ou=partitions,ads-directoryServiceId=default,ou=directoryServi
- ce,ou=config
 ads-dsreplicaid: 1
 ads-dssyncperiodmillis: 15000
 ads-dsmaxpdusize: 2000000
@@ -11,5 +9,3 @@ ads-dsdenormalizeopattrsenabled: false
 objectclass: ads-directoryService
 objectclass: top
 ads-directoryserviceid: default
-ads-dsinterceptors: ou=interceptors,ads-directoryServiceId=default,ou=directoryS
- ervice,ou=config

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=example.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Ddirectoryservice/ads-directoryserviceid%3Ddefault/ou%3Dpartitions/ads-partitionid%3Dexample.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=example.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=example.ldif Tue May 25 14:20:40 2010
@@ -2,8 +2,6 @@ version: 1
 dn: ads-partitionId=example,ou=partitions,ads-directoryServiceId=default,ou=dire
  ctoryService,ou=config
 ads-partitionsuffix: dc=example,dc=com
-ads-partitionindexedattributes: ou=indexes,ads-partitionId=example,ou=partitions
- ,ads-directoryServiceId=default,ou=directoryService,ou=config
 ads-jdbmpartitionoptimizerenabled: true
 ads-partitioncachesize: 100
 ads-partitionsynconwrite: true

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=system.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Ddirectoryservice/ads-directoryserviceid%3Ddefault/ou%3Dpartitions/ads-partitionid%3Dsystem.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=system.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=directoryservice/ads-directoryserviceid=default/ou=partitions/ads-partitionid=system.ldif Tue May 25 14:20:40 2010
@@ -2,8 +2,6 @@ version: 1
 dn: ads-partitionId=system,ou=partitions,ads-directoryServiceId=default,ou=direc
  toryService,ou=config
 ads-partitionsuffix: ou=system
-ads-partitionindexedattributes: ou=indexes,ads-partitionId=system,ou=partitions,
- ads-directoryServiceId=default,ou=directoryService,ou=config
 ads-jdbmpartitionoptimizerenabled: true
 ads-partitioncachesize: 100
 ads-partitionsynconwrite: true

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=changepasswordserver.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dchangepasswordserver.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=changepasswordserver.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=changepasswordserver.ldif Tue May 25 14:20:40 2010
@@ -3,8 +3,6 @@ dn: ads-serverId=changepasswordserver,ou
 ads-serverds: ads-directoryServiceId=default,ou=directoryService,ou=config
 ads-serverid: changepasswordserver
 ads-enabled: false
-ads-transports: ou=transports,ads-serverId=changepasswordserver,ou=servers,ou=co
- nfig
 objectclass: ads-server
 objectclass: ads-changePasswordServer
 objectclass: ads-catalogBasedServer

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=dns.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Ddns.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=dns.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=dns.ldif Tue May 25 14:20:40 2010
@@ -3,7 +3,6 @@ dn: ads-serverId=dns,ou=servers,ou=confi
 ads-serverds: ads-directoryServiceId=default,ou=directoryService,ou=config
 ads-serverid: dns
 ads-enabled: false
-ads-transports: ou=transports,ads-serverId=dns,ou=servers,ou=config
 objectclass: ads-server
 objectclass: ads-dnsServer
 objectclass: ads-catalogBasedServer

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=kerberos.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dkerberos.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=kerberos.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=kerberos.ldif Tue May 25 14:20:40 2010
@@ -3,7 +3,6 @@ dn: ads-serverId=kerberos,ou=servers,ou=
 ads-serverds: ads-directoryServiceId=default,ou=directoryService,ou=config
 ads-serverid: kerberos
 ads-enabled: false
-ads-transports: ou=transports,ads-serverId=kerberos,ou=servers,ou=config
 objectclass: ads-server
 objectclass: ads-kerberosServer
 objectclass: ads-catalogBasedServer

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif Tue May 25 14:20:40 2010
@@ -7,7 +7,6 @@ ads-ldapserversaslrealms: example.com
 ads-ldapserversaslrealms: apache.org
 ads-ldapserversaslhost: ldap.example.com
 ads-ldapserversaslprincipal: ldap/ldap.example.com@EXAMPLE.COM
-ads-transports: ou=transports,ads-serverId=ldapServer,ou=servers,ou=config
 ads-searchbasedn: ou=users,ou=system
 ads-ldapservermaxtimelimit: 15000
 ads-ldapservermaxsizelimit: 1000

Modified: directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ntp.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/default-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dntp.ldif?rev=948056&r1=948055&r2=948056&view=diff
==============================================================================
--- directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ntp.ldif (original)
+++ directory/apacheds/trunk/default-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ntp.ldif Tue May 25 14:20:40 2010
@@ -2,7 +2,6 @@ version: 1
 dn: ads-serverId=ntp,ou=servers,ou=config
 ads-serverid: ntp
 ads-enabled: false
-ads-transports: ou=transports,ads-serverId=ntp,ou=servers,ou=config
 objectclass: ads-server
 objectclass: ads-ntpServer
 objectclass: top