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/StartSessionMsg.java |   64 --------------------------------
 1 files changed, 0 insertions(+), 64 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/StartSessionMsg.java b/opends/src/server/org/opends/server/replication/protocol/StartSessionMsg.java
index 21e9d8d..c3d84be 100644
--- a/opends/src/server/org/opends/server/replication/protocol/StartSessionMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/StartSessionMsg.java
@@ -77,11 +77,6 @@
   private Set<String> eclIncludesForDeletes = new HashSet<String>();
 
   /**
-   * The protocolVersion that should be used when serializing this message.
-   */
-  private final short protocolVersion;
-
-  /**
    * Creates a new StartSessionMsg message from its encoded form.
    *
    * @param in The byte array containing the encoded form of the message.
@@ -91,7 +86,6 @@
    */
   public StartSessionMsg(byte[] in, short version) throws DataFormatException
   {
-    protocolVersion = ProtocolVersion.getCurrentVersion();
     if (version <= ProtocolVersion.REPLICATION_PROTOCOL_V3)
     {
       decode_V23(in);
@@ -103,29 +97,6 @@
   }
 
   /**
-   * Creates a new StartSessionMsg message from its encoded form.
-   *
-   * Creates a new  message with the given required parameters.
-   * @param status Status we are starting with
-   * @param referralsURLs Referrals URLs to be used by peer DSs
-   * @param assuredFlag If assured mode is enabled or not
-   * @param assuredMode Assured type
-   * @param safeDataLevel Assured mode safe data level
-   * @param replicationProtocol   The protocol version to use.
-   */
-  public StartSessionMsg(ServerStatus status, List<String> referralsURLs,
-      boolean assuredFlag, AssuredMode assuredMode, byte safeDataLevel,
-      short replicationProtocol)
-  {
-    this.referralsURLs = referralsURLs;
-    this.status = status;
-    this.assuredFlag = assuredFlag;
-    this.assuredMode = assuredMode;
-    this.safeDataLevel = safeDataLevel;
-    this.protocolVersion = replicationProtocol;
-  }
-
-  /**
    * Creates a new  message with the given required parameters.
    * @param status Status we are starting with
    * @param referralsURLs Referrals URLs to be used by peer DSs
@@ -141,7 +112,6 @@
     this.assuredFlag = assuredFlag;
     this.assuredMode = assuredMode;
     this.safeDataLevel = safeDataLevel;
-    this.protocolVersion = ProtocolVersion.getCurrentVersion();
   }
 
   /**
@@ -155,23 +125,6 @@
     this.referralsURLs = referralsURLs;
     this.status = status;
     this.assuredFlag = false;
-    this.protocolVersion = ProtocolVersion.getCurrentVersion();
-  }
-
-  /**
-   * Creates a new message with the given required parameters.
-   * Assured mode is false.
-   * @param status Status we are starting with
-   * @param referralsURLs Referrals URLs to be used by peer DSs
-   * @param replicationProtocol The requested protocol version.
-   */
-  public StartSessionMsg(ServerStatus status, List<String> referralsURLs,
-    short replicationProtocol)
-  {
-    this.referralsURLs = referralsURLs;
-    this.status = status;
-    this.assuredFlag = false;
-    this.protocolVersion = replicationProtocol;
   }
 
   // ============
@@ -182,23 +135,6 @@
    * {@inheritDoc}
    */
   @Override
-  public byte[] getBytes()
-  throws UnsupportedEncodingException
-  {
-    if (protocolVersion <= ProtocolVersion.REPLICATION_PROTOCOL_V3)
-    {
-      return getBytes_V23();
-    }
-    else
-    {
-      return getBytes_V45(protocolVersion);
-    }
-  }
-
-  /**
-   * {@inheritDoc}
-   */
-  @Override
   public byte[] getBytes(short reqProtocolVersion)
     throws UnsupportedEncodingException
   {

--
Gitblit v1.10.0