org.opends.server.backends.jeb
Class DN2ID

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

public class DN2ID
extends DatabaseContainer

This class represents the DN database, or dn2id, which has one record for each entry. The key is the normalized entry DN and the value is the entry ID.


Field Summary
 
Fields inherited from class org.opends.server.backends.jeb.DatabaseContainer
dbConfig, entryContainer, name
 
Method Summary
 EntryID get(com.sleepycat.je.Transaction txn, DN dn, com.sleepycat.je.LockMode lockMode)
          Fetch the entry ID for a given DN.
 java.util.Comparator<byte[]> getComparator()
          Gets the comparator for records stored in this database.
 boolean insert(com.sleepycat.je.Transaction txn, DN dn, EntryID id)
          Insert a new record into the DN database.
 boolean put(com.sleepycat.je.Transaction txn, DN dn, EntryID id)
          Write a record to the DN database.
 boolean putRaw(com.sleepycat.je.Transaction txn, com.sleepycat.je.DatabaseEntry key, com.sleepycat.je.DatabaseEntry data)
          Write a record to the DN database, where the key and value are already formatted.
 boolean remove(com.sleepycat.je.Transaction txn, DN dn)
          Remove a record from the DN 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

insert

public boolean insert(com.sleepycat.je.Transaction txn,
                      DN dn,
                      EntryID id)
               throws com.sleepycat.je.DatabaseException
Insert a new record into the DN database.

Parameters:
txn - A JE database transaction to be used for the database operation, or null if none.
dn - The entry DN, which is the key to the record.
id - The entry ID, which is the value of the record.
Returns:
true if the record was inserted, false if a record with that key already exists.
Throws:
com.sleepycat.je.DatabaseException - If an error occurred while attempting to insert the new record.

put

public boolean put(com.sleepycat.je.Transaction txn,
                   DN dn,
                   EntryID id)
            throws com.sleepycat.je.DatabaseException
Write a record to the DN database. If a record with the given key already exists, the record will be replaced, otherwise a new record will be inserted.

Parameters:
txn - A JE database transaction to be used for the database operation, or null if none.
dn - The entry DN, which is the key to the record.
id - The entry ID, which is the value of the record.
Returns:
true if the record was written, false if it was not written.
Throws:
com.sleepycat.je.DatabaseException - If an error occurred while attempting to write the record.

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 record to the DN database, where the key and value are already formatted.

Parameters:
txn - A JE database transaction to be used for the database operation, or null if none.
key - A DatabaseEntry containing the record key.
data - A DatabaseEntry containing the record value.
Returns:
true if the record was written, false if it was not written.
Throws:
com.sleepycat.je.DatabaseException - If an error occurred while attempting to write the record.

remove

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

Parameters:
txn - A JE database transaction to be used for the database operation, or null if none.
dn - The entry DN, which is the key to the record.
Returns:
true if the record was removed, false if it was not removed.
Throws:
com.sleepycat.je.DatabaseException - If an error occurred while attempting to remove the record.

get

public EntryID get(com.sleepycat.je.Transaction txn,
                   DN dn,
                   com.sleepycat.je.LockMode lockMode)
            throws com.sleepycat.je.DatabaseException
Fetch the entry ID for a given DN.

Parameters:
txn - A JE database transaction to be used for the database read, or null if none is required.
dn - The DN for which the entry ID is desired.
lockMode - The JE locking mode to be used for the read.
Returns:
The entry ID, or null if the given DN is not in the DN database.
Throws:
com.sleepycat.je.DatabaseException - If an error occurs in the JE database.

getComparator

public java.util.Comparator<byte[]> getComparator()
Gets the comparator for records stored in this database.

Returns:
The comparator for records stored in this database.