org.opends.server.replication.server
Class ReplicationIterator

java.lang.Object
  extended by org.opends.server.replication.server.ReplicationIterator

public class ReplicationIterator
extends java.lang.Object

This class allows to iterate through the changes received from a given LDAP Server Identifier.


Constructor Summary
ReplicationIterator(short id, ReplicationDB db, ChangeNumber changeNumber)
          Creates a new ReplicationIterator.
 
Method Summary
protected  void finalize()
          Called by the Gc when the object is garbage collected Release the cursor in case the iterator was badly used and releaseCursor was never called.
 UpdateMessage getChange()
          Get the UpdateMessage where the iterator is currently set.
 boolean next()
          Go to the next change in the ReplicationDB or in the server Queue.
 void releaseCursor()
          Release the resources and locks used by this Iterator.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplicationIterator

public ReplicationIterator(short id,
                           ReplicationDB db,
                           ChangeNumber changeNumber)
                    throws java.lang.Exception,
                           com.sleepycat.je.DatabaseException
Creates a new ReplicationIterator. All created iterator must be released by the caller using the releaseCursor() method.

Parameters:
id - the Identifier of the server on which the iterator applies.
db - The db where the iterator must be created.
changeNumber - The ChangeNumber after which the iterator must start.
Throws:
java.lang.Exception - If there is no other change to push after change with changeNumber number.
com.sleepycat.je.DatabaseException - if a database problem happened.
Method Detail

getChange

public UpdateMessage getChange()
Get the UpdateMessage where the iterator is currently set.

Returns:
The UpdateMessage where the iterator is currently set.

next

public boolean next()
Go to the next change in the ReplicationDB or in the server Queue.

Returns:
false if the iterator is already on the last change before this call.

releaseCursor

public void releaseCursor()
Release 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.


finalize

protected void finalize()
Called by the Gc when the object is garbage collected Release the cursor in case the iterator was badly used and releaseCursor was never called.

Overrides:
finalize in class java.lang.Object