public interface ChangeNumberIndexDB
ChangeNumberIndexRecord
s.
The records are sorted by a global ordering as defined in the CSN class. The index links a changeNumber
to the corresponding CSN. The CSN then links to a corresponding change in one of the ReplicaDBs.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.
|
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.
|
Flowable<ChangeNumberIndexRecord> |
getReader(long startChangeNumber)
Returns a reader of the index database, starting at the position defined by the provided changeNumber, that
completes when it reaches the most recent record.
|
void |
resetChangeNumberTo(long newFirstCN,
Dn baseDN,
CSN newFirstCSN)
Resets ChangeNumber index to the given number and CSN.
|
long getLastGeneratedChangeNumber()
ChangeNumberIndexRecord getOldestRecord() throws ChangelogException
ChangeNumberIndexRecord
in this DB, null when the DB is empty or closedChangelogException
- if a database problem occurs.ChangeNumberIndexRecord getNewestRecord() throws ChangelogException
ChangeNumberIndexRecord
in this DB, null when the DB is empty or closedChangelogException
- if a database problem occurs.long addRecord(ChangeNumberIndexRecord record) throws ChangelogException
Note: this method disregards the changeNumber in the provided record.
record
- The ChangeNumberIndexRecord
to add to this DB.ChangelogException
- if a database problem occurs.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.startChangeNumber
- The position where the iterator must start.ChangelogException
- if a database problem occurs.Flowable<ChangeNumberIndexRecord> getReader(long startChangeNumber)
Intended use case is to perform a search against cn=changelog.
Reading will start only when the returned Flowable
has been subscribed to.
startChangeNumber
- The position where the reader must start. If the change number is not found, then a
ChangelogException
will be thrownvoid resetChangeNumberTo(long newFirstCN, Dn baseDN, CSN newFirstCSN) throws ChangelogException
newFirstCN
- the new change number to appear as first change in the external changelogbaseDN
- the new record for the first changenewFirstCSN
- the CSN of the new first changeChangelogException
- if an error occurs during resetCopyright 2010-2022 ForgeRock AS.