From 14809a0c5e44468632e3ddf56000c88bacaec0aa Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 23 Aug 2007 23:14:02 +0000
Subject: [PATCH] Added the JE backend configuration attribute to enable or disable compression when encoding entries for ID2Entry. When backend-compact-encoding is enabled, attribute type descriptions and object class sets will be encoded using a compressed form. This behavior is enabled by default.
---
opends/src/server/org/opends/server/backends/jeb/JebFormat.java | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/jeb/JebFormat.java b/opends/src/server/org/opends/server/backends/jeb/JebFormat.java
index 6c950fb..2e133ae 100644
--- a/opends/src/server/org/opends/server/backends/jeb/JebFormat.java
+++ b/opends/src/server/org/opends/server/backends/jeb/JebFormat.java
@@ -73,11 +73,6 @@
public static final byte TAG_DIRECTORY_SERVER_ENTRY = 0x61;
/**
- * The configuration to use when encoding entries in the database.
- */
- private static EntryEncodeConfig encodeConfig = new EntryEncodeConfig();
-
- /**
* Decode a DatabaseEntry. The encoded bytes may be compressed and/or
* encrypted.
*
@@ -249,7 +244,8 @@
static public byte[] entryToDatabase(Entry entry, DataConfig dataConfig)
throws DirectoryException
{
- byte[] uncompressedBytes = encodeDirectoryServerEntry(entry);
+ byte[] uncompressedBytes = encodeDirectoryServerEntry(entry,
+ dataConfig.getEntryEncodeConfig());
return encodeDatabaseEntry(uncompressedBytes, dataConfig);
}
@@ -265,19 +261,21 @@
static public byte[] entryToDatabase(Entry entry)
throws DirectoryException
{
- return entryToDatabase(entry, new DataConfig());
+ return entryToDatabase(entry, new DataConfig(false, false));
}
/**
* Encode a ASN1 DirectoryServerEntry.
*
* @param entry The entry to encode.
+ * @encodeConfig The configuration to use when encoding the entry.
* @return A byte array containing the encoded DirectoryServerEntry.
*
* @throws DirectoryException If a problem occurs while attempting to encode
* the entry.
*/
- static private byte[] encodeDirectoryServerEntry(Entry entry)
+ static private byte[] encodeDirectoryServerEntry(Entry entry,
+ EntryEncodeConfig encodeConfig)
throws DirectoryException
{
return entry.encode(encodeConfig);
--
Gitblit v1.10.0