com.iplanet.am.sdk
Class AMSearchControl

java.lang.Object
  |
  +--com.iplanet.am.sdk.AMSearchControl

public class AMSearchControl
extends java.lang.Object

This class provides a way to customize Search behaviors. Common behaviors are time limit, result limit and Virtual list view. In future, we will provide ways for client to define different hierarchical tree through AMSearchControl.


Constructor Summary
AMSearchControl()
           
 
Method Summary
 int getMaxResults()
          Gets the maximum number of search results to return.
 java.lang.String[] getReturnAttributes()
           
 int getSearchScope()
          Gets the search scope defined in the AMSearchControl.
 int getSearchScope(int defaultScope)
          Gets the search scope defined in the AMSearchControl.
 int getTimeOut()
          Get current time out setting.
 void setMaxResults(int maxNumber)
          Sets the maximum number of search results to return; 0 means there is no limit.
 void setReturnAttributes(java.util.Set attributeNames)
          Set the return attribute names, if attributes of the entries need to be obtained as part of the search.
 void setSearchScope(int scope)
          Sets the search scope in AMSearchControl.
 void setSortKeys(java.lang.String[] attributeNames)
          Set sort order based on attribute names.
 void setTimeOut(int timeOut)
          Sets the maximum number of milliseconds to wait for any operation for the search.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMSearchControl

public AMSearchControl()
Method Detail

setReturnAttributes

public void setReturnAttributes(java.util.Set attributeNames)
Set the return attribute names, if attributes of the entries need to be obtained as part of the search. NOTE: If the return attribute values are specified as part of AMSearchControl, there could be a significant performance overhead compared to when none are specified. When the return attributes are set, the return attributes can be obtained as a map with DN as map-key and set of attribute values as map-value from AMSearchResults object.
Parameters:
attributeNames - Set of attribute names whose values need to be obtained as part of the search.

getReturnAttributes

public java.lang.String[] getReturnAttributes()

setSortKeys

public void setSortKeys(java.lang.String[] attributeNames)
Set sort order based on attribute names.
Parameters:
attributeNames - array of attribute names to sort on

setTimeOut

public void setTimeOut(int timeOut)
Sets the maximum number of milliseconds to wait for any operation for the search.
Parameters:
timeOut - Max number of milliseconds

getTimeOut

public int getTimeOut()
Get current time out setting.

setMaxResults

public void setMaxResults(int maxNumber)
Sets the maximum number of search results to return; 0 means there is no limit.
Parameters:
maxNumber - Max number of results

getMaxResults

public int getMaxResults()
Gets the maximum number of search results to return. return 0 means there is no limit.

setSearchScope

public void setSearchScope(int scope)
Sets the search scope in AMSearchControl.
Parameters:
scope - Search scope defined in the AMSearchControl to be used with the search API

getSearchScope

public int getSearchScope()
Gets the search scope defined in the AMSearchControl.
Returns:
search scope defined in the AMSearchControl. If search scope is never defined in the AMSearchControl SCOPE_SUB for subtree type of search is assumed.

getSearchScope

public int getSearchScope(int defaultScope)
Gets the search scope defined in the AMSearchControl. Allows a user to specify default search scope if nothing has been defined in the AMSearchControl yet.
Parameters:
defaultScope - Scope value to be used in case the AMSearchControl is not set up with a search scope
Returns:
Search scope defined in the AMSearchControl. Return defaultScope if scope is not defined in the control