|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
java.lang.Objectjavax.naming.ldap.BasicControl
javax.naming.ldap.PagedResultsControl
public final class PagedResultsControl
검색 조작의 결과를, 지정한 사이즈 마다 정리해 돌려주도록(듯이) LDAP 서버에 요구합니다. 요구자는, 검색 조작을 호출하는 빈도를 제어하는 것으로, 결과를 받는 빈도를 제어할 수 있습니다.
이 클래스의 사용 방법을 나타내는 코딩예를 다음에 나타냅니다.
// Open an LDAP association LdapContext ctx = new InitialLdapContext(); // Activate paged results int pageSize = 20; // 20 entries per page byte[] cookie = null; int total; ctx.setRequestControls(new Control[]{ new PagedResultsControl(pageSize, Control.CRITICAL) }); do { // Perform the search NamingEnumeration results = ctx.search("", "(objectclass=*)", new SearchControls()); // Iterate over a batch of search results while (results ! = null && results.hasMore()) { // Display an entry SearchResult entry = (SearchResult) results.next(); System.out.println(entry.getName()); System.out.println(entry.getAttributes()); // Handle the entry's response controls (if any) if (entry instanceof HasControls) { // ((HasControls) entry). getControls(); } } // Examine the paged results control response Control[] controls = ctx.getResponseControls(); if (controls ! = null) { for (int i = 0; i < controls.length; i++) { if (controls[i] instanceof PagedResultsResponseControl) { PagedResultsResponseControl prrc = (PagedResultsResponseControl) controls[i]; total = prrc.getResultSize(); cookie = prrc.getCookie(); } else { // Handle other response controls (if any) } } } // Re-activate paged results ctx.setRequestControls(new Control[]{ new PagedResultsControl(pageSize, cookie, Control.CRITICAL) }); } while (cookie ! = null); // Close the LDAP association ctx.close(); ...
이 클래스는,RFC 2696 으로 정의되고 있는, 페이지 마다 단락지어진 결과의 LDAPv3 컨트롤을 구현합니다. 이 컨트롤의 값의 ASN. 1 정의는 다음과 같습니다.
realSearchControlValue ::= SEQUENCE { size INTEGER (0..maxInt), -- requested page size from client -- result set size estimate from server cookie OCTET STRING }
PagedResultsResponseControl
,
직렬화 된 형식 필드의 개요 | |
---|---|
static String |
OID
페이지 마다 단락지어진 결과의 컨트롤에 할당할 수 있고 있는 객체 식별자는 1.2. 840.113556. 1.4. 319 입니다. |
클래스 javax.naming.ldap. BasicControl 로부터 상속된 필드 |
---|
criticality , id , value |
인터페이스 javax.naming.ldap. Control 로부터 상속된 필드 |
---|
CRITICAL , NONCRITICAL |
생성자 의 개요 | |
---|---|
PagedResultsControl (int pageSize,
boolean criticality)
1 페이지 성공을 거두어에 취득하는 결과의 엔트리수를 설정하기 위한 컨트롤을 구축합니다. |
|
PagedResultsControl (int pageSize,
byte[] cookie,
boolean criticality)
1 페이지 성공을 거두어에 취득하는 결과의 엔트리수를 설정하기 위한 컨트롤을 구축합니다. |
메소드의 개요 |
---|
클래스 javax.naming.ldap. BasicControl 로부터 상속된 메소드 |
---|
getEncodedValue , getID , isCritical |
클래스 java.lang. Object 로부터 상속된 메소드 |
---|
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
필드의 상세 |
---|
public static final String OID
생성자 의 상세 |
---|
public PagedResultsControl(int pageSize, boolean criticality) throws IOException
pageSize
- 1 페이지 성공을 거두어에 취득하는 엔트리수criticality
- true 의 경우, 서버는 이 컨트롤에 따라
pageSize 의 지정대로 검색 결과를 돌려주는지,
검색의 실행을 거부할 필요가 있다
false 의 경우, 서버는 이 컨트롤에 따르지 않아도 상관없다
IOException
- 지정된 인수를 encode 해 컨트롤을 구축할 경우에
에러가 발생했을 경우public PagedResultsControl(int pageSize, byte[] cookie, boolean criticality) throws IOException
일련의 결과 페이지를 도중에 방폐하려면 , pageSize 로서 0, 서버로부터 마지막에 받은 쿠키를 cookie 로서 설정합니다.
pageSize
- 1 페이지 성공을 거두어에 취득하는 엔트리수cookie
- 서버로 생성된 쿠키. null 의 경우도 있는criticality
- true 의 경우, 서버는 이 컨트롤에 따라
pageSize 의 지정대로 검색 결과를 돌려주는지,
검색의 실행을 거부할 필요가 있다
false 의 경우, 서버는 이 컨트롤에 따르지 않아도 상관없다
IOException
- 지정된 인수를 encode 해 컨트롤을 구축할 경우에
에러가 발생했을 경우
|
JavaTM Platform Standard Ed. 6 |
|||||||||
앞의 클래스 다음의 클래스 | 프레임 있어 프레임 없음 | |||||||||
개요: 상자 | 필드 | 생성자 | 메소드 | 상세 : 필드 | 생성자 | 메소드 |
Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.