if (eventsIterator != null && eventsIterator.hasNext()) {
return true;
}
if (position == -1) {
// we haven't advanced in this iterator yet, so always get the latest journal entries
ChangeJournal journal = session.repository().journal();
recordsIterator = laterThanDate != null ? journal.recordsNewerThan(new org.joda.time.DateTime(laterThanDate),
true, false).iterator() : journal.allRecords(false)
.iterator();
}
while (recordsIterator.hasNext()) {
// navigate to the next "valid" record
JournalRecord record = recordsIterator.next();