directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1132991 - in /directory: apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ apacheds/trunk/server-config/src/main/java/org...
Date Tue, 07 Jun 2011 13:01:58 GMT
Author: kayyagari
Date: Tue Jun  7 13:01:58 2011
New Revision: 1132991

URL: http://svn.apache.org/viewvc?rev=1132991&view=rev
Log:
o cleaned up the consfusing parts of syncrepl configuration
 ( renamed the 'ads-replConsumer' OC to 'ads-replEventLog' renamed the
  'ads-replProvider' OC to 'ads-replConsumer' and updated the allowed attributes)
o updated the code and test resources accordingly

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/ConfigSchemaConstants.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
    directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
    directory/apacheds/trunk/server-config/src/test/resources/ldapServer.ldif
    directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java
    directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
    directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.828.ldif
    directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif
    directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.806.ldif

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/ReplicaDitStoreUtil.java
Tue Jun  7 13:01:58 2011
@@ -104,16 +104,15 @@ public class ReplicaDitStoreUtil
         }
 
         Entry entry = new DefaultEntry( schemaManager );
-        //FIXME change the value of ads-replConsumerId to a unique value
-        entry.setDn( new Dn( schemaManager, "ads-replConsumerId=" + replica.getId() + ","
+ REPL_CONSUMER_DN ) );
+        entry.setDn( new Dn( schemaManager, "ads-dsReplicaId=" + replica.getId() + "," +
REPL_CONSUMER_DN ) );
 
-        entry.add( SchemaConstants.OBJECT_CLASS_AT, "ads-replConsumer" );
+        entry.add( SchemaConstants.OBJECT_CLASS_AT, "ads-replEventLog" );
         entry.add( "ads-dsReplicaId", String.valueOf( replica.getId() ) );
-        entry.add( "ads-replConsumerId", String.valueOf( replica.getId() ) );
         entry.add( "ads-replAliasDerefMode", replica.getSearchCriteria().getAliasDerefMode().getJndiValue()
);
         entry.add( "ads-searchBaseDN", replica.getSearchCriteria().getBase().getName() );
         entry.add( "ads-replLastSentCsn", replica.getLastSentCsn() );
         entry.add( "ads-replSearchScope", replica.getSearchCriteria().getScope().getLdapUrlValue()
);
+        entry.add( "ads-replRefreshNPersist", String.valueOf( replica.isRefreshNPersist()
) );
         entry.add( "ads-replSearchFilter", replica.getSearchFilter() );
 
         adminSession.add( entry );
@@ -146,17 +145,17 @@ public class ReplicaDitStoreUtil
             lastSentCsnAt.add( replica.getLastSentCsn() );
         }
 
-        Dn dn = new Dn( schemaManager, "ads-replConsumerId=" + replica.getId() + "," + REPL_CONSUMER_DN
);
+        Dn dn = new Dn( schemaManager, "ads-dsReplicaId=" + replica.getId() + "," + REPL_CONSUMER_DN
);
         adminSession.modify( dn, mods );
         LOG.debug( "updated last sent CSN of consumer entry {}", dn );
     }
 
 
-    public List<ReplicaEventLog> getReplicaConsumers() throws Exception
+    public List<ReplicaEventLog> getReplicaEventLogs() throws Exception
     {
         List<ReplicaEventLog> replicas = new ArrayList<ReplicaEventLog>();
 
-        EntryCursor cursor = coreConnection.search( REPL_CONSUMER_DN, "(objectClass=ads-replConsumer)",
+        EntryCursor cursor = coreConnection.search( REPL_CONSUMER_DN, "(objectClass=ads-replEventLog)",
             SearchScope.ONELEVEL, "+", "*" );
 
         while ( cursor.next() )
@@ -174,7 +173,7 @@ public class ReplicaDitStoreUtil
 
     private ReplicaEventLog convertEntryToReplica( Entry entry ) throws Exception
     {
-        String id = entry.get( "ads-replConsumerId" ).getString();
+        String id = entry.get( "ads-dsReplicaId" ).getString();
         ReplicaEventLog replica = new ReplicaEventLog( Integer.parseInt( id ) );
 
         NotificationCriteria searchCriteria = new NotificationCriteria();
@@ -185,8 +184,11 @@ public class ReplicaDitStoreUtil
         String baseDn = entry.get( "ads-searchBaseDN" ).getString();
         searchCriteria.setBase( new Dn( schemaManager, baseDn ) );
 
-        String lastSentCsn = entry.get( "ads-replLastSentCsn" ).getString();
-        replica.setLastSentCsn( lastSentCsn );
+        Attribute lastSentCsnAt = entry.get( "ads-replLastSentCsn" );
+        if ( lastSentCsnAt != null )
+        {
+            replica.setLastSentCsn( lastSentCsnAt.getString() );
+        }
 
         String scope = entry.get( "ads-replSearchScope" ).getString();
         int scopeIntVal = SearchScope.getSearchScope( scope );
@@ -196,6 +198,8 @@ public class ReplicaDitStoreUtil
         searchCriteria.setFilter( filter );
         replica.setSearchFilter( filter );
 
+        replica.setRefreshNPersist( Boolean.parseBoolean( entry.get( "ads-replRefreshNPersist"
).getString() ) );
+        
         searchCriteria.setEventMask( EventType.ALL_EVENT_TYPES_MASK );
         replica.setSearchCriteria( searchCriteria );
 

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplRequestHandler.java
Tue Jun  7 13:01:58 2011
@@ -857,10 +857,10 @@ public class SyncReplRequestHandler impl
         try
         {
 
-            List<ReplicaEventLog> replicas = replicaUtil.getReplicaConsumers();
-            if ( !replicas.isEmpty() )
+            List<ReplicaEventLog> eventLogs = replicaUtil.getReplicaEventLogs();
+            if ( !eventLogs.isEmpty() )
             {
-                for ( ReplicaEventLog r : replicas )
+                for ( ReplicaEventLog r : eventLogs )
                 {
                     LOG.debug( "initializing the replica log from {}", r.getId() );
                     r.configure( amqConnection, brokerService );

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=1132991&r1=1132990&r2=1132991&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
Tue Jun  7 13:01:58 2011
@@ -243,7 +243,7 @@ public enum ConfigSchemaConstants
     
     ADS_REPL_REFRESH_INTERVAL( "ads-replRefreshInterval", "" ),
     
-    ADS_REPL_ATTRIBUTE( "ads-replAttribute", "" ),
+    ADS_REPL_ATTRIBUTE( "ads-replAttributes", "" ),
     
     ADS_REPL_SEARCH_SIZE_LIMIT( "ads-replSearchSizeLimit", "" ),
     

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
(original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/LdapServerBean.java
Tue Jun  7 13:01:58 2011
@@ -73,10 +73,6 @@ public class LdapServerBean extends DSBa
     @ConfigurationElement(attributeType = "ads-replConsumers", container = "replConsumers")
     private List<ReplConsumerBean> replConsumers = new ArrayList<ReplConsumerBean>();
 
-    /** The replication producer Bean */
-    @ConfigurationElement
-    private ReplProviderBean replProvider;
-
     /** The list of supported mechanisms */
     @ConfigurationElement(attributeType = "ads-saslMechHandlers", container = "saslMechHandlers")
     private List<SaslMechHandlerBean> saslMechHandlers = new ArrayList<SaslMechHandlerBean>();
@@ -361,25 +357,7 @@ public class LdapServerBean extends DSBa
             this.replConsumers.add( bean );
         }
     }
-
     
-    /**
-     * @return the replProvider
-     */
-    public ReplProviderBean getReplProvider()
-    {
-        return replProvider;
-    }
-
-
-    /**
-     * @param replProvider the replProvider to set
-     */
-    public void setReplProvider( ReplProviderBean replProvider )
-    {
-        this.replProvider = replProvider;
-    }
-
 
     /**
      * {@inheritDoc}
@@ -439,11 +417,6 @@ public class LdapServerBean extends DSBa
             }
         }
         
-        if ( replProvider != null )
-        {
-            sb.append( tabs ).append( replProvider.toString( tabs + "  " ) );
-        }
-
         return sb.toString();
     }
 

Modified: directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
(original)
+++ directory/apacheds/trunk/server-config/src/main/java/org/apache/directory/server/config/beans/ReplConsumerBean.java
Tue Jun  7 13:01:58 2011
@@ -20,8 +20,10 @@
 package org.apache.directory.server.config.beans;
 
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.directory.server.config.ConfigurationElement;
-import org.apache.directory.shared.ldap.model.name.Dn;
 
 
 /**
@@ -35,21 +37,33 @@ public class ReplConsumerBean extends Ad
     @ConfigurationElement(attributeType = "ads-replConsumerId", isRdn = true)
     private String replConsumerId;
 
-    /** The replication unique ID */
-    @ConfigurationElement(attributeType = "ads-dsReplicaId")
-    private String dsReplicaId;
+    /** The Search Base Dn */
+    @ConfigurationElement(attributeType = "ads-searchBaseDn")
+    private String searchBaseDn;
+
+    /** The replication provider host name */
+    @ConfigurationElement(attributeType = "ads-replProvHostName")
+    private String replProvHostName;
+
+    /** The replication provider port */
+    @ConfigurationElement(attributeType = "ads-replProvPort")
+    private int replProvPort;
 
     /** The Alias Dereferencing mode */
     @ConfigurationElement(attributeType = "ads-replAliasDerefMode")
     private String replAliasDerefMode;
 
-    /** The Search Base Dn */
-    @ConfigurationElement(attributeType = "ads-searchBaseDn")
-    private Dn searchBaseDn;
+    /** The replication provider attribute */
+    @ConfigurationElement(attributeType = "ads-replAttributes")
+    private List<String> replAttributes = new ArrayList<String>();
+
+    /** The refresh interval */
+    @ConfigurationElement(attributeType = "ads-replRefreshInterval")
+    private long replRefreshInterval;
 
-    /** The last CSN sent */
-    @ConfigurationElement(attributeType = "ads-replLastSentCsn")
-    private String replLastSentCsn;
+    /** Tells if we should persist */
+    @ConfigurationElement(attributeType = "ads-replRefreshNPersist")
+    private boolean replRefreshNPersist;
 
     /** The search scope */
     @ConfigurationElement(attributeType = "ads-replSearchScope")
@@ -59,9 +73,25 @@ public class ReplConsumerBean extends Ad
     @ConfigurationElement(attributeType = "ads-replSearchFilter")
     private String replSearchFilter;
 
-    /** Tells if we should persist */
-    @ConfigurationElement(attributeType = "ads-replRefreshNPersist")
-    private boolean replRefreshNPersist;
+    /** The search size limit */
+    @ConfigurationElement(attributeType = "ads-replSearchSizeLimit")
+    private int replSearchSizeLimit;
+
+    /** The search time limit */
+    @ConfigurationElement(attributeType = "ads-replSearchTimeout")
+    private int replSearchTimeout;
+
+    /** The replication user Dn */
+    @ConfigurationElement(attributeType = "ads-replUserDn")
+    private String replUserDn;
+
+    /** The replication user password */
+    @ConfigurationElement(attributeType = "ads-replUserPassword")
+    private byte[] replUserPassword;
+
+    /** The replication cookie */
+    @ConfigurationElement(attributeType = "ads-replCookie")
+    private String replCookie;
 
     /** Tells if TLS should be used during replication */
     @ConfigurationElement(attributeType = "ads-replUseTls")
@@ -73,7 +103,7 @@ public class ReplConsumerBean extends Ad
 
     /** The peer certificate */
     @ConfigurationElement(attributeType = "ads-replPeerCertificate")
-    private String replPeerCertificate;
+    private byte[] replPeerCertificate;
 
     /** The FQCN of replication client implementation */
     @ConfigurationElement(attributeType = "ads-replConsumerImpl")
@@ -101,7 +131,7 @@ public class ReplConsumerBean extends Ad
 
 
     /**
-     * @param replConsumerId the replConsumerId to set
+     * @param replConsumerId the replication consumer id to set
      */
     public void setReplConsumerId( String replConsumerId )
     {
@@ -110,20 +140,56 @@ public class ReplConsumerBean extends Ad
 
 
     /**
-     * @return the dsreplicaid
+     * @return the searchBaseDn
      */
-    public String getDsreplicaid()
+    public String getSearchBaseDn()
     {
-        return dsReplicaId;
+        return searchBaseDn;
     }
 
 
     /**
-     * @param dsreplicaid the dsreplicaid to set
+     * @param searchBaseDN the searchBaseDn to set
      */
-    public void setDsreplicaid( String dsreplicaid )
+    public void setSearchBaseDn( String searchBaseDn )
     {
-        this.dsReplicaId = dsreplicaid;
+        this.searchBaseDn = searchBaseDn;
+    }
+
+
+    /**
+     * @return the replProvHostName
+     */
+    public String getReplProvHostName()
+    {
+        return replProvHostName;
+    }
+
+
+    /**
+     * @param replProvHostName the replProvHostName to set
+     */
+    public void setReplProvHostName( String replProvHostName )
+    {
+        this.replProvHostName = replProvHostName;
+    }
+
+
+    /**
+     * @return the replProvPort
+     */
+    public int getReplProvPort()
+    {
+        return replProvPort;
+    }
+
+
+    /**
+     * @param replProvPort the replProvPort to set
+     */
+    public void setReplProvPort( int replProvPort )
+    {
+        this.replProvPort = replProvPort;
     }
 
 
@@ -146,38 +212,68 @@ public class ReplConsumerBean extends Ad
 
 
     /**
-     * @return the searchBaseDn
+     * @return the replAttributes
      */
-    public Dn getSearchBaseDn()
+    public List<String> getReplAttributes()
     {
-        return searchBaseDn;
+        return replAttributes;
     }
 
 
     /**
-     * @param searchBaseDn the searchBaseDn to set
+     * @param replAttributes the replAttribute to set
      */
-    public void setSearchBaseDn(Dn searchBaseDn)
+    public void setReplAttributes( List<String> replAttributes )
     {
-        this.searchBaseDn = searchBaseDn;
+        this.replAttributes = replAttributes;
+    }
+
+
+    /**
+     * @param replAttributes the replAttribute to add
+     */
+    public void addReplAttributes( String... replAttributes )
+    {
+        for ( String at : replAttributes )
+        {
+            this.replAttributes.add( at );
+        }
+    }
+
+    
+    /**
+     * @return the replRefreshInterval
+     */
+    public long getReplRefreshInterval()
+    {
+        return replRefreshInterval;
     }
 
 
     /**
-     * @return the replLastSentCsn
+     * @param replRefreshInterval the replRefreshInterval to set
      */
-    public String getReplLastSentCsn()
+    public void setReplRefreshInterval( long replRefreshInterval )
     {
-        return replLastSentCsn;
+        this.replRefreshInterval = replRefreshInterval;
     }
 
 
     /**
-     * @param replLastSentCsn the replLastSentCsn to set
+     * @return the replRefreshNPersist
      */
-    public void setReplLastSentCsn( String replLastSentCsn )
+    public boolean isReplRefreshNPersist()
     {
-        this.replLastSentCsn = replLastSentCsn;
+        return replRefreshNPersist;
+    }
+
+
+    /**
+     * @param replRefreshNPersist the replRefreshNPersist to set
+     */
+    public void setReplRefreshNPersist( boolean replRefreshNPersist )
+    {
+        this.replRefreshNPersist = replRefreshNPersist;
     }
 
 
@@ -218,20 +314,92 @@ public class ReplConsumerBean extends Ad
 
 
     /**
-     * @return the replRefreshNPersist
+     * @return the replSearchSizeLimit
      */
-    public boolean isReplRefreshNPersist()
+    public int isReplSearchSizeLimit()
     {
-        return replRefreshNPersist;
+        return replSearchSizeLimit;
     }
 
 
     /**
-     * @param replRefreshNPersist the replRefreshNPersist to set
+     * @param replSearchSizeLimit the replSearchSizeLimit to set
      */
-    public void setReplRefreshNPersist( boolean replRefreshNPersist )
+    public void setReplSearchSizeLimit( int replSearchSizeLimit )
     {
-        this.replRefreshNPersist = replRefreshNPersist;
+        this.replSearchSizeLimit = replSearchSizeLimit;
+    }
+
+
+    /**
+     * @return the replSearchTimeOut
+     */
+    public int getReplSearchTimeOut()
+    {
+        return replSearchTimeout;
+    }
+
+
+    /**
+     * @param replSearchTimeOut the replSearchTimeOut to set
+     */
+    public void setReplSearchTimeLimit( int replSearchTimeOut )
+    {
+        this.replSearchTimeout = replSearchTimeOut;
+    }
+
+
+    /**
+     * @return the replUserDn
+     */
+    public String getReplUserDn()
+    {
+        return replUserDn;
+    }
+
+
+    /**
+     * @param replUserDn the replUserDn to set
+     */
+    public void setReplUserDn( String replUserDn )
+    {
+        this.replUserDn = replUserDn;
+    }
+
+
+    /**
+     * @return the replUserPassword
+     */
+    public byte[] getReplUserPassword()
+    {
+        return replUserPassword;
+    }
+
+
+    /**
+     * @param replUserPassword the replUserPassword to set
+     */
+    public void setReplUserPassword( byte[] replUserPassword )
+    {
+        this.replUserPassword = replUserPassword;
+    }
+
+
+    /**
+     * @return the replCookie
+     */
+    public String getReplCookie()
+    {
+        return replCookie;
+    }
+
+
+    /**
+     * @param replCookie the replCookie to set
+     */
+    public void setReplCookie( String replCookie )
+    {
+        this.replCookie = replCookie;
     }
 
 
@@ -274,7 +442,7 @@ public class ReplConsumerBean extends Ad
     /**
      * @return the replPeerCertificate
      */
-    public String getReplPeerCertificate()
+    public byte[] getReplPeerCertificate()
     {
         return replPeerCertificate;
     }
@@ -283,7 +451,7 @@ public class ReplConsumerBean extends Ad
     /**
      * @param replPeerCertificate the replPeerCertificate to set
      */
-    public void setReplPeerCertificate( String replPeerCertificate )
+    public void setReplPeerCertificate( byte[] replPeerCertificate )
     {
         this.replPeerCertificate = replPeerCertificate;
     }
@@ -314,20 +482,29 @@ public class ReplConsumerBean extends Ad
     {
         StringBuilder sb = new StringBuilder();
 
-        sb.append( tabs ).append( "Replication consumer :\n" );
+        sb.append( tabs ).append( "Replication provider :\n" );
         sb.append( super.toString( tabs + "  " ) );
 
+        sb.append( tabs ).append( "  provider ID : " ).append( replConsumerId ).append( '\n'
);
+        sb.append( tabs ).append( "  search base Dn : " ).append( searchBaseDn ).append(
'\n' );
+        sb.append( tabs ).append( "  provider host name : " ).append( replProvHostName ).append(
'\n' );
+        sb.append( tabs ).append( "  provider port : " ).append( replProvPort ).append( '\n'
);
+        sb.append( toString( tabs, "  alias dereferencing mode", replAliasDerefMode ) );
+        sb.append( toString( tabs, "  attributes", String.valueOf( replAttributes ) ) );
+        sb.append( tabs ).append( "  refresh interval : " ).append( replRefreshInterval ).append(
'\n' );
+        sb.append( toString( tabs, "  refresh and persist mode", replRefreshNPersist ) );
+        sb.append( toString( tabs, "  search scope", replSearchScope ) );
+        sb.append( toString( tabs, "  search filter", replSearchFilter ) );
+        sb.append( tabs ).append( "  search size limit : " ).append( replSearchSizeLimit
).append( '\n' );
+        sb.append( tabs ).append( "  search time limit : " ).append( replSearchTimeout ).append(
'\n' );
+        sb.append( toString( tabs, "  user Dn", replUserDn) );
+        sb.append( toString( tabs, "  user password", String.valueOf( replUserPassword )
) ); // do not reveal the password, just null or not
+        sb.append( toString( tabs, "  cookie", replCookie ) );
         sb.append( tabs ).append( "  consumer implementation's FQCN : " ).append( replConsumerImpl
).append( '\n' );
-        sb.append( tabs ).append( "  consumer ID : " ).append( replConsumerId ).append( '\n'
);
-        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.getName()
).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' );
+        
+        // a hex dump would be good but printing the address is better to just know null
or not
+        sb.append( toString( tabs, "  peer certificate", String.valueOf( replPeerCertificate
) ) );
 
-        sb.append( toString( tabs, "  peer certificate", replPeerCertificate ) );
-        sb.append( toString( tabs, "  refresh and persist mode", replRefreshNPersist ) );
         sb.append( toString( tabs, "  struct certivicate validation", replStrictCertValidation
) );
         sb.append( toString( tabs, "  use TLS", replUseTls ) );
 

Modified: directory/apacheds/trunk/server-config/src/test/resources/ldapServer.ldif
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-config/src/test/resources/ldapServer.ldif?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/apacheds/trunk/server-config/src/test/resources/ldapServer.ldif (original)
+++ directory/apacheds/trunk/server-config/src/test/resources/ldapServer.ldif Tue Jun  7 13:01:58
2011
@@ -175,34 +175,21 @@ objectclass: top
 objectclass: ads-base
 objectclass: ads-replConsumer
 ads-replConsumerId: test
-ads-dsReplicaId: test
+ads-replAttributes: acme
 ads-replAliasDerefMode: NEVER
 ads-searchBaseDN: ads-directoryServiceId=default,ou=config
 ads-replLastSentCsn: 20100509111949.005000Z#000000#000#000000
+ads-replProvHostName: localhost
 ads-replSearchScope: SUB
 ads-replSearchFilter: (&(objectClass=top)(ou=test))
+ads-replProvPort: 12345
 ads-replRefreshNPersist: TRUE
 ads-replUseTls: TRUE
 ads-replStrictCertValidation: TRUE
-ads-replPeerCertificate: ABCD
-
-dn: ads-replProviderId=test,ads-serverId=ldapServer,ou=servers,ads-directoryServiceId=default,ou=config
-objectclass: top
-objectclass: ads-base
-objectclass: ads-replProvider
-ads-replProviderId: test
-ads-dsReplicaId: test
-ads-searchBaseDN: ads-directoryServiceId=default,ou=config
-ads-replProvHostName: localhost
-ads-replProvPort: 12345
 ads-replAliasDerefMode: NEVER
-ads-replAttribute: acme
 ads-replRefreshInterval: 100
-ads-replRefreshNPersist: TRUE
-ads-replSearchScope: SUB
-ads-replSearchFilter: (&(objectClass=top)(ou=test))
-ads-replSearchSizeLimit: 100
-ads-replSearchTimeOut: 100
-ads-replUserDn: ou=config
 ads-replUserPassword: secret
 ads-replCookie: abcdef
+ads-replUserDn: ou=config
+ads-replSearchSizeLimit: 100
+ads-replSearchTimeOut: 100

Modified: directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java
(original)
+++ directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/replication/ClientServerReplicationIT.java
Tue Jun  7 13:01:58 2011
@@ -353,13 +353,13 @@ public class ClientServerReplicationIT
                     config.setConfigEntryDn( configDn );
                     
                     Entry provConfigEntry = new DefaultEntry( ds.getSchemaManager(), configDn
);
-                    provConfigEntry.add( "objectClass", "ads-replProvider" );
-                    provConfigEntry.add( "ads-replProviderId", "localhost" );
+                    provConfigEntry.add( "objectClass", "ads-replConsumer" );
+                    provConfigEntry.add( "ads-replConsumerId", "localhost" );
                     provConfigEntry.add( "ads-searchBaseDN", config.getBaseDn() );
                     provConfigEntry.add( "ads-replProvHostName", config.getProviderHost()
);
                     provConfigEntry.add( "ads-replProvPort", String.valueOf( config.getPort()
) );
                     provConfigEntry.add( "ads-replAliasDerefMode", config.getAliasDerefMode().getJndiValue()
);
-                    provConfigEntry.add( "ads-replAttribute", config.getAttributes() );
+                    provConfigEntry.add( "ads-replAttributes", config.getAttributes() );
                     provConfigEntry.add( "ads-replRefreshInterval", String.valueOf( config.getRefreshInterval()
) );
                     provConfigEntry.add( "ads-replRefreshNPersist", String.valueOf( config.isRefreshNPersist()
) );
                     provConfigEntry.add( "ads-replSearchScope", config.getSearchScope().getLdapUrlValue()
);

Modified: directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
(original)
+++ directory/apacheds/trunk/service-builder/src/main/java/org/apache/directory/server/config/ServiceBuilder.java
Tue Jun  7 13:01:58 2011
@@ -83,6 +83,7 @@ import org.apache.directory.server.ldap.
 import org.apache.directory.server.ldap.handlers.bind.ntlm.NtlmMechanismHandler;
 import org.apache.directory.server.ldap.replication.ReplicationConsumer;
 import org.apache.directory.server.ldap.replication.ReplicationRequestHandler;
+import org.apache.directory.server.ldap.replication.ReplicationTrustManager;
 import org.apache.directory.server.ldap.replication.SyncReplConsumer;
 import org.apache.directory.server.ldap.replication.SyncreplConfiguration;
 import org.apache.directory.server.ntp.NtpServer;
@@ -988,7 +989,6 @@ public class ServiceBuilder
         {
             String className = replBean.getReplConsumerImpl();
             
-            
             ReplicationConsumer consumer = null;
             Class<?> consumerClass = null;
             SyncreplConfiguration config = null;
@@ -1008,19 +1008,33 @@ public class ServiceBuilder
                 
                 // we don't support any other configuration impls atm, but this configuration
should suffice for many needs
                 config = new SyncreplConfiguration();
-                
-                config.setReplicaId( Integer.parseInt( replBean.getDsreplicaid() ) );
+
+                config.setBaseDn( replBean.getSearchBaseDn() );
+                config.setProviderHost( replBean.getReplProvHostName() );
+                config.setPort( replBean.getReplProvPort() );
                 config.setAliasDerefMode( AliasDerefMode.getDerefMode( replBean.getReplAliasDerefMode()
) );
-                config.setBaseDn( replBean.getSearchBaseDn().getName() );
+                config.setAttributes( replBean.getReplAttributes().toArray( new String[0]
) );
+                config.setRefreshInterval( replBean.getReplRefreshInterval() );
+                config.setRefreshNPersist( replBean.isReplRefreshNPersist() );
                 
                 int scope = SearchScope.getSearchScope( replBean.getReplSearchScope() );
                 config.setSearchScope( SearchScope.getSearchScope( scope ) );
                 
                 config.setFilter( replBean.getReplSearchFilter() );
-                config.setRefreshNPersist( replBean.isReplRefreshNPersist() );
+                config.setSearchTimeout( replBean.getReplSearchTimeOut() );
+                config.setReplUserDn( replBean.getReplUserDn() );
+                config.setReplUserPassword( replBean.getReplUserPassword() );
+                
                 config.setUseTls( replBean.isReplUseTls() );
                 config.setStrictCertVerification( replBean.isReplStrictCertValidation() );
                 
+                config.setConfigEntryDn( replBean.getDn() );
+                
+                if ( replBean.getReplPeerCertificate() != null )
+                {
+                    ReplicationTrustManager.addCertificate( replBean.getReplConsumerId(),
replBean.getReplPeerCertificate() );
+                }
+                
                 consumer.setConfig( config );
                 
                 lst.add( consumer );

Modified: directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.828.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou%3Dschema/cn%3Dadsconfig/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.828.ldif?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.828.ldif
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.828.ldif
Tue Jun  7 13:01:58 2011
@@ -2,13 +2,13 @@ version: 1
 dn: m-oid=1.3.6.1.4.1.18060.0.4.1.2.828,ou=attributeTypes,cn=adsconfig,ou=schema
 m-ordering: caseExactOrderingMatch
 m-oid: 1.3.6.1.4.1.18060.0.4.1.2.828
-m-description: the attribute to be replicated
+m-description: the attributes to be replicated
 m-substr: caseIgnoreIA5SubstringsMatch
 objectclass: metaAttributeType
 objectclass: metaTop
 objectclass: top
 m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
-m-name: ads-replAttribute
+m-name: ads-replAttributes
 creatorsname: uid=admin,ou=system
 m-equality: caseIgnoreIA5Match
 m-length: 0

Modified: directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou%3Dschema/cn%3Dadsconfig/ou%3Dobjectclasses/m-oid%3D1.3.6.1.4.1.18060.0.4.1.3.805.ldif?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.805.ldif
Tue Jun  7 13:01:58 2011
@@ -1,22 +1,18 @@
 version: 1
 dn: m-oid=1.3.6.1.4.1.18060.0.4.1.3.805,ou=objectClasses,cn=adsconfig,ou=schema
-m-must: ads-replConsumerId
 m-must: ads-dsReplicaId
 m-must: ads-replAliasDerefMode
 m-must: ads-searchBaseDN
-m-may: ads-replLastSentCsn
 m-must: ads-replSearchScope
 m-must: ads-replSearchFilter
+m-must: ads-replRefreshNPersist
+m-may: ads-replLastSentCsn
+m-may: ads-replCookie
 m-oid: 1.3.6.1.4.1.18060.0.4.1.3.805
 m-supobjectclass: ads-base
-m-description: class to hold a replication consumer details
+m-description: class to hold a replication consumer event log details
 objectclass: metaObjectClass
 objectclass: metaTop
 objectclass: top
-m-name: ads-replConsumer
+m-name: ads-replEventLog
 creatorsname: uid=admin,ou=system
-m-may: ads-replRefreshNPersist
-m-may: ads-replUseTls
-m-may: ads-replStrictCertValidation
-m-may: ads-replPeerCertificate
-m-may: ads-replConsumerImpl

Modified: directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.806.ldif
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou%3Dschema/cn%3Dadsconfig/ou%3Dobjectclasses/m-oid%3D1.3.6.1.4.1.18060.0.4.1.3.806.ldif?rev=1132991&r1=1132990&r2=1132991&view=diff
==============================================================================
--- directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.806.ldif
(original)
+++ directory/shared/trunk/ldap/schema/data/src/main/resources/schema/ou=schema/cn=adsconfig/ou=objectclasses/m-oid=1.3.6.1.4.1.18060.0.4.1.3.806.ldif
Tue Jun  7 13:01:58 2011
@@ -2,18 +2,18 @@ version: 1
 dn: m-oid=1.3.6.1.4.1.18060.0.4.1.3.806,ou=objectClasses,cn=adsconfig,ou=schema
 m-oid: 1.3.6.1.4.1.18060.0.4.1.3.806
 m-supobjectclass: ads-base
-m-description: replication provider configuration
+m-description: replication consumer configuration
 objectclass: metaObjectClass
 objectclass: metaTop
 objectclass: top
-m-name: ads-replProvider
+m-name: ads-replConsumer
 creatorsname: uid=admin,ou=system
-m-must: ads-replProviderId
+m-must: ads-replConsumerId
 m-must: ads-searchBaseDN
 m-must: ads-replProvHostName
 m-must: ads-replProvPort
 m-must: ads-replAliasDerefMode
-m-must: ads-replAttribute
+m-must: ads-replAttributes
 m-must: ads-replRefreshInterval
 m-must: ads-replRefreshNPersist
 m-must: ads-replSearchScope
@@ -22,4 +22,8 @@ m-must: ads-replSearchSizeLimit
 m-must: ads-replSearchTimeOut
 m-must: ads-replUserDn
 m-must: ads-replUserPassword
+m-may: ads-replUseTls
+m-may: ads-replStrictCertValidation
+m-may: ads-replPeerCertificate
+m-may: ads-replConsumerImpl
 m-may: ads-replCookie



Mime
View raw message