java.lang.Objectjavax.naming.directory.SearchControls
public class SearchControls
This class encapsulates factors that determine scope of search and what gets returned as a result of the search.
A SearchControls instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single SearchControls instance should lock the object.
| Field Summary | |
|---|---|
static int |
OBJECT_SCOPE
Search the named object. |
static int |
ONELEVEL_SCOPE
Search one level of the named context. |
static int |
SUBTREE_SCOPE
Search the entire subtree rooted at the named object. |
| Constructor Summary | |
|---|---|
SearchControls()
Constructs a search constraints using defaults. |
|
SearchControls(int scope,
long countlim,
int timelim,
String[] attrs,
boolean retobj,
boolean deref)
Constructs a search constraints using arguments. |
|
| Method Summary | |
|---|---|
long |
getCountLimit()
Retrieves the maximum number of entries that will be returned as a result of the search. |
boolean |
getDerefLinkFlag()
Determines whether links will be dereferenced during the search. |
String[] |
getReturningAttributes()
Retrieves the attributes that will be returned as part of the search. |
boolean |
getReturningObjFlag()
Determines whether objects will be returned as part of the result. |
int |
getSearchScope()
Retrieves the search scope of these SearchControls. |
int |
getTimeLimit()
Retrieves the time limit of these SearchControls in milliseconds. |
void |
setCountLimit(long limit)
Sets the maximum number of entries to be returned as a result of the search. |
void |
setDerefLinkFlag(boolean on)
Enables/disables link dereferencing during the search. |
void |
setReturningAttributes(String[] attrs)
Specifies the attributes that will be returned as part of the search. |
void |
setReturningObjFlag(boolean on)
Enables/disables returning objects returned as part of the result. |
void |
setSearchScope(int scope)
Sets the search scope to one of: OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE. |
void |
setTimeLimit(int ms)
Sets the time limit of these SearchControls in milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int OBJECT_SCOPE
The NamingEnumeration that results from search() using OBJECT_SCOPE will contain one or zero element. The enumeration contains one element if the named object satisfies the search filter specified in search(). The element will have as its name the empty string because the names of elements in the NamingEnumeration are relative to the target context--in this case, the target context is the named object. It contains zero element if the named object does not satisfy the search filter specified in search().
The value of this constant is 0.
public static final int ONELEVEL_SCOPE
The NamingEnumeration that results from search() using ONELEVEL_SCOPE contains elements with objects in the named context that satisfy the search filter specified in search(). The names of elements in the NamingEnumeration are atomic names relative to the named context.
The value of this constant is 1.
public static final int SUBTREE_SCOPE
If the named object is not a DirContext, search only the object. If the named object is a DirContext, search the subtree rooted at the named object, including the named object itself.
The search will not cross naming system boundaries.
The NamingEnumeration that results from search() using SUBTREE_SCOPE contains elements of objects from the subtree (including the named context) that satisfy the search filter specified in search(). The names of elements in the NamingEnumeration are either relative to the named context or is a URL string. If the named context satisfies the search filter, it is included in the enumeration with the empty string as its name.
The value of this constant is 2.
| Constructor Detail |
|---|
public SearchControls()
The defaults are:
public SearchControls(int scope,
long countlim,
int timelim,
String[] attrs,
boolean retobj,
boolean deref)
scope - The search scope. One of:
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE.timelim - The number of milliseconds to wait before returning.
If 0, wait indefinitely.deref - If true, dereference links during search.countlim - The maximum number of entries to return. If 0, return
all entries that satisfy filter.retobj - If true, return the object bound to the name of the
entry; if false, do not return object.attrs - The identifiers of the attributes to return along with
the entry. If null, return all attributes. If empty
return no attributes.| Method Detail |
|---|
public int getSearchScope()
One of OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE.
setSearchScope(int)public int getTimeLimit()
If the value is 0, this means to wait indefinitely.
setTimeLimit(int)public boolean getDerefLinkFlag()
setDerefLinkFlag(boolean)public boolean getReturningObjFlag()
setReturningObjFlag(boolean)public long getCountLimit()
0 indicates that all entries will be returned.
setCountLimit(long)public String[] getReturningAttributes()
A value of null indicates that all attributes will be returned. An empty array indicates that no attributes are to be returned.
setReturningAttributes(java.lang.String[])public void setSearchScope(int scope)
scope - The search scope of this SearchControls.getSearchScope()public void setTimeLimit(int ms)
If the value is 0, this means to wait indefinitely.
ms - The time limit of these SearchControls in milliseconds.getTimeLimit()public void setDerefLinkFlag(boolean on)
on - if true links will be dereferenced; if false, not followed.getDerefLinkFlag()public void setReturningObjFlag(boolean on)
If disabled, only the name and class of the object is returned. If enabled, the object will be returned.
on - if true, objects will be returned; if false,
objects will not be returned.getReturningObjFlag()public void setCountLimit(long limit)
0 indicates no limit: all entries will be returned.
limit - The maximum number of entries that will be returned.getCountLimit()public void setReturningAttributes(String[] attrs)
null indicates that all attributes will be returned. An empty array indicates no attributes are returned.
attrs - An array of attribute ids identifying the attributes that
will be returned. Can be null.getReturningAttributes()Ces informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)