public class ReplicaJournalCursor extends org.apache.directory.api.ldap.model.cursor.AbstractCursor<ReplicaEventMessage>
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
consumerCsn
the consumer's CSN based on which messages will be qualified for sending
|
private static boolean |
IS_DEBUG
Speedup for logs
|
private JdbmTable<java.lang.String,ReplicaEventMessage> |
journal
the event log journal
|
private static org.slf4j.Logger |
LOG
Logger for this class
|
private static org.slf4j.Logger |
LOG_CURSOR
A dedicated log for cursors
|
private ReplicaEventMessage |
qualifiedEvtMsg |
private boolean |
skipQualifying
used while cleaning up the log
|
private org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.cursor.Tuple<java.lang.String,ReplicaEventMessage>> |
tupleCursor
the underlying journal's cursor
|
| Constructor and Description |
|---|
ReplicaJournalCursor(JdbmTable<java.lang.String,ReplicaEventMessage> journal,
java.lang.String consumerCsn)
Creates a cursor on top of the given journal
|
| Modifier and Type | Method and Description |
|---|---|
void |
after(ReplicaEventMessage arg0) |
void |
afterLast() |
boolean |
available() |
void |
before(ReplicaEventMessage arg0) |
void |
beforeFirst() |
void |
close() |
void |
close(java.lang.Exception cause) |
protected void |
delete()
delete the current message
used for internal log cleanup ONLY
|
boolean |
first() |
ReplicaEventMessage |
get() |
private boolean |
isQualified(java.lang.String csn,
ReplicaEventMessage evtMsg)
selects the current queue entry if qualified for sending to the consumer
|
java.util.Iterator<ReplicaEventMessage> |
iterator() |
boolean |
last() |
boolean |
next() |
boolean |
previous() |
protected void |
skipQualifyingWhileFetching()
sets the flag to skip CSN based checking while traversing
used for internal log cleanup ONLY
|
checkNotClosed, isAfterLast, isBeforeFirst, isClosed, isFirst, isLast, setClosureMonitor, toStringprivate static final org.slf4j.Logger LOG
private static final org.slf4j.Logger LOG_CURSOR
private static final boolean IS_DEBUG
private org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.cursor.Tuple<java.lang.String,ReplicaEventMessage>> tupleCursor
private JdbmTable<java.lang.String,ReplicaEventMessage> journal
private java.lang.String consumerCsn
private ReplicaEventMessage qualifiedEvtMsg
private boolean skipQualifying
public ReplicaJournalCursor(JdbmTable<java.lang.String,ReplicaEventMessage> journal, java.lang.String consumerCsn) throws java.lang.Exception
journal - the log journalconsumerCsn - the consumer's CSN taken from cookiejava.lang.Exceptionpublic void after(ReplicaEventMessage arg0) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void afterLast()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean available()
public void before(ReplicaEventMessage arg0) throws org.apache.directory.api.ldap.model.exception.LdapException, org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void beforeFirst()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean first()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic ReplicaEventMessage get() throws org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.cursor.CursorExceptionprivate boolean isQualified(java.lang.String csn,
ReplicaEventMessage evtMsg)
throws org.apache.directory.api.ldap.model.exception.LdapException
java.lang.Exceptionorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic boolean last()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean next()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean previous()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void close()
close in interface org.apache.directory.api.ldap.model.cursor.Cursor<ReplicaEventMessage>close in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<ReplicaEventMessage>public void close(java.lang.Exception cause)
close in interface org.apache.directory.api.ldap.model.cursor.Cursor<ReplicaEventMessage>close in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<ReplicaEventMessage>protected void skipQualifyingWhileFetching()
protected void delete()
public java.util.Iterator<ReplicaEventMessage> iterator()
iterator in interface java.lang.Iterable<ReplicaEventMessage>iterator in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<ReplicaEventMessage>