org.apache.jackrabbit.core.journal
Class FileRecordIterator

java.lang.Object
  extended by org.apache.jackrabbit.core.journal.FileRecordIterator
All Implemented Interfaces:
RecordIterator

public class FileRecordIterator
extends Object
implements RecordIterator

Record cursor that returns unseen revisions in ascending order on every iteration.


Constructor Summary
FileRecordIterator(File[] logFiles, long startRevision, long stopRevision, NamespaceResolver resolver, NamePathResolver npResolver)
          Creates a new instance of this class.
 
Method Summary
 void close()
          Close this cursor, releasing its resources.
 boolean hasNext()
          Return a flag indicating whether there are next records.
 Record nextRecord()
          Return the next record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRecordIterator

public FileRecordIterator(File[] logFiles,
                          long startRevision,
                          long stopRevision,
                          NamespaceResolver resolver,
                          NamePathResolver npResolver)
Creates a new instance of this class.

Parameters:
logFiles - available log files, sorted ascending by age
startRevision - start point (exclusive)
stopRevision - stop point (inclusive)
Method Detail

hasNext

public boolean hasNext()
Return a flag indicating whether there are next records.

Specified by:
hasNext in interface RecordIterator
Returns:
true if there are more records; false otherwise

nextRecord

public Record nextRecord()
                  throws NoSuchElementException,
                         JournalException
Return the next record. If there are no more recors, throws a NoSuchElementException. If an error occurs, throws a JournalException.

Specified by:
nextRecord in interface RecordIterator
Returns:
next record
Throws:
NoSuchElementException - if there are no more records
JournalException - if another error occurs

close

public void close()
Close this cursor, releasing its resources.

Specified by:
close in interface RecordIterator


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.