| | |
| | | return db.count(); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | /** |
| | | * Returns whether this database is empty. |
| | | * |
| | | * @return <code>true</code> if this database is empty, <code>false</code> |
| | | * otherwise |
| | | * @throws ChangelogException |
| | | * if a database problem occurs. |
| | | */ |
| | | public boolean isEmpty() throws ChangelogException |
| | | { |
| | | return getLastRecord() == null; |
| | |
| | | return new JEChangeNumberIndexDBCursor(db, startChangeNumber); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | /** |
| | | * Shutdown this DB. |
| | | */ |
| | | public void shutdown() |
| | | { |
| | | if (shutdown) |
| | |
| | | clear(null); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | /** |
| | | * Clear the changes from this DB (from both memory cache and DB storage) for |
| | | * the provided baseDN. |
| | | * |
| | | * @param baseDNToClear |
| | | * The baseDN for which we want to remove all records from this DB, |
| | | * null means all. |
| | | * @throws ChangelogException |
| | | * if a database problem occurs. |
| | | */ |
| | | public void clear(DN baseDNToClear) throws ChangelogException |
| | | { |
| | | if (isEmpty()) |
| | |
| | | trimAge = delay; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | /** |
| | | * Clear the changes from this DB (from both memory cache and DB storage). |
| | | * |
| | | * @throws ChangelogException |
| | | * if a database problem occurs. |
| | | */ |
| | | public void clear() throws ChangelogException |
| | | { |
| | | db.clear(); |