From 207cfae7111af06d52afcfab71b2c80b87fe473a Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 12 Aug 2013 15:22:03 +0000
Subject: [PATCH] OPENDJ-1116 Introduce abstraction for the changelog DB
---
opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java
index 1d4a549..0ec95c2 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/DraftCNData.java
@@ -27,15 +27,16 @@
*/
package org.opends.server.replication.server;
-import static org.opends.server.util.StaticUtils.*;
-
import java.io.UnsupportedEncodingException;
import org.opends.messages.Message;
import org.opends.server.replication.common.ChangeNumber;
+import org.opends.server.replication.server.changelog.api.ChangelogException;
import com.sleepycat.je.DatabaseEntry;
+import static org.opends.server.util.StaticUtils.*;
+
/**
* SuperClass of DatabaseEntry used for data stored in the DraftCNDB.
*/
@@ -66,9 +67,9 @@
/**
* Creates a record to be stored in the DraftCNDB from the provided byte[].
* @param data the provided byte[].
- * @throws Exception a.
+ * @throws ChangelogException a.
*/
- public DraftCNData(byte[] data) throws Exception
+ public DraftCNData(byte[] data) throws ChangelogException
{
decodeData(data);
}
@@ -76,10 +77,9 @@
/**
* Decode a record into fields.
* @param data the provided byte array.
- * @throws Exception when a problem occurs.
+ * @throws ChangelogException when a problem occurs.
*/
- public void decodeData(byte[] data)
- throws Exception
+ public void decodeData(byte[] data) throws ChangelogException
{
try
{
@@ -94,46 +94,46 @@
{
// should never happens
// TODO: i18n
- throw new ReplicationDBException(Message.raw("need UTF-8 support"));
+ throw new ChangelogException(Message.raw("need UTF-8 support"));
}
}
/**
* Getter for the value.
+ *
* @return the value.
- * @throws Exception when a problem occurs.
+ * @throws ChangelogException when a problem occurs.
*/
- public String getValue()
- throws Exception
+ public String getValue() throws ChangelogException
{
if (value == null)
- this.decodeData(this.getData());
+ decodeData(getData());
return this.value;
}
/**
* Getter for the service ID.
+ *
* @return The baseDN
- * @throws Exception when a problem occurs.
+ * @throws ChangelogException when a problem occurs.
*/
- public String getBaseDN()
- throws Exception
+ public String getBaseDN() throws ChangelogException
{
if (value == null)
- this.decodeData(this.getData());
+ decodeData(getData());
return this.baseDN;
}
/**
* Getter for the replication change number.
+ *
* @return the replication change number.
- * @throws Exception when a problem occurs.
+ * @throws ChangelogException when a problem occurs.
*/
- public ChangeNumber getChangeNumber()
- throws Exception
+ public ChangeNumber getChangeNumber() throws ChangelogException
{
if (value == null)
- this.decodeData(this.getData());
+ decodeData(getData());
return this.changeNumber;
}
--
Gitblit v1.10.0