public class PagedSearchContext
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private byte[] |
cookie
The cookie key
|
private java.util.concurrent.atomic.AtomicInteger |
cookieValue
The integer value for the cookie
|
private int |
currentPosition
The current position in the cursor
|
private org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> |
cursor
The associated cursor for the current search request
|
private org.apache.directory.api.ldap.model.message.SearchRequest |
previousSearchRequest
The previous search request
|
| Constructor and Description |
|---|
PagedSearchContext(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest)
Creates a new instance of this class, storing the SearchRequest into it.
|
| Modifier and Type | Method and Description |
|---|---|
private java.util.Set<java.lang.String> |
buildAttributeSet(org.apache.directory.api.ldap.model.message.SearchRequest request,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Build a set of OIDs from the list of attributes we have in the search request
|
byte[] |
getCookie()
Compute a new key for this cookie, based on the current searchRequest
hashCode and the current position.
|
int |
getCookieValue() |
int |
getCurrentPosition() |
org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> |
getCursor() |
byte[] |
getNewCookie()
Compute a new cookie, if the previous one already exists.
|
org.apache.directory.api.ldap.model.message.SearchRequest |
getPreviousSearchRequest() |
boolean |
hasSameRequest(org.apache.directory.api.ldap.model.message.SearchRequest request,
LdapSession session)
Compare the previous search request and the new one, and return
true if they are equal.
|
void |
incrementCurrentPosition(int returnedEntries)
Set the new current position, incrementing it with the
number of returned entries.
|
void |
setCursor(org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> cursor)
Set the new cursor for this search request
|
java.lang.String |
toString() |
private org.apache.directory.api.ldap.model.message.SearchRequest previousSearchRequest
private int currentPosition
private byte[] cookie
private java.util.concurrent.atomic.AtomicInteger cookieValue
private org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> cursor
public PagedSearchContext(org.apache.directory.api.ldap.model.message.SearchRequest searchRequest)
public byte[] getCookie()
public int getCookieValue()
public byte[] getNewCookie()
private java.util.Set<java.lang.String> buildAttributeSet(org.apache.directory.api.ldap.model.message.SearchRequest request,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
public boolean hasSameRequest(org.apache.directory.api.ldap.model.message.SearchRequest request,
LdapSession session)
request - The new SearchRequestpublic int getCurrentPosition()
public void incrementCurrentPosition(int returnedEntries)
returnedEntries - The number of returned entriespublic org.apache.directory.api.ldap.model.message.SearchRequest getPreviousSearchRequest()
public org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> getCursor()
public void setCursor(org.apache.directory.api.ldap.model.cursor.Cursor<org.apache.directory.api.ldap.model.entry.Entry> cursor)
cursor - The associated cursorpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()