From b4f8838b15342670c31753a484abf0129e3c9653 Mon Sep 17 00:00:00 2001
From: jcduff <jcduff@localhost>
Date: Thu, 23 Oct 2008 14:04:24 +0000
Subject: [PATCH] The commit will bring the following features :     - An updated version of the underlying database. BDB JE 3.3 is now used.     - Attribute API refactoring providing a better abstraction and offering improved performances.     - A new GUI called the Control-Panel to replace the Status-Panel: the specifications for this       GUI are available on OpenDS Wiki and contains a link to a mockup.        See <https://www.opends.org/wiki/page/ControlPanelUISpecification>.     - Some changes in the replication protocol to implement "Assured Replication Mode". The        specifications are on OpenDS Wiki at <https://www.opends.org/wiki/page/AssuredMode> and section 7       described some of the replication changes required to support this. Assured Replication is not finished,       but the main replication protocol changes to support it are done. As explained by Gilles on an email on       the Dev mailing list (http://markmail.org/message/46rgo3meq3vriy4a), with these changes the newer versions       of OpenDS may not be able to replicate with OpenDS 1.0 instances.     - Support for Service Tags on the platforms where the functionality is available and enabled. Specifications       are published at <https://www.opends.org/wiki/page/OpenDSServiceTagEnabled>. For more information on       Service Tags see <http://wikis.sun.com/display/ServiceTag/Sun+Service+Tag+FAQ>.     - The Admin Connector service. In order to provide agentry of the OpenDS server at any time, a new service       has been added, dedicated to the administration, configuration and monitoring of the server.       An overview of the Admin Connector service and it's use is available on the       OpenDS wiki <https://www.opends.org/wiki/page/ManagingAdministrationTrafficToTheServer>     - Updates to the various command line tools to support the Admin Connector service.     - Some internal re-architecting of the server to put the foundation of future developments such as virtual       directory services. The new NetworkGroups and WorkFlow internal services which have been specified in       <https://www.opends.org/wiki/page/BasicOperationRoutingThroughNetworkGroup> are now implemented.     - Many bug fixes...

---
 opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ProtocolVersion.java |   50 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 37 insertions(+), 13 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ProtocolVersion.java b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ProtocolVersion.java
index ae61e30..9e4b6e5 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ProtocolVersion.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ProtocolVersion.java
@@ -33,30 +33,55 @@
 public class ProtocolVersion
 {
   /**
-   * Get the version included in the Start Message mean the replication
-   * protocol version used by the server that created the message.
-   *
-   * @return The version used by the server that created the message.
+   * The constant for the first historical version of the replication protocol.
    */
-  static short CURRENT_VERSION = 1;
+  public static final short REPLICATION_PROTOCOL_V1 = 1;
+  /**
+   * The constant for the real value of the first historical version of the
+   * replication protocol (was used in start messages only).
+   */
+  public static final short REPLICATION_PROTOCOL_V1_REAL = 49;
+  /**
+   * The constant for the second version of the replication protocol.
+   */
+  public static final short REPLICATION_PROTOCOL_V2 = 2;
 
   /**
-   * Specifies the current version of the replication protocol.
+   * The replication protocol version used by the instance of RS/DS in this VM.
+   */
+  private static short currentVersion = -1;
+
+  static
+  {
+    resetCurrentVersion();
+  }
+
+  /**
+   * Gets the current version of the replication protocol.
    *
    * @return The current version of the protocol.
    */
-  public static short currentVersion()
+  public static short getCurrentVersion()
   {
-    return CURRENT_VERSION;
+    return currentVersion;
   }
 
   /**
    * For test purpose.
-   * @param currentVersion The provided current version.
+   * @param curVersion The provided current version.
    */
-  public static void setCurrentVersion(short currentVersion)
+  public static void setCurrentVersion(short curVersion)
   {
-    CURRENT_VERSION = currentVersion;
+    currentVersion = curVersion;
+  }
+
+  /**
+   * Resets the protocol version to the default value (the latest version).
+   * For test purpose.
+   */
+  public static void resetCurrentVersion()
+  {
+    currentVersion = REPLICATION_PROTOCOL_V2;
   }
 
   /**
@@ -68,8 +93,7 @@
    */
   public static short minWithCurrent(short version)
   {
-    Short sVersion = Short.valueOf(version);
-    Short newVersion = (sVersion<CURRENT_VERSION?sVersion:CURRENT_VERSION);
+    short newVersion = (version < currentVersion ? version : currentVersion);
     return newVersion;
   }
 }

--
Gitblit v1.10.0