From 41bef7c0b619c7bc925326451a56071b5736580a Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Wed, 19 Jun 2013 08:36:16 +0000
Subject: [PATCH] Fix OPENDJ-986: Exception when reading messages from Replication server RS

---
 opends/src/server/org/opends/server/replication/protocol/ProtocolSession.java |   36 +++++++++++++-----------------------
 1 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/ProtocolSession.java b/opends/src/server/org/opends/server/replication/protocol/ProtocolSession.java
index 8bf6c5a..c37bfff 100644
--- a/opends/src/server/org/opends/server/replication/protocol/ProtocolSession.java
+++ b/opends/src/server/org/opends/server/replication/protocol/ProtocolSession.java
@@ -49,31 +49,14 @@
   public abstract void close();
 
   /**
-   * This method is called when a ReplicationMsg must be sent to
-   * the remote entity. The PDU is send using serialization of the current
-   * protocol version.
+   * Sends a replication message to the remote peer.
    *
-   * It can be called by several threads and must implement appropriate
-   * replication (typically, this method or a part of it should be
-   * synchronized).
-   *
-   * @param msg The ReplicationMsg that must be sent.
-   * @throws IOException If an IO error happen during the publish process.
+   * @param msg
+   *          The message to be sent.
+   * @throws IOException
+   *           If an IO error occurred.
    */
-  public abstract void publish(ReplicationMsg msg)
-                  throws IOException;
-
-  /**
-   * Same as publish(ReplicationMsg msg), but forcing the usage of a particular
-   * protocol version for the PDU serialization.
-   *
-   * @param msg The ReplicationMsg that must be sent.
-   * @param reqProtocolVersion The protocol version to use for serialization.
-   * The version should normally be older than the current one.
-   * @throws IOException If an IO error happen during the publish process.
-   */
-  public abstract void publish(ReplicationMsg msg, short reqProtocolVersion)
-                  throws IOException;
+  public abstract void publish(ReplicationMsg msg) throws IOException;
 
   /**
    * Attempt to receive a ReplicationMsg.
@@ -177,4 +160,11 @@
    * @param version The version of the protocol that is currently used.
    */
   public abstract void setProtocolVersion(short version);
+
+  /**
+   * Returns the version of the protocol that is currently used.
+   *
+   * @return The version of the protocol that is currently used.
+   */
+  public abstract short getProtocolVersion();
 }

--
Gitblit v1.10.0