LDAP Classes
Implements Java LDAP

com.novell.ldap.controls
Class LDAPVirtualListControl

java.lang.Object
  extended bycom.novell.ldap.LDAPControl
      extended bycom.novell.ldap.controls.LDAPVirtualListControl
All Implemented Interfaces:
java.lang.Cloneable, java.io.Externalizable, java.io.Serializable

public class LDAPVirtualListControl
extends LDAPControl

LDAPVirtualListControl is a Server Control used to specify that results from a search are to be returned in pages - which are subsets of the entire virtual result set.

On success, an updated LDAPVirtualListResponse object is returned as a response Control, containing information on the virtual list size and the actual first index. This object can then be used by the client with a new requested position or length and sent to the server to obtain a different segment of the virtual list.

Sample Code: VLVControl.java

See Also:
Serialized Form

Constructor Summary
LDAPVirtualListControl(int startIndex, int beforeCount, int afterCount, int contentCount)
          Use this constructor to fetch a subset when the size of the virtual list is known,

LDAPVirtualListControl(int startIndex, int beforeCount, int afterCount, int contentCount, java.lang.String context)
          Use this constructor to fetch a subset when the size of the virtual list is known,

LDAPVirtualListControl(java.lang.String jumpTo, int beforeCount, int afterCount)
          Constructs a virtual list control using the specified filter expression.
LDAPVirtualListControl(java.lang.String jumpTo, int beforeCount, int afterCount, java.lang.String context)
          Constructs a virtual list control using the specified filter expression along with an optional server context.
 
Method Summary
 int getAfterCount()
          Returns the number of entries after the top/center one to return per page of results.
 int getBeforeCount()
          Returns the number of entries before the top/center one to return per page of results.
 java.lang.String getContext()
          Returns the cookie used by some servers to optimize the processing of virtual list requests.
 int getListSize()
          Returns the size of the virtual search results list.
 void setContext(java.lang.String context)
          Sets the cookie used by some servers to optimize the processing of virtual list requests.
 void setListSize(int size)
          Sets the assumed size of the virtual search results list.
 void setRange(int listIndex, int beforeCount, int afterCount)
          Sets the center or starting list index to return, and the number of results before and after.
 void setRange(java.lang.String jumpTo, int beforeCount, int afterCount)
          Sets the center or starting list index to return, and the number of results before and after.
 
Methods inherited from class com.novell.ldap.LDAPControl
clone, getID, getValue, isCritical, readDSML, readExternal, register, setValue, toString, writeDSML, writeExternal
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LDAPVirtualListControl

public LDAPVirtualListControl(java.lang.String jumpTo,
                              int beforeCount,
                              int afterCount)
Constructs a virtual list control using the specified filter expression.

The expression specifies the first entry to be used for the virtual search results. The other two paramers are the number of entries before and after a located index to be returned.

Parameters:
jumpTo - A search expression that defines the first element to be returned in the virtual search results. The filter expression in the search operation itself may be, for example, "objectclass=person" and the jumpTo expression in the virtual list control may be "cn=m*", to retrieve a subset of entries starting at or centered around those with a common name beginning with the letter "M".

beforeCount - The number of entries before startIndex (the reference entry) to be returned.

afterCount - The number of entries after startIndex to be returned.


LDAPVirtualListControl

public LDAPVirtualListControl(java.lang.String jumpTo,
                              int beforeCount,
                              int afterCount,
                              java.lang.String context)
Constructs a virtual list control using the specified filter expression along with an optional server context.

The expression specifies the first entry to be used for the virtual search results. The other two paramers are the number of entries before and after a located index to be returned.

Parameters:
jumpTo - A search expression that defines the first element to be returned in the virtual search results. The filter expression in the search operation itself may be, for example, "objectclass=person" and the jumpTo expression in the virtual list control may be "cn=m*", to retrieve a subset of entries starting at or centered around those with a common name beginning with the letter "M".

beforeCount - The number of entries before startIndex (the reference entry) to be returned.

afterCount - The number of entries after startIndex to be returned.

context - Used by some implementations to process requests more efficiently. The context should be null on the first search, and thereafter it should be whatever was returned by the server in the virtual list response control.

LDAPVirtualListControl

public LDAPVirtualListControl(int startIndex,
                              int beforeCount,
                              int afterCount,
                              int contentCount)
Use this constructor to fetch a subset when the size of the virtual list is known,

Parameters:
beforeCount - The number of entries before startIndex (the reference entry) to be returned.

afterCount - The number of entries after startIndex to be returned.

startIndex - The index of the reference entry to be returned.

contentCount - The total number of entries assumed to be in the list. This is a number returned on a previous search, in the LDAPVirtualListResponse. The server may use this number to adjust the returned subset offset.

LDAPVirtualListControl

public LDAPVirtualListControl(int startIndex,
                              int beforeCount,
                              int afterCount,
                              int contentCount,
                              java.lang.String context)
Use this constructor to fetch a subset when the size of the virtual list is known,

Parameters:
beforeCount - The number of entries before startIndex (the reference entry) to be returned.

afterCount - The number of entries after startIndex to be returned.

startIndex - The index of the reference entry to be returned.

contentCount - The total number of entries assumed to be in the list. This is a number returned on a previous search, in the LDAPVirtualListResponse. The server may use this number to adjust the returned subset offset.

context - Used by some implementations to process requests more efficiently. The context should be null on the first search, and thereafter it should be whatever was returned by the server in the virtual list response control.
Method Detail

getAfterCount

public int getAfterCount()
Returns the number of entries after the top/center one to return per page of results.


getBeforeCount

public int getBeforeCount()
Returns the number of entries before the top/center one to return per page of results.


getListSize

public int getListSize()
Returns the size of the virtual search results list. For a newly constructed control - one which is not the result of parseResponse on a control returned by a server - the method returns -1.


setListSize

public void setListSize(int size)
Sets the assumed size of the virtual search results list. This will typically be a number returned on a previous virtual list request in an LDAPVirtualListResponse.


setRange

public void setRange(int listIndex,
                     int beforeCount,
                     int afterCount)
Sets the center or starting list index to return, and the number of results before and after.

Parameters:
listIndex - The center or starting list index to be returned.

beforeCount - The number of entries before "listIndex" to be returned.

afterCount - The number of entries after "listIndex" to be returned.


setRange

public void setRange(java.lang.String jumpTo,
                     int beforeCount,
                     int afterCount)
Sets the center or starting list index to return, and the number of results before and after.

Parameters:
jumpTo - A search expression that defines the first element to be returned in the virtual search results. The filter expression in the search operation itself may be, for example, "objectclass=person" and the jumpTo expression in the virtual list control may be "cn=m*", to retrieve a subset of entries starting at or centered around those with a common name beginning with the letter "M".

beforeCount - The number of entries before "listIndex" to be returned.

afterCount - The number of entries after "listIndex" to be returned.


getContext

public java.lang.String getContext()
Returns the cookie used by some servers to optimize the processing of virtual list requests.


setContext

public void setContext(java.lang.String context)
Sets the cookie used by some servers to optimize the processing of virtual list requests. It should be the context field returned in a virtual list response control for the same search.


LDAP Classes
Implements Java LDAP

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000