| java.lang.Object javax.naming.directory.SearchControls
SearchControls | public class SearchControls implements Serializable(Code) | | 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.
|
Field Summary | |
final public static int | OBJECT_SCOPE Bounds the search to the object scope only.
The search takes place over the given object. | final public static int | ONELEVEL_SCOPE Bounds the search to a single level of the naming context rooted at the
given object. | final public static int | SUBTREE_SCOPE Bounds the search to the subtree rooted at the given object or naming
context. |
Constructor Summary | |
public | SearchControls() Default constructor. | public | 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 orSUBTREE_SCOPE. Parameters: countLimit - the maximum number of search results. |
Method Summary | |
public long | getCountLimit() Gets the maximum number of search results. | public boolean | getDerefLinkFlag() Gets the flag indicates whether search will follow LinkRef references.
flag indicates whether searches will follow LinkRef references. | public String[] | getReturningAttributes() Gets identifiers of attributes to return for each result. | public boolean | getReturningObjFlag() Gets the flag whether search results will include the object (true) or
not (false). | public int | getSearchScope() Gets the search scope. | public int | getTimeLimit() Gets the the maximum number of search time.
the maximum number of search time in milliseconds, for thesearch. | public void | setCountLimit(long l) Sets the maximum number of search results.
Parameters: l - the maximum number of search results. | public void | setDerefLinkFlag(boolean flag) Sets the flag indicates whether search will follow LinkRef
references.
Parameters: flag - flag indicates whether searches will followLinkRef references. | public void | setReturningAttributes(String as) Sets identifiers of attributes to return for each result.
Parameters: as - an array of identifiers of attributes to return for eachresult. | public void | setReturningObjFlag(boolean flag) Sets the flag whether search results will include the object (true) or
not (false). | public void | setSearchScope(int i) Sets the search scope. | public void | setTimeLimit(int i) Sets the the maximum number of search time.
Parameters: i - the maximum number of search time in milliseconds, for thesearch. |
OBJECT_SCOPE | final public static int OBJECT_SCOPE(Code) | | 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.
|
ONELEVEL_SCOPE | final public static int ONELEVEL_SCOPE(Code) | | 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.
|
SUBTREE_SCOPE | final public static int SUBTREE_SCOPE(Code) | | 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.
|
SearchControls | public SearchControls()(Code) | | Default constructor.
Equivalent to:
SearchControls (ONELEVEL_SCOPE, 0, 0, null, false, false) .
|
SearchControls | public SearchControls(int searchScope, long countLimit, int timeLimit, String attributesToReturn, boolean returnObj, boolean derefLink)(Code) | | Constructs a search control instance with all parameters.
Parameters: searchScope - the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE orSUBTREE_SCOPE. Parameters: countLimit - the maximum number of search results. If is zero, then thenumber of search results returned is unlimited. Parameters: timeLimit - the maximum number of search time in milliseconds, for thesearch. If is zero, then there is no time limit for thesearch. Parameters: attributesToReturn - an array of identifiers of attributes to return for eachresult. If is null, then all attributes are returned for eachresult. Parameters: returnObj - an flag. If true then search results contain an object,otherwise they contain only a name and class pair. Parameters: derefLink - an flag. If true then LinkRef references arefollowed in the search, otherwise they are not. |
getCountLimit | public long getCountLimit()(Code) | | Gets the maximum number of search results.
the maximum number of search results to return. |
getDerefLinkFlag | public boolean getDerefLinkFlag()(Code) | | Gets the flag indicates whether search will follow LinkRef references.
flag indicates whether searches will follow LinkRef references. If true then LinkRef references arefollowed in the search, otherwise they are not. |
getReturningAttributes | public String[] getReturningAttributes()(Code) | | Gets identifiers of attributes to return for each result.
an array of identifiers of attributes to return for each result.If is null, then all attributes are returned for each result. |
getReturningObjFlag | public boolean getReturningObjFlag()(Code) | | Gets the flag whether search results will include the object (true) or
not (false).
if true then search results contain an object, otherwise theycontain only a name and class pair. |
getSearchScope | public int getSearchScope()(Code) | | Gets the search scope.
the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE orSUBTREE_SCOPE. |
getTimeLimit | public int getTimeLimit()(Code) | | Gets the the maximum number of search time.
the maximum number of search time in milliseconds, for thesearch. If is zero, then there is no time limit for the search. |
setCountLimit | public void setCountLimit(long l)(Code) | | Sets the maximum number of search results.
Parameters: l - the maximum number of search results. If is zero, then thenumber of search results returned is unlimited. |
setDerefLinkFlag | public void setDerefLinkFlag(boolean flag)(Code) | | Sets the flag indicates whether search will follow LinkRef
references.
Parameters: flag - flag indicates whether searches will followLinkRef references. If true thenLinkRef references are followed in the search,otherwise they are not. |
setReturningAttributes | public void setReturningAttributes(String as)(Code) | | Sets identifiers of attributes to return for each result.
Parameters: as - an array of identifiers of attributes to return for eachresult. If is null, then all attributes are returned for eachresult. |
setReturningObjFlag | public void setReturningObjFlag(boolean flag)(Code) | | 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 theycontain only a name and class pair. |
setSearchScope | public void setSearchScope(int i)(Code) | | Sets the search scope.
Parameters: i - the search scope, chosen from OBJECT_SCOPE, ONELEVEL_SCOPE orSUBTREE_SCOPE. |
setTimeLimit | public void setTimeLimit(int i)(Code) | | Sets the the maximum number of search time.
Parameters: i - the maximum number of search time in milliseconds, for thesearch. If is zero, then there is no time limit for thesearch. |
|
|