From bfe3a38b79cfb8d3b536ed03f7d2b9db918e98d6 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 06 Sep 2013 09:08:26 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB

---
 opends/src/server/org/opends/server/replication/server/changelog/je/DraftCNData.java |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/changelog/je/DraftCNData.java b/opends/src/server/org/opends/server/replication/server/changelog/je/DraftCNData.java
index 8335497..77e2efd 100644
--- a/opends/src/server/org/opends/server/replication/server/changelog/je/DraftCNData.java
+++ b/opends/src/server/org/opends/server/replication/server/changelog/je/DraftCNData.java
@@ -31,7 +31,7 @@
 
 import org.opends.messages.Message;
 import org.opends.server.replication.common.CSN;
-import org.opends.server.replication.server.changelog.api.CNIndexData;
+import org.opends.server.replication.server.changelog.api.CNIndexRecord;
 import org.opends.server.replication.server.changelog.api.ChangelogException;
 
 import com.sleepycat.je.DatabaseEntry;
@@ -48,7 +48,7 @@
   private static final long serialVersionUID = 1L;
 
   private long changeNumber;
-  private CNIndexData cnIndexData;
+  private CNIndexRecord record;
 
   /**
    * Creates a record to be stored in the DraftCNDB.
@@ -84,27 +84,27 @@
   public DraftCNData(long changeNumber, byte[] data) throws ChangelogException
   {
     this.changeNumber = changeNumber;
-    this.cnIndexData = decodeData(changeNumber, data);
+    this.record = decodeData(changeNumber, data);
   }
 
   /**
-   * Decode and returns a {@link CNIndexData} record.
+   * Decode and returns a {@link CNIndexRecord}.
    *
    * @param changeNumber
    * @param data
    *          the provided byte array.
-   * @return the decoded {@link CNIndexData} record
+   * @return the decoded {@link CNIndexRecord}
    * @throws ChangelogException
    *           when a problem occurs.
    */
-  private CNIndexData decodeData(long changeNumber, byte[] data)
+  private CNIndexRecord decodeData(long changeNumber, byte[] data)
       throws ChangelogException
   {
     try
     {
       String stringData = new String(data, "UTF-8");
       String[] str = stringData.split(FIELD_SEPARATOR, 3);
-      return new CNIndexData(changeNumber, str[0], str[1], new CSN(str[2]));
+      return new CNIndexRecord(changeNumber, str[0], str[1], new CSN(str[2]));
     }
     catch (UnsupportedEncodingException e)
     {
@@ -115,17 +115,17 @@
   }
 
   /**
-   * Getter for the decoded {@link CNIndexData} record.
+   * Getter for the decoded record.
    *
-   * @return the CNIndexData record.
+   * @return the {@link CNIndexRecord} record.
    * @throws ChangelogException
    *           when a problem occurs.
    */
-  public CNIndexData getCNIndexData() throws ChangelogException
+  public CNIndexRecord getRecord() throws ChangelogException
   {
-    if (cnIndexData == null)
-      cnIndexData = decodeData(changeNumber, getData());
-    return cnIndexData;
+    if (record == null)
+      record = decodeData(changeNumber, getData());
+    return record;
   }
 
   /**
@@ -135,7 +135,7 @@
   @Override
   public String toString()
   {
-    return "DraftCNData : [" + cnIndexData + "]";
+    return "DraftCNData : [" + record + "]";
   }
 
 }

--
Gitblit v1.10.0