com.sun.jndi.ldap.ctl
Class PagedResultsControl

java.lang.Object
  extended by com.sun.jndi.ldap.BasicControl
      extended by com.sun.jndi.ldap.ctl.PagedResultsControl
All Implemented Interfaces:
java.io.Serializable, javax.naming.ldap.Control

public final class PagedResultsControl
extends com.sun.jndi.ldap.BasicControl

This class implements the LDAPv3 Control for paged-results as defined in RFC-2696. The control's value has the following ASN.1 definition:


     realSearchControlValue ::= SEQUENCE {
         size      INTEGER (0..maxInt),
                           -- requested page size from client
                           -- result set size estimate from server
         cookie    OCTET STRING
     }

 

Author:
Vincent Ryan
See Also:
PagedResultsResponseControl, Serialized Form

Field Summary
private  byte[] cookie
          A server-generated cookie.
static java.lang.String OID
          The paged-results control's assigned object identifier is 1.2.840.113556.1.4.319.
private  int pageSize
          The number of entries to return in a page.
private static long serialVersionUID
           
 
Fields inherited from class com.sun.jndi.ldap.BasicControl
criticality, id, value
 
Fields inherited from interface javax.naming.ldap.Control
CRITICAL, NONCRITICAL
 
Constructor Summary
PagedResultsControl(int pageSize)
          Constructs a paged-results critical control.
PagedResultsControl(int pageSize, byte[] cookie, boolean criticality)
          Constructs a paged-results control.
 
Method Summary
private  byte[] setEncodedValue()
           
 
Methods inherited from class com.sun.jndi.ldap.BasicControl
getEncodedValue, getID, isCritical
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OID

public static final java.lang.String OID
The paged-results control's assigned object identifier is 1.2.840.113556.1.4.319.

See Also:
Constant Field Values

pageSize

private int pageSize
The number of entries to return in a page.


cookie

private byte[] cookie
A server-generated cookie.


serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

PagedResultsControl

public PagedResultsControl(int pageSize)
                    throws java.io.IOException
Constructs a paged-results critical control.

Parameters:
pageSize - The number of entries to return in a page.
Throws:
java.io.IOException - If a BER encoding error occurs.

PagedResultsControl

public PagedResultsControl(int pageSize,
                           byte[] cookie,
                           boolean criticality)
                    throws java.io.IOException
Constructs a paged-results control.

A sequence of paged-results can be abandoned by setting the pageSize to zero and setting the cookie to the last cookie received from the server.

Parameters:
pageSize - The number of entries to return in a page.
cookie - A server-generated cookie.
criticality - The control's criticality setting.
Throws:
java.io.IOException - If a BER encoding error occurs.
Method Detail

setEncodedValue

private byte[] setEncodedValue()
                        throws java.io.IOException
Throws:
java.io.IOException