Ja.NET Standard Edition 5.0

Documentation API Specification

Contents

SearchControls Class Reference

Inherits java::io::Serializable.

List of all members.


Detailed Description

This class represents the scope of a search, and the list of attributes that the search encompasses.

The various scopes are defined by class constants representing Object, Single-depth, and Full-depth searches of the directory.

This class is not thread-safe.


Public Member Functions

 SearchControls ()
 Default constructor.
 SearchControls (int searchScope, long countLimit, int timeLimit, String attributesToReturn[], boolean returnObj, boolean derefLink)
 Constructs a search control instance with all parameters.
long getCountLimit ()
 Gets the maximum number of search results.
boolean getDerefLinkFlag ()
 Gets the flag indicates whether search will follow LinkRef references.
String[] getReturningAttributes ()
 Gets identifiers of attributes to return for each result.
boolean getReturningObjFlag ()
 Gets the flag whether search results will include the object (true) or not (false).
int getSearchScope ()
 Gets the search scope.
int getTimeLimit ()
 Gets the the maximum number of search time.
void setCountLimit (long l)
 Sets the maximum number of search results.
void setDerefLinkFlag (boolean flag)
 Sets the flag indicates whether search will follow LinkRef references.
void setReturningAttributes (String as[])
 Sets identifiers of attributes to return for each result.
void setReturningObjFlag (boolean flag)
 Sets the flag whether search results will include the object (true) or not (false).
void setSearchScope (int i)
 Sets the search scope.
void setTimeLimit (int i)
 Sets the the maximum number of search time.

Static Public Attributes

static final int OBJECT_SCOPE = 0
 Bounds the search to the object scope only.
static final int ONELEVEL_SCOPE = 1
 Bounds the search to a single level of the naming context rooted at the given object.
static final int SUBTREE_SCOPE = 2
 Bounds the search to the subtree rooted at the given object or naming context.

Private Attributes

int searchScope
 The scope of the search.
int timeLimit
 search time limitation.
boolean derefLink
 Flag showing whether searches should dereference JNDI links.
boolean returnObj
 Flag showing whether an Object is returned in the search results.
long countLimit
 Maximum number of search results that will be returned.
String attributesToReturn []
 Lists attributes to match.

Static Private Attributes

static final long serialVersionUID = 0xdd935921dd0f3e33L

Constructor & Destructor Documentation

SearchControls (  ) 

Default constructor.

Equivalent to: SearchControls (ONELEVEL_SCOPE, 0, 0, null, false, false).

SearchControls ( int  searchScope,
long  countLimit,
int  timeLimit,
String  attributesToReturn[],
boolean  returnObj,
boolean  derefLink 
)

Constructs a search control instance with all parameters.

Parameters:
searchScope the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE or SUBTREE_SCOPE.
countLimit the maximum number of search results. If is zero, then the number of search results returned is unlimited.
timeLimit the maximum number of search time in milliseconds, for the search. If is zero, then there is no time limit for the search.
attributesToReturn an array of identifiers of attributes to return for each result. If is null, then all attributes are returned for each result.
returnObj an flag. If true then search results contain an object, otherwise they contain only a name and class pair.
derefLink an flag. If true then LinkRef references are followed in the search, otherwise they are not.


Member Function Documentation

long getCountLimit (  ) 

Gets the maximum number of search results.

Returns:
the maximum number of search results to return.

boolean getDerefLinkFlag (  ) 

Gets the flag indicates whether search will follow LinkRef references.

Returns:
flag indicates whether searches will follow LinkRef references. If true then LinkRef references are followed in the search, otherwise they are not.

String [] getReturningAttributes (  ) 

Gets identifiers of attributes to return for each result.

Returns:
an array of identifiers of attributes to return for each result. If is null, then all attributes are returned for each result.

boolean getReturningObjFlag (  ) 

Gets the flag whether search results will include the object (true) or not (false).

Returns:
if true then search results contain an object, otherwise they contain only a name and class pair.

int getSearchScope (  ) 

Gets the search scope.

Returns:
the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE or SUBTREE_SCOPE.

int getTimeLimit (  ) 

Gets the the maximum number of search time.

Returns:
the maximum number of search time in milliseconds, for the search. If is zero, then there is no time limit for the search.

void setCountLimit ( long  l  ) 

Sets the maximum number of search results.

Parameters:
l the maximum number of search results. If is zero, then the number of search results returned is unlimited.

void setDerefLinkFlag ( boolean  flag  ) 

Sets the flag indicates whether search will follow LinkRef references.

Parameters:
flag flag indicates whether searches will follow LinkRef references. If true then LinkRef references are followed in the search, otherwise they are not.

void setReturningAttributes ( String  as[]  ) 

Sets identifiers of attributes to return for each result.

Parameters:
as an array of identifiers of attributes to return for each result. If is null, then all attributes are returned for each result.

void setReturningObjFlag ( boolean  flag  ) 

Sets the flag whether search results will include the object (true) or not (false).

Parameters:
flag if true then search results contain an object, otherwise they contain only a name and class pair.

void setSearchScope ( int  i  ) 

Sets the search scope.

Parameters:
i the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE or SUBTREE_SCOPE.

void setTimeLimit ( int  i  ) 

Sets the the maximum number of search time.

Parameters:
i the maximum number of search time in milliseconds, for the search. If is zero, then there is no time limit for the search.


Member Data Documentation

final long serialVersionUID = 0xdd935921dd0f3e33L [static, private]

final int OBJECT_SCOPE = 0 [static]

Bounds the search to the object scope only.

The search takes place over the given object. The resulting enumeration will therefore only contain either zero or one (the given) object depending upon whether the object matches the search criteria.

If the object does match, its name in the enumeration will be empty since names are specified relative to the root of the search.

final int ONELEVEL_SCOPE = 1 [static]

Bounds the search to a single level of the naming context rooted at the given object.

The search will take place over the object, or if the object is a context then the object and all objects that are one level removed from the given context.

Matches are named by a relative name to the given root, so will have atomic (single level valid) names.

final int SUBTREE_SCOPE = 2 [static]

Bounds the search to the subtree rooted at the given object or naming context.

The search will take place over the object, or if the object is a context then the object and all objects that are reachable from he given context.

The names that are returned in the enumeration are defined to be either relative names to the given root, or full URIs of the matching objects.

The search is defined to no cross naming system boundaries.

int searchScope [private]

The scope of the search.

Constrained to be one of ONELEVEL_SCOPE, OBJECT_SCOPE, or SUBTREE_SCOPE.

int timeLimit [private]

search time limitation.

Maximum number of milliseconds to wait for the search to complete.

boolean derefLink [private]

Flag showing whether searches should dereference JNDI links.

boolean returnObj [private]

Flag showing whether an Object is returned in the search results.

long countLimit [private]

Maximum number of search results that will be returned.

String attributesToReturn[] [private]

Lists attributes to match.

Contains a single entry for each attribute that is to be matches -- or it is null if all attributes are to be matched.