mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
07.07.2007 8395e95048f9670f0889eb1b0518d1595f01dd07
opends/src/server/org/opends/server/backends/jeb/JebFormat.java
@@ -36,6 +36,7 @@
import org.opends.server.types.CryptoManager;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.EntryEncodeConfig;
import org.opends.server.types.LDAPException;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -72,6 +73,11 @@
  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.
   *
@@ -236,8 +242,12 @@
   * @param entry The entry to encode.
   * @param dataConfig Compression and cryptographic options.
   * @return A byte array containing the encoded database value.
   *
   * @throws  DirectoryException  If a problem occurs while attempting to encode
   *                              the entry.
   */
  static public byte[] entryToDatabase(Entry entry, DataConfig dataConfig)
         throws DirectoryException
  {
    byte[] uncompressedBytes = encodeDirectoryServerEntry(entry);
    return encodeDatabaseEntry(uncompressedBytes, dataConfig);
@@ -248,8 +258,12 @@
   *
   * @param entry The entry to encode.
   * @return A byte array containing the encoded database value.
   *
   * @throws  DirectoryException  If a problem occurs while attempting to encode
   *                              the entry.
   */
  static public byte[] entryToDatabase(Entry entry)
         throws DirectoryException
  {
    return entryToDatabase(entry, new DataConfig());
  }
@@ -259,10 +273,14 @@
   *
   * @param entry The entry to encode.
   * @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)
         throws DirectoryException
  {
    return entry.encode();
    return entry.encode(encodeConfig);
  }
  /**