public class SearchControls extends Object implements Serializable
一个searchcontrols实例不同步的并发多线程访问。多个线程试图访问和修改一个searchcontrols实例应该锁定对象。
Modifier and Type | Field and Description |
---|---|
static int |
OBJECT_SCOPE
搜索命名的对象。
|
static int |
ONELEVEL_SCOPE
搜索指定的上下文的一个级别。
|
static int |
SUBTREE_SCOPE
搜索整个子树在命名对象。
|
Constructor and Description |
---|
SearchControls()
使用默认构造搜索约束。
|
SearchControls(int scope, long countlim, int timelim, String[] attrs, boolean retobj, boolean deref)
使用参数构造搜索约束。
|
Modifier and Type | Method and Description |
---|---|
long |
getCountLimit()
检索将要返回的项的最大数目,作为搜索结果的结果。
|
boolean |
getDerefLinkFlag()
确定是否将取消链接在搜索。
|
String[] |
getReturningAttributes()
检索将返回的属性作为搜索的一部分。
|
boolean |
getReturningObjFlag()
确定是否将对象作为结果的一部分返回。
|
int |
getSearchScope()
检索这些searchcontrols搜索范围。
|
int |
getTimeLimit()
检索这些searchcontrols时间限制在毫秒。
|
void |
setCountLimit(long limit)
设置要返回的搜索结果的最大数目。
|
void |
setDerefLinkFlag(boolean on)
启用/禁用链接引用在搜索。
|
void |
setReturningAttributes(String[] attrs)
指定将要返回的属性作为搜索的一部分。
|
void |
setReturningObjFlag(boolean on)
启用/禁用返回的对象作为结果的一部分返回。
|
void |
setSearchScope(int scope)
设置一个搜索范围:object_scope,onelevel_scope,subtree_scope。
|
void |
setTimeLimit(int ms)
在这些searchcontrols毫秒时间极限集。
|
public static final int OBJECT_SCOPE
结果从使用的namingenumeration()object_scope将包含一个或零元。枚举包含一个元素如果命名对象满足指定的搜索过滤器()。元素将作为其名称的空字符串,因为NamingEnumeration元素的名字是相对于目标的背景下,在这种情况下,目标的背景是命名的对象。它包含零元素如果命名对象不满足指定的搜索过滤器()。
此常数的值是0。
public static final int ONELEVEL_SCOPE
结果从使用的namingenumeration()onelevel_scope包含元素在命名上下文对象,满足指定的搜索过滤器()。在NamingEnumeration元素的名字是相对于原子名字命名上下文。
此常数的值是1。
public static final int SUBTREE_SCOPE
如果指定的对象是不是一个对像中,只有目标搜索。如果指定的对象是一个对像中,搜索为根的子树命名对象,包括命名对象本身。
搜索将不会交叉命名系统边界。
结果从使用的namingenumeration()subtree_scope包含从子树的对象元素(包括命名上下文),满足()中指定的搜索筛选器。在NamingEnumeration元素的名称是相对于命名上下文或是URL字符串。如果指定的上下文满足搜索筛选器,则将其包含在枚举中,以空字符串作为它的名称。
此常数的值是2。
public SearchControls()
默认是:
public SearchControls(int scope, long countlim, int timelim, String[] attrs, boolean retobj, boolean deref)
scope
-搜索范围。之一:object_scope,onelevel_scope,subtree_scope。
timelim
-毫秒数等返回之前。如果0,无限期等待。
deref
-如果属实,引用链接在搜索。
countlim
-入口的最大值返回。如果0,返回满足过滤器的所有条目。
retobj
-如果是真的,返回的对象绑定到该项的名称;如果为假,不返回对象。
attrs
-属性的标识符来随着输入返回。如果为空,返回所有属性。如果空返回没有属性。
public int getSearchScope()
一个object_scope,onelevel_scope,subtree_scope。
setSearchScope(int)
public int getTimeLimit()
如果值为0,则意味着要无限期等待。
setTimeLimit(int)
public boolean getDerefLinkFlag()
setDerefLinkFlag(boolean)
public boolean getReturningObjFlag()
setReturningObjFlag(boolean)
public long getCountLimit()
0表示所有条目将被返回。
setCountLimit(long)
public String[] getReturningAttributes()
值为空,表明所有的属性将被返回。一个空数组表示没有返回属性。
setReturningAttributes(java.lang.String[])
public void setSearchScope(int scope)
scope
-这searchcontrols搜索范围。
getSearchScope()
public void setTimeLimit(int ms)
如果值为0,则意味着要无限期等待。
ms
毫秒的时间限制。
getTimeLimit()
public void setDerefLinkFlag(boolean on)
on
-如果真的链接将被取消;如果为假,不遵循。
getDerefLinkFlag()
public void setReturningObjFlag(boolean on)
如果禁用,只返回对象的名称和类。如果启用,对象将被返回。
on
-如果是真的,对象将返回;如果为假,对象将不会被退回。
getReturningObjFlag()
public void setCountLimit(long limit)
0表示没有限制:所有条目将被返回。
limit
-的最大个数,将返回。
getCountLimit()
public void setReturningAttributes(String[] attrs)
表示所有的属性将被返回。一个空数组表示没有返回属性。
attrs
-属性ID识别属性将返回一个数组。可以为空。
getReturningAttributes()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.