directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1026616 - in /directory/apacheds/branches/apacheds-config/server-config/src: main/java/org/apache/directory/server/config/beans/ test/resources/
Date Sat, 23 Oct 2010 13:42:59 GMT
Author: elecharny
Date: Sat Oct 23 13:42:59 2010
New Revision: 1026616

URL: http://svn.apache.org/viewvc?rev=1026616&view=rev
Log:
Added the code and test for replication consumer. Works fine.

Modified:
    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/ReplConsumerBean.java
    directory/apacheds/branches/apacheds-config/server-config/src/test/resources/ldapserver.ldif

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=1026616&r1=1026615&r2=1026616&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 13:42:59 2010
@@ -62,7 +62,9 @@ public class LdapServerBean extends DSBa
     /** The PasswordPolicy component */
     private PasswordPolicyBean passwordpolicy;
 
-    private int replconsumer;
+    /** The replication consumer Bean */
+    private ReplConsumerBean replconsumer;
+    
     private int replprovider;
     
     /** The list of supported mechanisms */
@@ -352,6 +354,24 @@ public class LdapServerBean extends DSBa
         this.passwordpolicy = pwdPolicy;
     }
 
+
+    /**
+     * @return the Replication Consumer Bean
+     */
+    public ReplConsumerBean getReplconsumer()
+    {
+        return replconsumer;
+    }
+
+
+    /**
+     * @param replconsumer the Replication Consumer Bean to set
+     */
+    public void setReplconsumer( ReplConsumerBean replconsumer )
+    {
+        this.replconsumer = replconsumer;
+    }
+
     
     /**
      * {@inheritDoc}
@@ -406,6 +426,11 @@ public class LdapServerBean extends DSBa
             sb.append( tabs ).append( passwordpolicy.toString( tabs + "  " ) );
         }
         
+        if ( replconsumer != null )
+        {
+            sb.append( tabs ).append( replconsumer.toString( tabs + "  " ) );
+        }
+        
         return sb.toString();
     }
     

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java?rev=1026616&r1=1026615&r2=1026616&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
(original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
Sat Oct 23 13:42:59 2010
@@ -30,17 +30,32 @@ public class ReplConsumerBean extends Ad
     /** The replicaConsumer unique ID */
     private String dsreplicaid;
     
-    /*
-    m-must: ads-replAliasDerefMode;
-    private String searchBaseDN;
-    private String replLastSentCsn;
-    m-must: ads-replSearchScope;
-    private String replSearchFilter;
-    m-may: ads-replRefreshNPersist;
-    m-may: ads-replUseTls;
-    m-may: ads-replStrictCertValidation;
-    m-may: ads-replPeerCertificate;
-    */
+    /** The Alias Dereferencing mode */
+    private String replaliasderefmode;
+    
+    /** The Search Base DN */
+    private String searchbasedn;
+    
+    /** The last CSN sent */
+    private String repllastsentcsn;
+    
+    /** The search scope */
+    private String replsearchscope;
+    
+    /** The replication search filter */
+    private String replsearchfilter;
+    
+    /** Tells if we should persist */
+    private boolean replrefreshnpersist;
+    
+    /** Tells if TLS should be used during replication */
+    private boolean replusetls;
+    
+    /** Tells if the certificate validation should be strict or not */
+    private boolean replstrictcertvalidation;
+    
+    /** The peer certificate */
+    private String replpeercertificate;
 
     /**
      * Create a new Replication Consumer instance
@@ -52,4 +67,219 @@ public class ReplConsumerBean extends Ad
         // Enabled by default
         setEnabled( true );
     }
+
+    
+    /**
+     * @return the dsreplicaid
+     */
+    public String getDsreplicaid()
+    {
+        return dsreplicaid;
+    }
+
+    
+    /**
+     * @param dsreplicaid the dsreplicaid to set
+     */
+    public void setDsreplicaid( String dsreplicaid )
+    {
+        this.dsreplicaid = dsreplicaid;
+    }
+
+    
+    /**
+     * @return the replAliasDerefMode
+     */
+    public String getReplAliasDerefMode()
+    {
+        return replaliasderefmode;
+    }
+
+    
+    /**
+     * @param replAliasDerefMode the replAliasDerefMode to set
+     */
+    public void setReplAliasDerefMode( String replAliasDerefMode )
+    {
+        this.replaliasderefmode = replAliasDerefMode;
+    }
+
+    
+    /**
+     * @return the searchBaseDN
+     */
+    public String getSearchBaseDN()
+    {
+        return searchbasedn;
+    }
+
+    
+    /**
+     * @param searchBaseDN the searchBaseDN to set
+     */
+    public void setSearchBaseDN( String searchBaseDN )
+    {
+        this.searchbasedn = searchBaseDN;
+    }
+
+    
+    /**
+     * @return the replLastSentCsn
+     */
+    public String getReplLastSentCsn()
+    {
+        return repllastsentcsn;
+    }
+
+    
+    /**
+     * @param replLastSentCsn the replLastSentCsn to set
+     */
+    public void setReplLastSentCsn( String replLastSentCsn )
+    {
+        this.repllastsentcsn = replLastSentCsn;
+    }
+
+    
+    /**
+     * @return the replSearchScope
+     */
+    public String getReplSearchScope()
+    {
+        return replsearchscope;
+    }
+
+    
+    /**
+     * @param replSearchScope the replSearchScope to set
+     */
+    public void setReplSearchScope( String replSearchScope )
+    {
+        this.replsearchscope = replSearchScope;
+    }
+
+    
+    /**
+     * @return the replSearchFilter
+     */
+    public String getReplSearchFilter()
+    {
+        return replsearchfilter;
+    }
+
+    
+    /**
+     * @param replSearchFilter the replSearchFilter to set
+     */
+    public void setReplSearchFilter( String replSearchFilter )
+    {
+        this.replsearchfilter = replSearchFilter;
+    }
+
+    
+    /**
+     * @return the replRefreshNPersist
+     */
+    public boolean isReplRefreshNPersist()
+    {
+        return replrefreshnpersist;
+    }
+
+    
+    /**
+     * @param replRefreshNPersist the replRefreshNPersist to set
+     */
+    public void setReplRefreshNPersist( boolean replRefreshNPersist )
+    {
+        this.replrefreshnpersist = replRefreshNPersist;
+    }
+
+    
+    /**
+     * @return the replUseTls
+     */
+    public boolean isReplUseTls()
+    {
+        return replusetls;
+    }
+
+    
+    /**
+     * @param replUseTls the replUseTls to set
+     */
+    public void setReplUseTls( boolean replUseTls )
+    {
+        this.replusetls = replUseTls;
+    }
+
+    
+    /**
+     * @return the replStrictCertValidation
+     */
+    public boolean isReplStrictCertValidation()
+    {
+        return replstrictcertvalidation;
+    }
+
+    
+    /**
+     * @param replStrictCertValidation the replStrictCertValidation to set
+     */
+    public void setReplStrictCertValidation( boolean replStrictCertValidation )
+    {
+        this.replstrictcertvalidation = replStrictCertValidation;
+    }
+
+    
+    /**
+     * @return the replPeerCertificate
+     */
+    public String getReplPeerCertificate()
+    {
+        return replpeercertificate;
+    }
+
+    
+    /**
+     * @param replPeerCertificate the replPeerCertificate to set
+     */
+    public void setReplPeerCertificate( String replPeerCertificate )
+    {
+        this.replpeercertificate = replPeerCertificate;
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString( String tabs )
+    {
+        StringBuilder sb = new StringBuilder();
+        
+        sb.append( tabs ).append( "replication consumer :\n" );
+        sb.append( super.toString( tabs + "  " ) );
+
+        sb.append( tabs ).append( "  replica ID : " ).append( dsreplicaid ).append( '\n'
);
+        sb.append( tabs ).append( "  last sent CSN : " ).append( repllastsentcsn ).append(
'\n' );
+        sb.append( tabs ).append( "  search base DN : " ).append( searchbasedn ).append(
'\n' );
+        sb.append( tabs ).append( "  search filter : " ).append( replsearchfilter ).append(
'\n' );
+        sb.append( tabs ).append( "  search scope : " ).append( replsearchscope ).append(
'\n' );
+        sb.append( tabs ).append( "  alias dereferencing mode : " ).append( replaliasderefmode
).append( '\n' );
+
+        sb.append( toString( tabs, "  peer certificate", replpeercertificate ) );
+        sb.append( toStringBoolean( tabs, "  refresh and persist mode", replrefreshnpersist
) );
+        sb.append( toStringBoolean( tabs, "  struct certivicate validation", replstrictcertvalidation
) );
+        sb.append( toStringBoolean( tabs, "  use TLS", replusetls ) );
+
+        return sb.toString();
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String toString()
+    {
+        return toString( "" );
+    }
 }

Modified: directory/apacheds/branches/apacheds-config/server-config/src/test/resources/ldapserver.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/test/resources/ldapserver.ldif?rev=1026616&r1=1026615&r2=1026616&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/test/resources/ldapserver.ldif
(original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/test/resources/ldapserver.ldif
Sat Oct 23 13:42:59 2010
@@ -62,7 +62,6 @@ ads-certificatePassword: secret
 ads-searchBaseDN: ou=users,ou=system
 ads-enabled: true
 ads-enableReplProvider: false
-ads-replProvider: 
 
 dn: ou=transports,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
 ou: transports
@@ -166,8 +165,43 @@ objectclass: top
 ads-saslMechName: SIMPLE
 ads-enabled: true
 
-dn: ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
-objectclass: ads-server
-objectclass: ads-ldapServer
-objectclass: ads-dsBasedServer
+dn: ads-pwdId=test,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
 objectclass: top
+objectclass: ads-base
+objectclass: ads-passwordPolicy
+ads-pwdId: test
+ads-pwdAttribute: userPassword
+ads-pwdMinAge: 100
+ads-pwdMaxAge: 200
+ads-pwdInHistory: 5
+ads-pwdCheckQuality: 2
+ads-pwdMinLength: 5
+ads-pwdMaxLength: 32
+ads-pwdExpireWarning: 100
+ads-pwdGraceAuthNLimit: 50
+ads-pwdGraceExpire: 20
+ads-pwdLockout: TRUE
+ads-pwdLockoutDuration: 20
+ads-pwdMaxFailure: 3
+ads-pwdFailureCountInterval: 5
+ads-pwdMustChange: TRUE
+ads-pwdAllowUserChange: TRUE
+ads-pwdSafeModify: FALSE
+ads-pwdMinDelay: 20
+ads-pwdMaxDelay: 200
+ads-pwdMaxIdle: 100
+
+dn: ads-dsReplicaId=test,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
+objectclass: top
+objectclass: ads-base
+objectclass: ads-replConsumer
+ads-dsReplicaId: test
+ads-replAliasDerefMode: NEVER_DEREF
+ads-searchBaseDN: ads-directoryServiceId=default,ou=config
+ads-replLastSentCsn: 20100509111949.005000Z#000000#000#000000
+ads-replSearchScope: SUBTREE
+ads-replSearchFilter: (&(objectClass=top)(ou=test))
+ads-replRefreshNPersist: TRUE
+ads-replUseTls: TRUE
+ads-replStrictCertValidation: TRUE
+ads-replPeerCertificate: ABCD



Mime
View raw message