directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1029978 - in /directory/apacheds/branches/server-config-indexbean-experiment: ./ src/main/java/org/apache/directory/server/config/ src/main/java/org/apache/directory/server/config/beans/ src/main/resources/ src/test/java/org/apache/directo...
Date Tue, 02 Nov 2010 09:30:17 GMT
Author: kayyagari
Date: Tue Nov  2 09:30:16 2010
New Revision: 1029978

URL: http://svn.apache.org/viewvc?rev=1029978&view=rev
Log:
o merged changes done in trunk after branching

Modified:
    directory/apacheds/branches/server-config-indexbean-experiment/   (props changed)
    directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
    directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
  (props changed)
    directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
    directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
    directory/apacheds/branches/server-config-indexbean-experiment/src/main/resources/   (props
changed)
    directory/apacheds/branches/server-config-indexbean-experiment/src/main/resources/config.ldif
    directory/apacheds/branches/server-config-indexbean-experiment/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
  (props changed)

Propchange: directory/apacheds/branches/server-config-indexbean-experiment/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  2 09:30:16 2010
@@ -1,3 +1,4 @@
 /directory/apacheds/branches/apacheds-codec-merge/server-config:982369-987590
 /directory/apacheds/branches/apacheds-config/server-config:1023442-1029077
 /directory/apacheds/branches/apacheds-dnfactory-experiment/server-config:980138-980938
+/directory/apacheds/trunk/server-config:1029696-1029972

Modified: directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/ConfigBuilder.java?rev=1029978&r1=1029977&r2=1029978&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
(original)
+++ directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
Tue Nov  2 09:30:16 2010
@@ -57,6 +57,7 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.InstanceLayout;
 import org.apache.directory.server.core.PasswordPolicyConfiguration;
+import org.apache.directory.server.core.PpolicyConfigContainer;
 import org.apache.directory.server.core.changelog.ChangeLog;
 import org.apache.directory.server.core.changelog.DefaultChangeLog;
 import org.apache.directory.server.core.interceptor.Interceptor;
@@ -136,7 +137,10 @@ public class ConfigBuilder
 
         for ( InterceptorBean interceptorBean : interceptorBeans )
         {
-            orderedInterceptorBeans.add( interceptorBean );
+            if ( interceptorBean.isEnabled() )
+            {
+                orderedInterceptorBeans.add( interceptorBean );
+            }
         }
 
         // Instantiate the interceptors now
@@ -169,7 +173,7 @@ public class ConfigBuilder
      */
     public static PasswordPolicyConfiguration createPwdPolicyConfig( PasswordPolicyBean passwordPolicyBean
)
     {
-        if ( passwordPolicyBean == null )
+        if ( ( passwordPolicyBean == null ) || passwordPolicyBean.isDisabled() )
         {
             return null;
         }
@@ -209,6 +213,11 @@ public class ConfigBuilder
      */
     public static ChangeLog createChangeLog( ChangeLogBean changeLogBean )
     {
+        if ( ( changeLogBean == null ) || changeLogBean.isDisabled() )
+        {
+            return null;
+        }
+        
         ChangeLog changeLog = new DefaultChangeLog();
         
         changeLog.setEnabled( changeLogBean.isEnabled() );
@@ -226,6 +235,11 @@ public class ConfigBuilder
      */
     public static Journal createJournal( JournalBean journalBean )
     {
+        if ( ( journalBean == null ) || journalBean.isDisabled() )
+        {
+            return null;
+        }
+        
         Journal journal = new DefaultJournal();
 
         journal.setRotation( journalBean.getJournalRotation() );
@@ -326,6 +340,11 @@ public class ConfigBuilder
      */
     public static MechanismHandler createSaslMechHandler( SaslMechHandlerBean saslMechHandlerBean
) throws ConfigurationException
     {
+        if ( ( saslMechHandlerBean == null ) || saslMechHandlerBean.isDisabled() )
+        {
+            return null;
+        }
+        
         String mechClassName = saslMechHandlerBean.getSaslMechClassName();
         
         Class<?> mechClass = null;
@@ -378,6 +397,11 @@ public class ConfigBuilder
      */
     public static Transport createTransport( TransportBean transportBean )
     {
+        if ( ( transportBean == null ) || transportBean.isDisabled() )
+        {
+            return null;
+        }
+        
         Transport transport = null;
 
         if ( transportBean instanceof TcpTransportBean )
@@ -412,7 +436,10 @@ public class ConfigBuilder
         
         for ( TransportBean transportBean : transportBeans )
         {
-            transports[i++] = createTransport( transportBean );
+            if ( transportBean.isEnabled() )
+            {
+                transports[i++] = createTransport( transportBean );
+            }
         }
         
         return transports;
@@ -434,7 +461,7 @@ public class ConfigBuilder
         
         for ( String encryptionType : encryptionTypes )
         {
-            types[pos++] = EncryptionType.valueOf( encryptionType );
+            types[pos++] = EncryptionType.getByName( encryptionType );
         }
         
         return types;
@@ -450,7 +477,7 @@ public class ConfigBuilder
     public static NtpServer createNtpServer( NtpServerBean ntpServerBean, DirectoryService
directoryService ) throws LdapException
     {
         // Fist, do nothing if the NtpServer is disabled
-        if ( !ntpServerBean.isEnabled() )
+        if ( ( ntpServerBean == null ) || ntpServerBean.isDisabled() )
         {
             return null;
         }
@@ -506,7 +533,7 @@ public class ConfigBuilder
     public static KdcServer createKdcServer( KdcServerBean kdcServerBean, DirectoryService
directoryService ) throws LdapException
     {
         // Fist, do nothing if the KdcServer is disabled
-        if ( !kdcServerBean.isEnabled() )
+        if ( ( kdcServerBean == null ) || kdcServerBean.isDisabled() )
         {
             return null;
         }
@@ -593,6 +620,11 @@ public class ConfigBuilder
 
         for ( HttpWebAppBean httpWebAppBean : httpWebAppBeans )
         {
+            if ( httpWebAppBean.isDisabled() )
+            {
+                continue;
+            }
+            
             WebApp webApp = new WebApp();
             
             // HttpAppCtxPath
@@ -618,7 +650,7 @@ public class ConfigBuilder
     public static HttpServer createHttpServer( HttpServerBean httpServerBean, DirectoryService
directoryService ) throws LdapException
     {
         // Fist, do nothing if the HttpServer is disabled
-        if ( !httpServerBean.isEnabled() )
+        if ( ( httpServerBean == null ) || httpServerBean.isDisabled() )
         {
             return null;
         }
@@ -657,7 +689,7 @@ public class ConfigBuilder
     public static ChangePasswordServer createChangePasswordServer( ChangePasswordServerBean
changePasswordServerBean, DirectoryService directoryService ) throws LdapException
     {
         // Fist, do nothing if the LdapServer is disabled
-        if ( !changePasswordServerBean.isEnabled() )
+        if ( ( changePasswordServerBean == null ) || changePasswordServerBean.isDisabled()
)
         {
             return null;
         }
@@ -719,7 +751,7 @@ public class ConfigBuilder
     public static LdapServer createLdapServer( LdapServerBean ldapServerBean, DirectoryService
directoryService ) throws LdapException
     {
         // Fist, do nothing if the LdapServer is disabled
-        if ( !ldapServerBean.isEnabled() )
+        if ( ( ldapServerBean == null ) || ldapServerBean.isDisabled() )
         {
             return null;
         }
@@ -844,6 +876,11 @@ public class ConfigBuilder
      */
     public static JdbmIndex<?, Entry> createJdbmIndex( JdbmPartition partition, JdbmIndexBean<String,
Entry> jdbmIndexBean, DirectoryService directoryService )
     {
+        if ( ( jdbmIndexBean == null ) || jdbmIndexBean.isDisabled() )
+        {
+            return null;
+        }
+        
         JdbmIndex<String, Entry> index = new JdbmIndex<String, Entry>();
         
         index.setAttributeId( jdbmIndexBean.getIndexAttributeId() );
@@ -894,7 +931,7 @@ public class ConfigBuilder
 
         for ( IndexBean indexBean : indexesBeans )
         {
-            if ( indexBean instanceof JdbmIndexBean )
+            if ( indexBean.isEnabled() && ( indexBean instanceof JdbmIndexBean )
)
             {
                 indexes.add( createJdbmIndex( partition, (JdbmIndexBean)indexBean, directoryService
) );
             }
@@ -914,6 +951,11 @@ public class ConfigBuilder
      */
     public static JdbmPartition createJdbmPartition( DirectoryService directoryService, JdbmPartitionBean
jdbmPartitionBean ) throws ConfigurationException
     {
+        if ( ( jdbmPartitionBean == null ) || jdbmPartitionBean.isDisabled() )
+        {
+            return null;
+        }
+        
         JdbmPartition jdbmPartition = new JdbmPartition();
         
         jdbmPartition.setCacheSize( jdbmPartitionBean.getPartitionCacheSize() );
@@ -975,6 +1017,11 @@ public class ConfigBuilder
      */
     public static Partition createPartition( DirectoryService directoryService, PartitionBean
partitionBean ) throws ConfigurationException
     {
+        if ( ( partitionBean == null ) || partitionBean.isDisabled() )
+        {
+            return null;
+        }
+        
         if ( partitionBean instanceof JdbmPartitionBean )
         {
             return createJdbmPartition( directoryService, (JdbmPartitionBean)partitionBean
);
@@ -998,6 +1045,11 @@ public class ConfigBuilder
         
         for ( PartitionBean partitionBean : partitionBeans )
         {
+            if ( partitionBean.isDisabled() )
+            {
+                continue;
+            }
+            
             Partition partition = createPartition( directoryService, partitionBean );
             
             if ( partition != null )
@@ -1060,13 +1112,31 @@ public class ConfigBuilder
         directoryService.setAllowAnonymousAccess( directoryServiceBean.isDsAllowAnonymousAccess()
);
         
         // ChangeLog
-        directoryService.setChangeLog( createChangeLog( directoryServiceBean.getChangeLog()
) );
+        ChangeLog cl = createChangeLog( directoryServiceBean.getChangeLog() );
+        if ( cl != null )
+        {
+            directoryService.setChangeLog( cl );
+        }
         
         // DenormalizedOpAttrsEnabled
         directoryService.setDenormalizeOpAttrsEnabled( directoryServiceBean.isDsDenormalizeOpAttrsEnabled()
);
         
         // Journal
-        directoryService.setJournal( createJournal( directoryServiceBean.getJournal() ) );
+        Journal jl = createJournal( directoryServiceBean.getJournal() );
+        if ( jl != null )
+        {
+            directoryService.setJournal( jl );
+        }
+        
+        // password policy
+        // TODO add support for reading multiple policies from the config
+        PasswordPolicyConfiguration pPolicyConfig = createPwdPolicyConfig( directoryServiceBean.getPasswordPolicy()
);
+        if ( pPolicyConfig != null )
+        {
+            PpolicyConfigContainer pPolicies = new  PpolicyConfigContainer();
+            pPolicies.setDefaultPolicy( pPolicyConfig );
+            directoryService.setPwdPolicies( pPolicies );
+        }
         
         // MaxPDUSize
         directoryService.setMaxPDUSize( directoryServiceBean.getDsMaxPDUSize() );

Propchange: directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  2 09:30:16 2010
@@ -5,3 +5,4 @@
 /directory/apacheds/branches/apacheds-schema/core-annotations/src/main/java/org/apache/directory/server/core/factory/ConfigPartitionReader.java:806623-896441
 /directory/apacheds/branches/apacheds-subtree/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:965203-965686
 /directory/apacheds/branches/xdbm-refactoring/default-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:945827-946347
+/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java:1029696-1029972

Modified: directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java?rev=1029978&r1=1029977&r2=1029978&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
(original)
+++ directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/AdsBaseBean.java
Tue Nov  2 09:30:16 2010
@@ -137,6 +137,16 @@ public abstract class AdsBaseBean 
         }
     }
     
+    /**
+     * a convenient method to finding if this bean was disabled in the config
+     * 
+     * @return true if the bean was disabled, false otherwise
+     */
+    public final boolean isDisabled()
+    {
+        return !enabled;
+    }
+    
     
     /**
      * Formated print of a long

Modified: directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java?rev=1029978&r1=1029977&r2=1029978&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
(original)
+++ directory/apacheds/branches/server-config-indexbean-experiment/src/main/java/org/apache/directory/server/config/beans/DirectoryServiceBean.java
Tue Nov  2 09:30:16 2010
@@ -50,7 +50,7 @@ public class DirectoryServiceBean extend
     private int dsMaxPDUSize = 2048;
 
     /** The flag that tells if the password should be returned as a normal attribute or not
*/
-    private boolean dsPasswordHidden = true;
+    private boolean dsPasswordHidden = false;
 
     /** The delay between two flushes on disk */
     private long dsSyncPeriodMillis = 15000L;

Propchange: directory/apacheds/branches/server-config-indexbean-experiment/src/main/resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  2 09:30:16 2010
@@ -8,3 +8,4 @@
 /directory/apacheds/branches/apacheds-schema/default-config/src/main/resources:806623-896441
 /directory/apacheds/branches/apacheds-subtree/server-config/src/main/resources:965203-965686
 /directory/apacheds/branches/xdbm-refactoring/default-config/src/main/resources:945827-946347
+/directory/apacheds/trunk/server-config/src/main/resources:1029696-1029972

Modified: directory/apacheds/branches/server-config-indexbean-experiment/src/main/resources/config.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/server-config-indexbean-experiment/src/main/resources/config.ldif?rev=1029978&r1=1029977&r2=1029978&view=diff
==============================================================================
--- directory/apacheds/branches/server-config-indexbean-experiment/src/main/resources/config.ldif
(original)
+++ directory/apacheds/branches/server-config-indexbean-experiment/src/main/resources/config.ldif
Tue Nov  2 09:30:16 2010
@@ -35,10 +35,10 @@ ads-interceptors: collectiveAttributeInt
 ads-interceptors: defaultAuthorizationInterceptor
 ads-interceptors: eventInterceptor
 ads-interceptors: exceptionInterceptor
-ads-interceptors: keyderivationinterceptor
+ads-interceptors: keyDerivationInterceptor
 ads-interceptors: normalizationInterceptor
 ads-interceptors: operationalAttributeInterceptor
-ads-interceptors: passwordpolicyinterceptor
+ads-interceptors: passwordHashingInterceptor
 ads-interceptors: referralInterceptor
 ads-interceptors: schemaInterceptor
 ads-interceptors: subentryInterceptor
@@ -122,14 +122,14 @@ ads-interceptorclassname: org.apache.dir
 ads-interceptorid: exceptionInterceptor
 ads-enabled: true
 
-dn: ads-interceptorId=keyderivationinterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
+dn: ads-interceptorId=keyDerivationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
 objectclass: top
 objectclass: ads-base
 objectclass: ads-interceptor
 ads-enabled: false
-ads-interceptororder: 9
+ads-interceptororder: 8
 ads-interceptorclassname: org.apache.directory.server.core.kerberos.KeyDerivationInterceptor
-ads-interceptorid: keyderivationinterceptor
+ads-interceptorid: keyDerivationInterceptor
 
 dn: ads-interceptorId=normalizationInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
 objectclass: top
@@ -149,14 +149,14 @@ ads-interceptorclassname: org.apache.dir
 ads-interceptorid: operationalAttributeInterceptor
 ads-enabled: true
 
-dn: ads-interceptorId=passwordpolicyinterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
+dn: ads-interceptorId=passwordHashingInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
 objectclass: top
 objectclass: ads-base
 objectclass: ads-interceptor
-ads-enabled: false
-ads-interceptororder: 8
-ads-interceptorclassname: org.apache.directory.server.core.kerberos.PasswordPolicyInterceptor
-ads-interceptorid: passwordpolicyinterceptor
+ads-enabled: true
+ads-interceptororder: 9
+ads-interceptorclassname: org.apache.directory.server.core.hash.SshaPasswordHashingInterceptor
+ads-interceptorid: passwordHashingInterceptor
 
 dn: ads-interceptorId=referralInterceptor,ou=interceptors,ads-directoryServiceId=default,ou=config
 objectclass: top
@@ -198,7 +198,7 @@ dn: ads-pwdId=pwdPolicy,ads-directorySer
 objectClass: top
 objectClass: ads-base
 objectClass: ads-passwordPolicy
-ads-pwdId: pwdpolicy
+ads-pwdId: pwdPolicy
 ads-pwdSafeModify: FALSE
 ads-pwdMaxAge: 0
 ads-pwdFailureCountInterval: 30
@@ -548,6 +548,7 @@ ads-krbPostdatedAllowed: true
 ads-krbPrimaryRealm: EXAMPLE.COM
 ads-krbProxiableAllowed: true
 ads-krbRenewableAllowed: true
+ads-searchBaseDN: ou=users,dc=example,dc=com
 
 dn: ou=transports,ads-serverId=kerberos,ou=servers,ads-directoryServiceId=default,ou=config
 ou: transports
@@ -569,7 +570,7 @@ dn: ads-transportid=udp,ou=transports,ad
 ads-systemport: 60088
 ads-transportbacklog: 50
 ads-transportnbthreads: 4
-ads-transportaddress: localhost
+ads-transportaddress: 0.0.0.0
 ads-transportid: udp
 objectclass: ads-transport
 objectclass: ads-udpTransport
@@ -613,7 +614,7 @@ ads-enabled: true
 dn: ads-transportid=ldaps,ou=transports,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
 ads-systemport: 10636
 ads-transportenablessl: true
-ads-transportaddress: localhost
+ads-transportaddress: 0.0.0.0
 ads-transportid: ldaps
 objectclass: ads-transport
 objectclass: ads-tcpTransport

Propchange: directory/apacheds/branches/server-config-indexbean-experiment/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov  2 09:30:16 2010
@@ -7,3 +7,4 @@
 /directory/apacheds/branches/apacheds-subtree/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java:965203-965686
 /directory/apacheds/branches/cidit/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java:900288-900681
 /directory/apacheds/branches/xdbm-refactoring/default-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java:945827-946347
+/directory/apacheds/trunk/server-config/src/test/java/org/apache/directory/server/config/ConfigPartitionReaderTest.java:1029696-1029972



Mime
View raw message