|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
| °³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | |||||||||
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 - ÁöÁ¤µÈ Àμö·ÎºÎÅÍ ÄÁÆ®·ÑÀ» ±¸ÃàÇÒ °æ¿ì¿¡ ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
public PagedResultsControl(int pageSize,
byte[] cookie,
boolean criticality)
throws IOException
ÀÏ·ÃÀÇ °á°ú ÆäÀÌÁö¸¦ µµÁß¿¡ ¹æÆóÇÏ·Á¸é, pageSize ·Î¼ 0, ¼¹ö·ÎºÎÅÍ ¸¶Áö¸·¿¡ ¹ÞÀº Äí۸¦ cookie ·Î¼ ¼³Á¤ÇÕ´Ï´Ù.
pageSize - 1 ÆäÀÌÁö ¼º°øÀ» °ÅµÎ¾î¿¡ ¾ò´Â ¿£Æ®¸®¼öcookie - ¼¹ö·Î »ý¼ºµÈ ÄíŰ. nullÀÎ °æ¿ìµµ ÀÖ´Âcriticality - trueÀÎ °æ¿ì, ¼¹ö´Â ÀÌ ÄÁÆ®·Ñ¿¡ µû¶ó pageSize
ÁöÁ¤´ë·Î °Ë»ö °á°ú¸¦ µ¹·ÁÁÖ´ÂÁö, °Ë»öÀÇ ½ÇÇàÀ» °ÅºÎÇÒ Çʿ䰡 ÀÖ´Ù. falseÀÎ °æ¿ì, ¼¹ö´Â ÀÌ ÄÁÆ®·Ñ¿¡ µû¸£Áö ¾Ê¾Æµµ »ó°ü¾ø´Ù
IOException - ÁöÁ¤µÈ Àμö¸¦ encodeÀÇÇØ ÄÁÆ®·ÑÀ» ±¸ÃàÇÒ °æ¿ì¿¡ ¿¡·¯°¡ ¹ß»ýÇßÀ» °æ¿ì
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
| °³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.