From 8395e95048f9670f0889eb1b0518d1595f01dd07 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 07 Jun 2007 20:07:26 +0000
Subject: [PATCH] Provide a new mechanism for encoding entries.  This method adds an extra element that includes flags that indicate how the entry was encoded.  The flags currently defined include:

---
 opends/src/server/org/opends/server/backends/jeb/ID2Entry.java |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/backends/jeb/ID2Entry.java b/opends/src/server/org/opends/server/backends/jeb/ID2Entry.java
index 70ddbe0..e372bfe 100644
--- a/opends/src/server/org/opends/server/backends/jeb/ID2Entry.java
+++ b/opends/src/server/org/opends/server/backends/jeb/ID2Entry.java
@@ -41,6 +41,7 @@
 import com.sleepycat.je.OperationStatus;
 import com.sleepycat.je.Transaction;
 
+import org.opends.server.types.DirectoryException;
 import org.opends.server.types.Entry;
 
 /**
@@ -140,8 +141,12 @@
    *
    * @param entry The LDAP entry to be converted.
    * @return The database entry.
+   *
+   * @throws  DirectoryException  If a problem occurs while attempting to encode
+   *                              the entry.
    */
   private DatabaseEntry entryData(Entry entry)
+          throws DirectoryException
   {
     byte[] entryBytes;
     entryBytes = JebFormat.entryToDatabase(entry, dataConfig);
@@ -157,9 +162,11 @@
    * @return true if the entry was inserted, false if a record with that
    *         ID already existed.
    * @throws DatabaseException If an error occurs in the JE database.
+   * @throws  DirectoryException  If a problem occurs while attempting to encode
+   *                              the entry.
    */
   public boolean insert(Transaction txn, EntryID id, Entry entry)
-       throws DatabaseException
+       throws DatabaseException, DirectoryException
   {
     DatabaseEntry key = id.getDatabaseEntry();
     DatabaseEntry data = entryData(entry);
@@ -181,9 +188,11 @@
    * @param entry The LDAP entry.
    * @return true if the entry was written, false if it was not.
    * @throws DatabaseException If an error occurs in the JE database.
+   * @throws  DirectoryException  If a problem occurs while attempting to encode
+   *                              the entry.
    */
   public boolean put(Transaction txn, EntryID id, Entry entry)
-       throws DatabaseException
+       throws DatabaseException, DirectoryException
   {
     DatabaseEntry key = id.getDatabaseEntry();
     DatabaseEntry data = entryData(entry);

--
Gitblit v1.10.0