public class JEChangeNumberIndexDB extends Object implements ChangeNumberIndexDB
DBCursor that can be used to read all changes
from a given change number.
This class publishes some monitoring information below
cn=monitor.
| Constructor and Description |
|---|
JEChangeNumberIndexDB(ReplicationDbEnv dbEnv)
Creates a new JEChangeNumberIndexDB associated to a given LDAP server.
|
| Modifier and Type | Method and Description |
|---|---|
long |
addRecord(ChangeNumberIndexRecord record)
Add an update to the list of messages that must be saved to this DB managed
by this DB and return the changeNumber associated to this record.
|
void |
clear()
Clear the changes from this DB (from both memory cache and DB storage).
|
long |
count()
Get the number of changes.
|
DBCursor<ChangeNumberIndexRecord> |
getCursorFrom(long startChangeNumber)
Generate a new
DBCursor that allows to browse the db managed by
this object and starting at the position defined by a given changeNumber. |
long |
getLastGeneratedChangeNumber()
Returns the last generated change number.
|
ChangeNumberIndexRecord |
getNewestRecord()
Get the newest record stored in this DB.
|
ChangeNumberIndexRecord |
getOldestRecord()
Get the oldest record stored in this DB.
|
boolean |
isEmpty()
Returns whether this database is empty.
|
CSN |
purgeUpTo(CSN purgeCSN)
Synchronously purges the change number index DB up to and excluding the
provided timestamp.
|
void |
removeDomain(DN baseDNToClear)
Clear the changes from this DB (from both memory cache and DB storage) for
the provided baseDN.
|
void |
shutdown()
Shutdown this DB.
|
String |
toString() |
public JEChangeNumberIndexDB(ReplicationDbEnv dbEnv) throws ChangelogException
dbEnv - the Database Env to use to create the ReplicationServer DB.
server for this domain.ChangelogException - If a database problem happenedpublic long addRecord(ChangeNumberIndexRecord record) throws ChangelogException
Note: this method disregards the changeNumber in the provided record.
addRecord in interface ChangeNumberIndexDBrecord - The ChangeNumberIndexRecord to add to this DB.ChangelogException - if a database problem occurs.public ChangeNumberIndexRecord getOldestRecord() throws ChangelogException
getOldestRecord in interface ChangeNumberIndexDBChangeNumberIndexRecord in this DB, null
when the DB is empty or closedChangelogException - if a database problem occurs.public ChangeNumberIndexRecord getNewestRecord() throws ChangelogException
getNewestRecord in interface ChangeNumberIndexDBChangeNumberIndexRecord in this DB, null
when the DB is empty or closedChangelogException - if a database problem occurs.public long getLastGeneratedChangeNumber()
getLastGeneratedChangeNumber in interface ChangeNumberIndexDBpublic long count()
public boolean isEmpty() throws ChangelogException
true if this database is empty, false
otherwiseChangelogException - if a database problem occurs.public DBCursor<ChangeNumberIndexRecord> getCursorFrom(long startChangeNumber) throws ChangelogException
DBCursor that allows to browse the db managed by
this object and starting at the position defined by a given changeNumber.getCursorFrom in interface ChangeNumberIndexDBstartChangeNumber - The position where the iterator must start.ChangelogException - if a database problem occurs.public void shutdown()
public CSN purgeUpTo(CSN purgeCSN) throws ChangelogException
purgeCSN - the timestamp up to which purging must happenChangelogException - if a database problem occurs.public void removeDomain(DN baseDNToClear) throws ChangelogException
baseDNToClear - The baseDN for which we want to remove all records from this DB,
null means all.ChangelogException - if a database problem occurs.public void clear() throws ChangelogException
ChangelogException - if a database problem occurs.Copyright © 2010-2015 ForgeRock AS. All Rights Reserved.