Class ReplicaCursor
- java.lang.Object
-
- org.opends.server.replication.server.changelog.file.ReplicaCursor
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opends.server.replication.server.changelog.api.DBCursor
DBCursor.CursorOptions, DBCursor.KeyMatchingStrategy, DBCursor.PositionStrategy
-
-
Constructor Summary
Constructors Constructor Description ReplicaCursor(DBCursor<UpdateMsg> cursor, CSN offlineCSN, ReplicaId replicaId, ReplicationDomainDB domainDB)Creates a ReplicaCursor object with a cursor to decorate and an offlineCSN to return as part of a ReplicaOfflineMsg.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Release the resources and locks used by this Iterator.UpdateMsggetRecord()Getter for the current record.ReplicaIdgetReplicaId()Returns the replica identifier that this cursor is associated to.booleannext()Skip to the next record of the database.voidsetOfflineCSN(CSN offlineCSN)Sets the offline CSN to be returned by this cursor.StringtoString()
-
-
-
Constructor Detail
-
ReplicaCursor
public ReplicaCursor(DBCursor<UpdateMsg> cursor, CSN offlineCSN, ReplicaId replicaId, ReplicationDomainDB domainDB)
Creates a ReplicaCursor object with a cursor to decorate and an offlineCSN to return as part of a ReplicaOfflineMsg.- Parameters:
cursor- the non-null underlying cursor that needs to be exhausted before we return a ReplicaOfflineMsgofflineCSN- the offline CSN from which to builder theReplicaOfflineMsgto returnreplicaId- the replica identifierdomainDB- the DB for the provided replication domain
-
-
Method Detail
-
setOfflineCSN
public void setOfflineCSN(CSN offlineCSN)
Sets the offline CSN to be returned by this cursor.- Parameters:
offlineCSN- The offline CSN to be returned by this cursor. If null, it will unset any previous offlineCSN and never return a ReplicaOfflineMsg
-
getRecord
public UpdateMsg getRecord()
Description copied from interface:DBCursorGetter for the current record.
-
getReplicaId
public ReplicaId getReplicaId()
Returns the replica identifier that this cursor is associated to.- Returns:
- the replica identifier that this cursor is associated to
-
next
public boolean next() throws ChangelogExceptionDescription copied from interface:DBCursorSkip to the next record of the database.- Specified by:
nextin interfaceDBCursor<UpdateMsg>- Returns:
- true if has next, false otherwise
- Throws:
ChangelogException- When database exception raised.
-
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.
-
-