directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1088542 - in /directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication: SyncReplConsumer.java SyncreplConfiguration.java
Date Mon, 04 Apr 2011 10:28:19 GMT
Author: kayyagari
Date: Mon Apr  4 10:28:19 2011
New Revision: 1088542

URL: http://svn.apache.org/viewvc?rev=1088542&view=rev
Log:
o updated to implement the newly added replication interfaces
o fixed a bug in setting the alias deref mode in the replication configuration

Modified:
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
    directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java?rev=1088542&r1=1088541&r2=1088542&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncReplConsumer.java
Mon Apr  4 10:28:19 2011
@@ -97,7 +97,7 @@ import org.slf4j.LoggerFactory;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SyncReplConsumer implements ConnectionClosedEventListener
+public class SyncReplConsumer implements ConnectionClosedEventListener, ReplicationConsumer
 {
 
     /** the syncrepl configuration */
@@ -162,9 +162,8 @@ public class SyncReplConsumer implements
     }
 
 
-    public void init( DirectoryService directoryservice, SyncreplConfiguration config ) throws
Exception
+    public void init( DirectoryService directoryservice ) throws Exception
     {
-        this.config = config;
         this.directoryService = directoryservice;
 
         if ( config.isStoreCookieInFile() )
@@ -495,6 +494,43 @@ public class SyncReplConsumer implements
     }
 
 
+    /** 
+     * {@inheritDoc}
+     */
+    public void setConfig( ReplicationConsumerConfig config )
+    {
+        this.config = ( SyncreplConfiguration ) config;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void start()
+    {
+        connect();
+        startSync();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void stop()
+    {
+        disconnet();
+    }
+
+    
+    /**
+     * {@inheritDoc}
+     */
+    public String getId()
+    {
+        return String.valueOf( getConfig().getReplicaId() );
+    }
+    
+    
     /**
      * performs a search on connection with updated syncRequest control.
      *

Modified: directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java?rev=1088542&r1=1088541&r2=1088542&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java
(original)
+++ directory/apacheds/trunk/protocol-ldap/src/main/java/org/apache/directory/server/ldap/replication/SyncreplConfiguration.java
Mon Apr  4 10:28:19 2011
@@ -38,7 +38,7 @@ import javax.net.ssl.X509TrustManager;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SyncreplConfiguration
+public class SyncreplConfiguration implements ReplicationConsumerConfig
 {
     /** host name of the syncrepl provider server, default value is localhost */
     private String providerHost = "localhost";
@@ -406,7 +406,7 @@ public class SyncreplConfiguration
     public void setAliasDerefMode( AliasDerefMode aliasDerefMode )
     {
         if ( aliasDerefMode != AliasDerefMode.NEVER_DEREF_ALIASES
-            || aliasDerefMode != AliasDerefMode.DEREF_FINDING_BASE_OBJ )
+            && aliasDerefMode != AliasDerefMode.DEREF_FINDING_BASE_OBJ )
         {
             throw new IllegalArgumentException(
                 "alias deref mode should only be set to either 'NEVER_DEREF_ALIASES' or 'DEREF_FINDING_BASE_OBJ'"
);



Mime
View raw message