org.apache.directory.shared.ldap.message.control
Class PagedSearchControl

java.lang.Object
  extended by org.apache.directory.shared.ldap.message.control.InternalAbstractControl
      extended by org.apache.directory.shared.ldap.message.control.PagedSearchControl
All Implemented Interfaces:
java.io.Serializable, javax.naming.ldap.Control, InternalControl

public class PagedSearchControl
extends InternalAbstractControl

A request/response control used to implement a simple paging of search results. This is an implementation of RFC 2696 : LDAP Control Extension for Simple Paged Results Manipulation

    This control is included in the searchRequest and searchResultDone
    messages as part of the controls field of the LDAPMessage, as defined
    in Section 4.1.12 of [LDAPv3]. The structure of this control is as
    follows:

 pagedResultsControl ::= SEQUENCE {
         controlType     1.2.840.113556.1.4.319,
         criticality     BOOLEAN DEFAULT FALSE,
         controlValue    searchControlValue
 }
 
 The searchControlValue is an OCTET STRING wrapping the BER-encoded
 version of the following SEQUENCE:
 
 realSearchControlValue ::= SEQUENCE {
         size            INTEGER (0..maxInt),
                                 -- requested page size from client
                                 -- result set size estimate from server
         cookie          OCTET STRING
 }
 
 

Version:
$Rev: 678621 $
Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
static java.lang.String CONTROL_OID
          The Paged Search Control OID
 
Fields inherited from interface javax.naming.ldap.Control
CRITICAL, NONCRITICAL
 
Constructor Summary
PagedSearchControl()
          Creates a new instance of PagedSearchControl.
 
Method Summary
 byte[] getCookie()
           
 int getCookieValue()
           
 byte[] getEncodedValue()
          Encode the control.
 int getSize()
           
 void setCookie(byte[] cookie)
          Set the cookie
 void setSize(int size)
          Set the number of entry requested or returned
 
Methods inherited from class org.apache.directory.shared.ldap.message.control.InternalAbstractControl
getID, isCritical, setCritical, setID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTROL_OID

public static final java.lang.String CONTROL_OID
The Paged Search Control OID

See Also:
Constant Field Values
Constructor Detail

PagedSearchControl

public PagedSearchControl()
Creates a new instance of PagedSearchControl.

Method Detail

getSize

public int getSize()
Returns:
The requested or returned number of entries

setSize

public void setSize(int size)
Set the number of entry requested or returned

Parameters:
size - The number of entries

getCookie

public byte[] getCookie()
Returns:
The stored cookie

getCookieValue

public int getCookieValue()
Returns:
The integer value for the current cookie

setCookie

public void setCookie(byte[] cookie)
Set the cookie

Parameters:
cookie - The cookie to store in this control

getEncodedValue

public byte[] getEncodedValue()
Encode the control.



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