directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r987633 - in /directory/apacheds/trunk/server-config/src/main: java/org/apache/directory/server/config/ resources/config/ou=config/ou=servers/
Date Fri, 20 Aug 2010 20:53:40 GMT
Author: kayyagari
Date: Fri Aug 20 20:53:39 2010
New Revision: 987633

URL: http://svn.apache.org/viewvc?rev=987633&view=rev
Log:
o added the default value for config attribute 'ads-enableReplProvider'
o updated config partition reader to use this attribute

Modified:
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
    directory/apacheds/trunk/server-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=987633&r1=987632&r2=987633&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
(original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
Fri Aug 20 20:53:39 2010
@@ -88,6 +88,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.bind.MechanismHandler;
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.replication.ReplicationProvider;
+import org.apache.directory.server.ldap.replication.SyncReplProvider;
 import org.apache.directory.server.ldap.replication.SyncreplConfiguration;
 import org.apache.directory.server.ntp.NtpServer;
 import org.apache.directory.server.protocol.shared.transport.TcpTransport;
@@ -112,7 +113,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.name.DN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.util.StringTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 ;
@@ -225,20 +225,37 @@ public class ConfigPartitionReader
         Transport[] transports = createTransports( ldapServerEntry.getDn() );
         server.setTransports( transports );
 
-        EntryAttribute replProvImplAttr = ldapServerEntry.get( ConfigSchemaConstants.ADS_REPL_PROVIDER_IMPL
);
-        if( replProvImplAttr != null )
+        EntryAttribute replEnableProvAttr = ldapServerEntry.get( ConfigSchemaConstants.ADS_REPL_ENABLE_PROVIDER
);
+        
+        if( replEnableProvAttr != null )
         {
-            String fqcn = replProvImplAttr.getString();
-            try
-            {
-                Class<?> replProvImplClz = Class.forName( fqcn );
-                ReplicationProvider rp = ( ReplicationProvider ) replProvImplClz.newInstance();
-                server.setReplicationProvider( rp );
-            }
-            catch( ClassNotFoundException e )
+            if( Boolean.parseBoolean( replEnableProvAttr.getString() ) )
             {
-                LOG.error( "Failed to load and instantiate ReplicationProvider implementation",
e );
-                throw e;
+                EntryAttribute replProvImplAttr = ldapServerEntry.get( ConfigSchemaConstants.ADS_REPL_PROVIDER_IMPL
);
+                
+                String fqcn = null;
+                
+                if( replProvImplAttr != null )
+                {
+                    fqcn = replProvImplAttr.getString();
+                }
+                else
+                {
+                    // default replication provider
+                    fqcn = SyncReplProvider.class.getName();
+                }
+                
+                try
+                {
+                    Class<?> replProvImplClz = Class.forName( fqcn );
+                    ReplicationProvider rp = ( ReplicationProvider ) replProvImplClz.newInstance();
+                    server.setReplicationProvider( rp );
+                }
+                catch( ClassNotFoundException e )
+                {
+                    LOG.error( "Failed to load and instantiate ReplicationProvider implementation",
e );
+                    throw e;
+                }
             }
         }
         

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java?rev=987633&r1=987632&r2=987633&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
(original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
Fri Aug 20 20:53:39 2010
@@ -72,9 +72,6 @@ public interface ConfigSchemaConstants
 
     String ADS_HTTP_CONFFILE = "ads-httpConfFile";
 
-    //TODO unused, better to be remove or reuse after renaming
-    //String ADS_HTTP_WEBAPPS = "ads-httpWebApps";
-
     String ADS_DIRECTORYSERVICE_ID = "ads-directoryServiceId";
 
     String ADS_DS_REPLICA_ID = "ads-dsReplicaId";
@@ -211,6 +208,8 @@ public interface ConfigSchemaConstants
     
     String ADS_REPL_PROVIDER_IMPL = "ads-replProviderImpl";
     
+    String ADS_REPL_ENABLE_PROVIDER = "ads-enableReplProvider";
+    
     String ADS_LDAP_SERVER_SASL_MECH_HANDLER_OC = "ads-ldapServerSaslMechanismHandler";
     
     String ADS_LDAP_SERVER_SASL_MECH_NAME = "ads-ldapServerSaslMechName";

Modified: directory/apacheds/trunk/server-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/resources/config/ou%3Dconfig/ou%3Dservers/ads-serverid%3Dldapserver.ldif?rev=987633&r1=987632&r2=987633&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif
(original)
+++ directory/apacheds/trunk/server-config/src/main/resources/config/ou=config/ou=servers/ads-serverid=ldapserver.ldif
Fri Aug 20 20:53:39 2010
@@ -15,3 +15,4 @@ ads-ldapserversaslrealms: example.com
 ads-ldapserversaslrealms: apache.org
 ads-searchbasedn: ou=users,ou=system
 ads-enabled: true
+ads-enableReplProvider: false



Mime
View raw message