All LDAP Classes
Internal LDAP Classes

com.novell.ldap.controls
Class LDAPVirtualListControl

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

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

Field Summary
private static int BYOFFSET
           
private static int GREATERTHANOREQUAL
           
private  int m_afterCount
           
private  int m_beforeCount
           
private  int m_contentCount
           
private  java.lang.String m_context
           
private  java.lang.String m_jumpTo
           
private  int m_startIndex
           
private  ASN1Sequence m_vlvRequest
           
private static java.lang.String requestOID
          The Request OID for a VLV Request
private static java.lang.String responseOID
           
 
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
private  void BuildIndexedVLVRequest()
          Private method used to construct the ber encoded control Used only when using the Indexed mode of VLV Control
private  void BuildTypedVLVRequest()
          Private method used to construct the ber encoded control Used only when using the typed mode of VLV Control.
 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
 

Field Detail

BYOFFSET

private static int BYOFFSET

GREATERTHANOREQUAL

private static int GREATERTHANOREQUAL

requestOID

private static java.lang.String requestOID
The Request OID for a VLV Request


responseOID

private static java.lang.String responseOID

m_vlvRequest

private ASN1Sequence m_vlvRequest

m_beforeCount

private int m_beforeCount

m_afterCount

private int m_afterCount

m_jumpTo

private java.lang.String m_jumpTo

m_context

private java.lang.String m_context

m_startIndex

private int m_startIndex

m_contentCount

private int m_contentCount
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

BuildTypedVLVRequest

private void BuildTypedVLVRequest()
Private method used to construct the ber encoded control Used only when using the typed mode of VLV Control.


BuildIndexedVLVRequest

private void BuildIndexedVLVRequest()
Private method used to construct the ber encoded control Used only when using the Indexed mode of VLV Control


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.


All LDAP Classes
Internal LDAP Classes

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