public class CursorList extends org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry> implements EntryFilteringCursor
List of Cursors. Optionally, the
Cursor may be limited to a specific range within the list.
This class is modeled based on the implementation of ListCursor
WARN this is only used internally !| Modifier and Type | Field and Description |
|---|---|
private boolean |
closed
flag to detect the closed cursor
|
private EntryFilteringCursor |
currentCursor
The current cursor being used
|
private int |
end
The ending position for the cursor in the list.
|
private int |
index
The current position in the list
|
private static boolean |
IS_DEBUG
Speedup for logs
|
private java.util.List<EntryFilteringCursor> |
list
The inner List
|
private int |
listSize
The number of cursors in the list
|
private static org.slf4j.Logger |
LOG
The logger for this class
|
private static org.slf4j.Logger |
LOG_CURSOR
A dedicated log for cursors
|
private SearchOperationContext |
searchContext
the operation context
|
private int |
start
The starting position for the cursor in the list.
|
| Constructor and Description |
|---|
CursorList(int start,
java.util.List<EntryFilteringCursor> list,
int end,
SearchOperationContext searchContext)
Creates a new ListCursor with lower (inclusive) and upper (exclusive)
bounds.
|
CursorList(java.util.List<EntryFilteringCursor> list,
SearchOperationContext searchContext)
Creates a new ListCursor without specific bounds: the bounds are
acquired from the size of the list.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEntryFilter(EntryFilter filter)
Adds an entry filter to this BaseEntryFilteringCursor at the very end of
the filter list.
|
void |
after(org.apache.directory.api.ldap.model.entry.Entry element) |
void |
afterLast() |
boolean |
available() |
void |
before(org.apache.directory.api.ldap.model.entry.Entry element) |
void |
beforeFirst() |
void |
close() |
void |
close(java.lang.Exception reason) |
boolean |
first() |
org.apache.directory.api.ldap.model.entry.Entry |
get() |
java.util.List<EntryFilter> |
getEntryFilters()
Gets an unmodifiable list of EntryFilters applied.
|
SearchOperationContext |
getOperationContext() |
boolean |
isAbandoned() |
boolean |
isAfterLast() |
boolean |
isBeforeFirst() |
boolean |
isClosed() |
boolean |
isFirst() |
boolean |
isLast() |
java.util.Iterator<org.apache.directory.api.ldap.model.entry.Entry> |
iterator() |
boolean |
last() |
boolean |
next() |
boolean |
previous() |
void |
setAbandoned(boolean abandoned) |
void |
setClosureMonitor(org.apache.directory.api.ldap.model.cursor.ClosureMonitor monitor) |
checkNotClosed, toStringprivate static final org.slf4j.Logger LOG_CURSOR
private static final boolean IS_DEBUG
private final java.util.List<EntryFilteringCursor> list
private final int start
private final int end
private final int listSize
private int index
private EntryFilteringCursor currentCursor
private SearchOperationContext searchContext
private boolean closed
private static final org.slf4j.Logger LOG
public CursorList(int start,
java.util.List<EntryFilteringCursor> list,
int end,
SearchOperationContext searchContext)
start - the lower bound indexlist - the list this ListCursor operates onend - the upper bound indexpublic CursorList(java.util.List<EntryFilteringCursor> list, SearchOperationContext searchContext)
list - the backing for this ListCursorpublic boolean available()
available in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>public void before(org.apache.directory.api.ldap.model.entry.Entry element)
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
before in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic void after(org.apache.directory.api.ldap.model.entry.Entry element)
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
after in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>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
beforeFirst in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>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
afterLast in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>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
first in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean last()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
last in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean isFirst()
isFirst in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>isFirst in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public boolean isLast()
isLast in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>isLast in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public boolean isAfterLast()
isAfterLast in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>isAfterLast in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public boolean isBeforeFirst()
isBeforeFirst in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>isBeforeFirst in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public boolean previous()
throws org.apache.directory.api.ldap.model.exception.LdapException,
org.apache.directory.api.ldap.model.cursor.CursorException
previous in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>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
next in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>org.apache.directory.api.ldap.model.exception.LdapExceptionorg.apache.directory.api.ldap.model.cursor.CursorExceptionpublic org.apache.directory.api.ldap.model.entry.Entry get()
throws org.apache.directory.api.ldap.model.cursor.CursorException
get in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>org.apache.directory.api.ldap.model.cursor.CursorExceptionpublic boolean addEntryFilter(EntryFilter filter)
addEntryFilter in interface EntryFilteringCursorfilter - a filter to apply to the entriesList.add(Object)public java.util.List<EntryFilter> getEntryFilters()
getEntryFilters in interface EntryFilteringCursorpublic SearchOperationContext getOperationContext()
getOperationContext in interface EntryFilteringCursorpublic boolean isAbandoned()
public void setAbandoned(boolean abandoned)
public void close()
close in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>close in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public void close(java.lang.Exception reason)
close in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>close in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public boolean isClosed()
isClosed in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>isClosed in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public java.util.Iterator<org.apache.directory.api.ldap.model.entry.Entry> iterator()
iterator in interface java.lang.Iterable<org.apache.directory.api.ldap.model.entry.Entry>iterator in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>public void setClosureMonitor(org.apache.directory.api.ldap.model.cursor.ClosureMonitor monitor)
setClosureMonitor in interface org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry>setClosureMonitor in class org.apache.directory.api.ldap.model.cursor.AbstractCursor<org.apache.directory.api.ldap.model.entry.Entry>