From 13819a2e81db0422a7c8c186f838c7b243173170 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Wed, 03 Sep 2014 06:30:37 +0000
Subject: [PATCH] OPENDJ-1205 (CR-4428) Remove network layer from External ChangeLog implementation

---
 opends/src/server/org/opends/server/replication/server/ServerHandler.java |   55 +++++++++++++------------------------------------------
 1 files changed, 13 insertions(+), 42 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ServerHandler.java b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
index 63718bf..58009ad 100644
--- a/opends/src/server/org/opends/server/replication/server/ServerHandler.java
+++ b/opends/src/server/org/opends/server/replication/server/ServerHandler.java
@@ -114,12 +114,12 @@
   /**
    * The associated ServerWriter that sends messages to the remote server.
    */
-  protected ServerWriter writer;
+  private ServerWriter writer;
 
   /**
    * The associated ServerReader that receives messages from the remote server.
    */
-  protected ServerReader reader;
+  private ServerReader reader;
 
   // window
   private int rcvWindow;
@@ -132,11 +132,11 @@
   /**
    * Semaphore that the writer uses to control the flow to the remote server.
    */
-  protected Semaphore sendWindow;
+  private Semaphore sendWindow;
   /**
    * The initial size of the sending window.
    */
-  protected int sendWindowSize;
+  private int sendWindowSize;
   /**
    * remote generation id.
    */
@@ -161,7 +161,7 @@
    * The time in milliseconds between heartbeats from the replication
    * server.  Zero means heartbeats are off.
    */
-  protected long heartbeatInterval = 0;
+  protected long heartbeatInterval;
 
   /**
    * The thread that will send heartbeats.
@@ -171,7 +171,7 @@
   /**
    * Set when ServerWriter is stopping.
    */
-  protected volatile boolean shutdownWriter = false;
+  private volatile boolean shutdownWriter;
 
   /**
    * Weight of this remote server.
@@ -539,22 +539,16 @@
     }
 
     // Window stats
-    attributes.add(Attributes.create("max-send-window", String
-        .valueOf(sendWindowSize)));
-    attributes.add(Attributes.create("current-send-window", String
-        .valueOf(sendWindow.availablePermits())));
-    attributes.add(Attributes.create("max-rcv-window", String
-        .valueOf(maxRcvWindow)));
-    attributes.add(Attributes.create("current-rcv-window", String
-        .valueOf(rcvWindow)));
+    attributes.add(Attributes.create("max-send-window", String.valueOf(sendWindowSize)));
+    attributes.add(Attributes.create("current-send-window", String.valueOf(sendWindow.availablePermits())));
+    attributes.add(Attributes.create("max-rcv-window", String.valueOf(maxRcvWindow)));
+    attributes.add(Attributes.create("current-rcv-window", String.valueOf(rcvWindow)));
 
     // Encryption
-    attributes.add(Attributes.create("ssl-encryption", String
-        .valueOf(session.isEncrypted())));
+    attributes.add(Attributes.create("ssl-encryption", String.valueOf(session.isEncrypted())));
 
     // Data generation
-    attributes.add(Attributes.create("generation-id", String
-        .valueOf(generationId)));
+    attributes.add(Attributes.create("generation-id", String.valueOf(generationId)));
 
     return attributes;
   }
@@ -919,20 +913,12 @@
   }
 
   /**
-   * Requests to shutdown the writer.
-   */
-  protected void shutdownWriter()
-  {
-    shutdownWriter = true;
-  }
-
-  /**
    * Shutdown This ServerHandler.
    */
   @Override
   public void shutdown()
   {
-    shutdownWriter();
+    shutdownWriter = true;
     setConsumerActive(false);
     super.shutdown();
 
@@ -1137,21 +1123,6 @@
   }
 
   /**
-   * Log the messages involved in the Topology/StartSession handshake.
-   * @param inStartECLSessionMsg The message received first.
-   */
-  protected void logStartECLSessionHandshake(
-      StartECLSessionMsg inStartECLSessionMsg)
-  {
-    if (debugEnabled())
-    {
-      TRACER.debugInfo("In " + this.replicationServer.getMonitorInstanceName()
-          + ", " + getClass().getSimpleName() + " " + this + " :"
-          + "\nSH SESSION HANDSHAKE RECEIVED:\n" + inStartECLSessionMsg);
-    }
-  }
-
-  /**
    * Process a Ack message received.
    * @param ack the message received.
    */

--
Gitblit v1.10.0