org.opends.server.backends.jeb
Class ID2Entry

java.lang.Object
  extended by org.opends.server.backends.jeb.DatabaseContainer
      extended by org.opends.server.backends.jeb.ID2Entry

public class ID2Entry
extends DatabaseContainer

Represents the database containing the LDAP entries. The database key is the entry ID and the value is the entry contents.


Field Summary
 
Fields inherited from class org.opends.server.backends.jeb.DatabaseContainer
dbConfig, entryContainer, name
 
Method Summary
 com.sleepycat.je.DatabaseEntry entryData(Entry entry)
          Convert an entry to its database format.
 Entry get(com.sleepycat.je.Transaction txn, EntryID id, com.sleepycat.je.LockMode lockMode)
          Fetch a record from the entry database.
 boolean insert(com.sleepycat.je.Transaction txn, EntryID id, Entry entry)
          Insert a record into the entry database.
 boolean put(com.sleepycat.je.Transaction txn, EntryID id, Entry entry)
          Write a record in the entry database.
 boolean putRaw(com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, com.sleepycat.je.DatabaseEntry data)
          Write a pre-formatted record into the entry database.
 boolean remove(com.sleepycat.je.Transaction txn, EntryID id)
          Remove a record from the entry database.
 void setDataConfig(DataConfig dataConfig)
          Set the desired compression and encryption options for data stored in the entry database.
 
Methods inherited from class org.opends.server.backends.jeb.DatabaseContainer
delete, getName, getRecordCount, insert, open, openCursor, preload, put, read, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

entryData

public com.sleepycat.je.DatabaseEntry entryData(Entry entry)
                                         throws DirectoryException
Convert an entry to its database format.

Parameters:
entry - The LDAP entry to be converted.
Returns:
The database entry.
Throws:
DirectoryException - If a problem occurs while attempting to encode the entry.

insert

public boolean insert(com.sleepycat.je.Transaction txn,
                      EntryID id,
                      Entry entry)
               throws com.sleepycat.je.DatabaseException,
                      DirectoryException
Insert a record into the entry database.

Parameters:
txn - The database transaction or null if none.
id - The entry ID which forms the key.
entry - The LDAP entry.
Returns:
true if the entry was inserted, false if a record with that ID already existed.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.
DirectoryException - If a problem occurs while attempting to encode the entry.

put

public boolean put(com.sleepycat.je.Transaction txn,
                   EntryID id,
                   Entry entry)
            throws com.sleepycat.je.DatabaseException,
                   DirectoryException
Write a record in the entry database.

Parameters:
txn - The database transaction or null if none.
id - The entry ID which forms the key.
entry - The LDAP entry.
Returns:
true if the entry was written, false if it was not.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.
DirectoryException - If a problem occurs while attempting to encode the entry.

putRaw

public boolean putRaw(com.sleepycat.je.Transaction txn,
                      com.sleepycat.je.DatabaseEntry key,
                      com.sleepycat.je.DatabaseEntry data)
               throws com.sleepycat.je.DatabaseException
Write a pre-formatted record into the entry database.

Parameters:
txn - The database transaction or null if none.
key - The key containing a pre-formatted entry ID.
data - The data value containing a pre-formatted LDAP entry.
Returns:
true if the entry was written, false if it was not.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.

remove

public boolean remove(com.sleepycat.je.Transaction txn,
                      EntryID id)
               throws com.sleepycat.je.DatabaseException
Remove a record from the entry database.

Parameters:
txn - The database transaction or null if none.
id - The entry ID which forms the key.
Returns:
true if the entry was removed, false if it was not.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.

get

public Entry get(com.sleepycat.je.Transaction txn,
                 EntryID id,
                 com.sleepycat.je.LockMode lockMode)
          throws JebException,
                 com.sleepycat.je.DatabaseException
Fetch a record from the entry database.

Parameters:
txn - The database transaction or null if none.
id - The desired entry ID which forms the key.
lockMode - The JE locking mode to be used for the read.
Returns:
The requested entry, or null if there is no such record.
Throws:
JebException - If an error occurs in the JE backend.
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.

setDataConfig

public void setDataConfig(DataConfig dataConfig)
Set the desired compression and encryption options for data stored in the entry database.

Parameters:
dataConfig - The desired compression and encryption options for data stored in the entry database.