directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1026605 - in /directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config: ConfigPartitionReader.java beans/LdapServerBean.java beans/PasswordPolicyBean.java
Date Sat, 23 Oct 2010 11:43:39 GMT
Author: elecharny
Date: Sat Oct 23 11:43:39 2010
New Revision: 1026605

URL: http://svn.apache.org/viewvc?rev=1026605&view=rev
Log:
Made the reader process the PasswordPolicy

Modified:
    directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
    directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
    directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java?rev=1026605&r1=1026604&r2=1026605&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
(original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigPartitionReader.java
Sat Oct 23 11:43:39 2010
@@ -843,12 +843,21 @@ public class ConfigPartitionReader
                 // First, check if it's a SingleValued element
                 if ( beanAT.isSingleValued() )
                 {
-                    // Yes : get the frist element if it's mandatory
-                    if ( mandatory )
-                    {
-                        DN newBase = entry.getDn().add( "ou=" + beanFieldName );
-                        List<AdsBaseBean> beans = read( newBase, fieldName, SearchScope.ONELEVEL,
mandatory );
+                    // Yes : get the first element if it's mandatory
+                    //DN newBase = entry.getDn().add( "ou=" + beanFieldName );
+                    List<AdsBaseBean> beans = read( entry.getDn(), fieldName, SearchScope.ONELEVEL,
mandatory );
 
+                    if ( ( beans == null ) || ( beans.size() == 0 ) )
+                    {
+                        if ( mandatory )
+                        {
+                            // This is an error !
+                            System.out.println( "ERROR !!!" );
+                            throw new Exception();
+                        }
+                    }
+                    else
+                    { 
                         AdsBaseBean readBean = beans.get( 0 );
                         
                         beanField.set( bean, readBean );

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java?rev=1026605&r1=1026604&r2=1026605&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
(original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
Sat Oct 23 11:43:39 2010
@@ -59,6 +59,9 @@ public class LdapServerBean extends DSBa
     /** tells if the replication is enabled */
     private boolean enablereplprovider; 
     
+    /** The PasswordPolicy component */
+    private PasswordPolicyBean passwordpolicy;
+
     private int replconsumer;
     private int replprovider;
     
@@ -330,7 +333,25 @@ public class LdapServerBean extends DSBa
             this.extendedophandlers.add( extendedOp );
         }
     }
-    
+
+
+    /**
+     * @return the pwdPolicy
+     */
+    public PasswordPolicyBean getPwdPolicy()
+    {
+        return passwordpolicy;
+    }
+
+
+    /**
+     * @param pwdPolicy the pwdPolicy to set
+     */
+    public void setPwdPolicy( PasswordPolicyBean pwdPolicy )
+    {
+        this.passwordpolicy = pwdPolicy;
+    }
+
     
     /**
      * {@inheritDoc}
@@ -379,7 +400,12 @@ public class LdapServerBean extends DSBa
                 sb.append( tabs ).append( "    " ).append( saslRealm ).append( "\n" );
             }
         }
-
+        
+        if ( passwordpolicy != null )
+        {
+            sb.append( tabs ).append( passwordpolicy.toString( tabs + "  " ) );
+        }
+        
         return sb.toString();
     }
     

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java?rev=1026605&r1=1026604&r2=1026605&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java
(original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/PasswordPolicyBean.java
Sat Oct 23 11:43:39 2010
@@ -32,6 +32,11 @@ import org.apache.directory.shared.ldap.
  */
 public class PasswordPolicyBean extends AdsBaseBean
 {
+    /**
+     * The PasswordPolicy unique identifier
+     */
+    private String pwdid;
+    
     /** the name of the attribute to which the password policy is applied. 
      * Currently only "userPassword" attribute is supported
      */
@@ -391,6 +396,24 @@ public class PasswordPolicyBean extends 
 
 
     /**
+     * @return the pwdId
+     */
+    public String getPwdId()
+    {
+        return pwdid;
+    }
+
+
+    /**
+     * @param pwdId the pwdId to set
+     */
+    public void setPwdId( String pwdId )
+    {
+        this.pwdid = pwdId;
+    }
+
+
+    /**
      * {@inheritDoc}
      */
     public String toString( String tabs )
@@ -399,26 +422,27 @@ public class PasswordPolicyBean extends 
         
         sb.append( tabs ).append( "PasswordPolicy :\n" );
         sb.append( super.toString( tabs + "  " ) );
-        sb.append( toString( tabs, "password attribute", pwdattribute ) );
-        sb.append( tabs ).append( "password min age : " ).append( pwdminage ).append( '\n'
);
-        sb.append( tabs ).append( "password max age : " ).append( pwdmaxage ).append( '\n'
);
-        sb.append( tabs ).append( "password min length : " ).append( pwdminlength ).append(
'\n' );
-        sb.append( tabs ).append( "password max length : " ).append( pwdmaxlength ).append(
'\n' );
-        sb.append( tabs ).append( "password min delay : " ).append( pwdmindelay ).append(
'\n' );
-        sb.append( tabs ).append( "password max delay : " ).append( pwdmaxdelay ).append(
'\n' );
-        sb.append( tabs ).append( "password max idle : " ).append( pwdmaxidle ).append( '\n'
);
-        sb.append( tabs ).append( "password max failure : " ).append( pwdmaxfailure ).append(
'\n' );
-        sb.append( tabs ).append( "password lockout duration : " ).append( pwdlockoutduration
).append( '\n' );
-        sb.append( tabs ).append( "password expire warning : " ).append( pwdexpirewarning
).append( '\n' );
-        sb.append( tabs ).append( "password grace expire : " ).append( pwdgraceexpire ).append(
'\n' );
-        sb.append( tabs ).append( "password grace Auth N limit : " ).append( pwdgraceauthnlimit
).append( '\n' );
-        sb.append( tabs ).append( "password in history : " ).append( pwdinhistory ).append(
'\n' );
-        sb.append( tabs ).append( "password check quality : " ).append( pwdcheckquality ).append(
'\n' );
-        sb.append( tabs ).append( "password failure count interval : " ).append( pwdfailurecountinterval
).append( '\n' );
-        sb.append( toStringBoolean( "password lockout", "", pwdlockout ) );
-        sb.append( toStringBoolean( "password must change", "", pwdmustchange ) );
-        sb.append( toStringBoolean( "password allow user change", "", pwdallowuserchange
) );
-        sb.append( toStringBoolean( "password safe modify", "", pwdsafemodify ) );
+        sb.append( tabs ).append( "  identifier : " ).append( pwdid ).append( '\n' );
+        sb.append( toString( tabs, "  password attribute", pwdattribute ) );
+        sb.append( tabs ).append( "  password min age : " ).append( pwdminage ).append( '\n'
);
+        sb.append( tabs ).append( "  password max age : " ).append( pwdmaxage ).append( '\n'
);
+        sb.append( tabs ).append( "  password min length : " ).append( pwdminlength ).append(
'\n' );
+        sb.append( tabs ).append( "  password max length : " ).append( pwdmaxlength ).append(
'\n' );
+        sb.append( tabs ).append( "  password min delay : " ).append( pwdmindelay ).append(
'\n' );
+        sb.append( tabs ).append( "  password max delay : " ).append( pwdmaxdelay ).append(
'\n' );
+        sb.append( tabs ).append( "  password max idle : " ).append( pwdmaxidle ).append(
'\n' );
+        sb.append( tabs ).append( "  password max failure : " ).append( pwdmaxfailure ).append(
'\n' );
+        sb.append( tabs ).append( "  password lockout duration : " ).append( pwdlockoutduration
).append( '\n' );
+        sb.append( tabs ).append( "  password expire warning : " ).append( pwdexpirewarning
).append( '\n' );
+        sb.append( tabs ).append( "  password grace expire : " ).append( pwdgraceexpire ).append(
'\n' );
+        sb.append( tabs ).append( "  password grace Auth N limit : " ).append( pwdgraceauthnlimit
).append( '\n' );
+        sb.append( tabs ).append( "  password in history : " ).append( pwdinhistory ).append(
'\n' );
+        sb.append( tabs ).append( "  password check quality : " ).append( pwdcheckquality
).append( '\n' );
+        sb.append( tabs ).append( "  password failure count interval : " ).append( pwdfailurecountinterval
).append( '\n' );
+        sb.append( toStringBoolean( tabs, "  password lockout", pwdlockout ) );
+        sb.append( toStringBoolean( tabs, "  password must change", pwdmustchange ) );
+        sb.append( toStringBoolean( tabs, "  password allow user change", pwdallowuserchange
) );
+        sb.append( toStringBoolean( tabs, "  password safe modify", pwdsafemodify ) );
 
         return sb.toString();
     }



Mime
View raw message