Class MultiDomainDBCursor
java.lang.Object
org.opends.server.replication.server.changelog.file.MultiDomainDBCursor
- All Implemented Interfaces:
Closeable,AutoCloseable,DBCursor<UpdateMsg>
Cursor iterating over all the replication domains known to the changelog DB.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opends.server.replication.server.changelog.api.DBCursor
DBCursor.CursorOptions, DBCursor.PositionStrategy -
Constructor Summary
ConstructorsConstructorDescriptionMultiDomainDBCursor(ReplicationDomainDB domainDB, DBCursor.CursorOptions options) Builds a MultiDomainDBCursor instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidAdds a cursor to this composite cursor.voidaddDomain(Dn baseDN, ServerState startAfterState) Adds a replication domain for this cursor to iterate over.voidclose()Release the resources and locks used by this Iterator.getData()Returns the data associated to the cursor that returned the current record.Getter for the current record.protected voidCalled when implementors should incorporate new cursors into the current composite DBCursor.booleannext()Skip to the next record of the database.voidremoveDomain(Dn baseDN) Removes a replication domain from this cursor and stops iterating over it.toString()
-
Constructor Details
-
MultiDomainDBCursor
Builds a MultiDomainDBCursor instance.- Parameters:
domainDB- the replication domain management DBoptions- The cursor options
-
-
Method Details
-
addDomain
Adds a replication domain for this cursor to iterate over. Added cursors will be created and iterated over on the next call toDBCursor.next().- Parameters:
baseDN- the replication domain's baseDNstartAfterState- theServerStateafter which to start iterating
-
incorporateNewCursors
Called when implementors should incorporate new cursors into the current composite DBCursor. Implementors should calladdCursor(DBCursor, Object)to do so.- Throws:
ChangelogException- if a database problem occurred
-
removeDomain
Removes a replication domain from this cursor and stops iterating over it. Removed cursors will be effectively removed on the next call toDBCursor.next().FIXME this method should not immediately remove the cursors because it could change the record returned by
DBCursor.getRecord(). All the cursor code should be replaced by the reactive changelog.- Parameters:
baseDN- the replication domain's baseDN
-
close
public void close()Description copied from interface:DBCursorRelease the resources and locks used by this Iterator. This method must be called when the iterator is no longer used. Failure to do it could cause DB deadlock. -
next
Description copied from interface:DBCursorSkip to the next record of the database.- Specified by:
nextin interfaceDBCursor<T>- Returns:
- true if has next, false otherwise
- Throws:
ChangelogException- When database exception raised.
-
addCursor
Adds a cursor to this composite cursor. It first callsDBCursor.next()to verify whether it is exhausted or not.- Parameters:
cursor- the cursor to add to this compositedata- the data associated to the provided cursor- Throws:
ChangelogException- if a database problem occurred
-
getRecord
Description copied from interface:DBCursorGetter for the current record.This method will always return
nullwhen- a call to
DBCursor.next()returnsfalse - it is called before the very first call to
DBCursor.next().
- a call to
-
getData
Returns the data associated to the cursor that returned the current record.- Returns:
- the data associated to the cursor that returned the current record.
-
toString
-