所有类
javax.naming.ldap
类 SortResponseControl
java.lang.Object
javax.naming.ldap.BasicControl
javax.naming.ldap.SortResponseControl
- 所有已实现的接口:
- Serializable, Control
public final class SortResponseControl
- extends BasicControl
指示搜索结果的请求排序是否成功。当结果代码指示成功时,结果已按照请求进行了排序。否则,排序失败,同时服务器可能提供关于错误原因的附加详细信息。
SortControl
中的代码示例展示了使用此类的方式。
此类实现在 RFC 2891 中定义的用于服务器端排序的 LDAPv3 响应控件。 控件值具有以下 ASN.1 定义:
SortResult ::= SEQUENCE {
sortResult ENUMERATED {
success (0), -- results are sorted
operationsError (1), -- server internal failure
timeLimitExceeded (3), -- timelimit reached before
-- sorting was completed
strongAuthRequired (8), -- refused to return sorted
-- results via insecure
-- protocol
adminLimitExceeded (11), -- too many matching entries
-- for the server to sort
noSuchAttribute (16), -- unrecognized attribute
-- type in sort key
inappropriateMatching (18), -- unrecognized or inappro-
-- priate matching rule in
-- sort key
insufficientAccessRights (50), -- refused to return sorted
-- results to this client
busy (51), -- too busy to process
unwillingToPerform (53), -- unable to sort
other (80)
},
attributeType [0] AttributeType OPTIONAL }
- 从以下版本开始:
- 1.5
- 另请参见:
SortControl
, 序列化表格
字段摘要 |
---|
static String | OID 服务器端排序响应控件的分配对象标识符为 1.2.840.113556.1.4.474。 |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OID
public static final String OID
- 服务器端排序响应控件的分配对象标识符为 1.2.840.113556.1.4.474。
- 另请参见:
- 常量字段值
SortResponseControl
public SortResponseControl(String id,
boolean criticality,
byte[] value)
throws IOException
- 构造一个控件来指示排序请求的结果。
- 参数:
id
- 此控件的对象标识符字符串。 criticality
- 控件的关键性。 value
- 控件的 ASN.1 BER 编码值。它不是副本,对值进行的任何更改都将影响控件的内容。 - 抛出:
IOException
- 如果在解码控件值时遇到错误。
isSorted
public boolean isSorted()
- 确定是否已成功排序搜索结果。如果在排序过程中出错,则抛出 NamingException。
- 返回:
- 如果已排序搜索结果,则返回 true。
getResultCode
public int getResultCode()
- 检索排序操作的 LDAP 结果代码。
- 返回:
- 结果代码。值为零指示成功。
getAttributeID
public String getAttributeID()
- 检索导致排序失败的属性的 ID。如果服务器没有返回任何 ID,则返回 null。
- 返回:
- 错误属性的 ID(可能为 null)。
getException
public NamingException getException()
- 检索适合结果代码的 NamingException。
- 返回:
- 如果结果代码指示成功,则返回 NamingException 或 null。
所有类