| | |
| | | /** The backend configuration. */ |
| | | private PluggableBackendCfg config; |
| | | |
| | | /** The JE database environment. */ |
| | | /** The database storage. */ |
| | | private final Storage storage; |
| | | |
| | | /** The DN database maps a normalized DN string to an entry ID (8 bytes). */ |
| | |
| | | /** |
| | | * Opens the entryContainer for reading and writing. |
| | | * |
| | | * @param txn The database transaction |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @param txn a non null database transaction |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws ConfigException if a configuration related error occurs. |
| | | */ |
| | | void open(WriteableTransaction txn) throws StorageRuntimeException, ConfigException |
| | |
| | | /** |
| | | * Closes the entry container. |
| | | * |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | */ |
| | | @Override |
| | | public void close() throws StorageRuntimeException |
| | |
| | | * Determine the highest entryID in the entryContainer. |
| | | * The entryContainer must already be open. |
| | | * |
| | | * @param txn The database transaction |
| | | * @param txn a non null database transaction |
| | | * @return The highest entry ID. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | */ |
| | | EntryID getHighestEntryID(ReadableTransaction txn) throws StorageRuntimeException |
| | | { |
| | |
| | | * number of entries immediately under the given entry. |
| | | * @return The number of subordinate entries for the given entry or -1 if |
| | | * the entry does not exist. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | */ |
| | | long getNumSubordinates(final DN entryDN, final boolean subtree) |
| | | throws StorageRuntimeException |
| | |
| | | * @throws DirectoryException |
| | | * If a problem occurs while processing the |
| | | * search. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws CanceledOperationException if this operation should be cancelled. |
| | | */ |
| | | void search(final SearchOperation searchOperation) |
| | |
| | | /** |
| | | * Returns the entry corresponding to the provided entryID. |
| | | * |
| | | * @param txn The database transaction |
| | | * @param txn a non null database transaction |
| | | * @param entryID |
| | | * the id of the entry to retrieve |
| | | * @return the entry corresponding to the provided entryID |
| | |
| | | * performed internally. |
| | | * @throws DirectoryException If a problem occurs while trying to add the |
| | | * entry. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws CanceledOperationException if this operation should be cancelled. |
| | | */ |
| | | void addEntry(final Entry entry, final AddOperation addOperation) |
| | |
| | | * deletes performed internally. |
| | | * @throws DirectoryException If a problem occurs while trying to remove the |
| | | * entry. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws CanceledOperationException if this operation should be cancelled. |
| | | */ |
| | | void deleteEntry(final DN entryDN, final DeleteOperation deleteOperation) |
| | |
| | | * @param modifyOperation The modify operation with which this action is |
| | | * associated. This may be <CODE>null</CODE> for |
| | | * modifications performed internally. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | * @throws CanceledOperationException if this operation should be cancelled. |
| | | */ |
| | |
| | | * If this backend noticed and reacted |
| | | * to a request to cancel or abandon the |
| | | * modify DN operation. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | */ |
| | | void renameEntry(final DN currentDN, final Entry entry, final ModifyDNOperation modifyDNOperation) |
| | | throws StorageRuntimeException, DirectoryException, CanceledOperationException |
| | |
| | | * @param buffer The index buffer used to buffer up the index changes. |
| | | * @param entry The entry to be inserted into the indexes. |
| | | * @param entryID The ID of the entry to be inserted into the indexes. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | private void indexInsertEntry(IndexBuffer buffer, Entry entry, EntryID entryID) |
| | |
| | | * @param buffer The index buffer used to buffer up the index changes. |
| | | * @param entry The entry to be removed from the indexes. |
| | | * @param entryID The ID of the entry to be removed from the indexes. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | private void indexRemoveEntry(IndexBuffer buffer, Entry entry, EntryID entryID) |
| | |
| | | * @param newEntry The contents of the entry after the change. |
| | | * @param entryID The ID of the entry that was changed. |
| | | * @param mods The sequence of modifications made to the entry. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | * @throws DirectoryException If a Directory Server error occurs. |
| | | */ |
| | | private void indexModifications(IndexBuffer buffer, Entry oldEntry, Entry newEntry, |
| | |
| | | /** |
| | | * Get a count of the number of entries stored in this entry container. |
| | | * |
| | | * @param txn The database transaction |
| | | * @param txn a non null database transaction |
| | | * @return The number of entries stored in this entry container. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | */ |
| | | long getEntryCount(ReadableTransaction txn) throws StorageRuntimeException |
| | | { |
| | |
| | | * Delete this entry container from disk. The entry container should be |
| | | * closed before calling this method. |
| | | * |
| | | * @param txn The database transaction |
| | | * @param txn a non null database transaction |
| | | * @throws StorageRuntimeException If an error occurs while removing the entry |
| | | * container. |
| | | */ |
| | |
| | | /** |
| | | * Remove a database from disk. |
| | | * |
| | | * @param txn The database transaction |
| | | * @param txn a non null database transaction |
| | | * @param database The database container to remove. |
| | | * @throws StorageRuntimeException If an error occurs while attempting to delete the |
| | | * database. |
| | |
| | | * Removes a attribute index from disk. |
| | | * |
| | | * @param attributeIndex The attribute index to remove. |
| | | * @throws StorageRuntimeException If an JE database error occurs while attempting |
| | | * @throws StorageRuntimeException If an database error occurs while attempting |
| | | * to delete the index. |
| | | */ |
| | | private void deleteAttributeIndex(WriteableTransaction txn, AttributeIndex attributeIndex) |
| | |
| | | * existing databases in use by this entry container. |
| | | * |
| | | * @param newBaseDN The new database prefix to use. |
| | | * @throws StorageRuntimeException If an error occurs in the JE database. |
| | | * @throws StorageRuntimeException If an error occurs in the database. |
| | | */ |
| | | void setDatabasePrefix(final String newBaseDN) throws StorageRuntimeException |
| | | { |
| | |
| | | /** |
| | | * Clear the contents for a database from disk. |
| | | * |
| | | * @param txn The database transaction |
| | | * @param txn a non null database transaction |
| | | * @param database The database to clear. |
| | | * @throws StorageRuntimeException if a JE database error occurs. |
| | | * @throws StorageRuntimeException if a database error occurs. |
| | | */ |
| | | void clearDatabase(WriteableTransaction txn, DatabaseContainer database) |
| | | throws StorageRuntimeException |
| | |
| | | /** |
| | | * Creates a new index for an attribute. |
| | | * |
| | | * @param txn The database transaction |
| | | * @param txn a non null database transaction |
| | | * @param indexName the name to give to the new index |
| | | * @param indexer the indexer to use when inserting data into the index |
| | | * @param indexEntryLimit the index entry limit |