當前位置: 首頁>>代碼示例>>Java>>正文


Java Control類代碼示例

本文整理匯總了Java中com.unboundid.ldap.sdk.Control的典型用法代碼示例。如果您正苦於以下問題:Java Control類的具體用法?Java Control怎麽用?Java Control使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Control類屬於com.unboundid.ldap.sdk包,在下文中一共展示了Control類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: scrollSimplePagedResultsControl

import com.unboundid.ldap.sdk.Control; //導入依賴的package包/類
private ASN1OctetString scrollSimplePagedResultsControl(LDAPConnection ldapConnection, String dn, Filter filter, SearchScope scope, Control[] controls, int startIndex) throws LDAPException, InvalidSimplePageControlException {
	SearchRequest searchRequest = new SearchRequest(dn, scope, filter, "dn");

	int currentStartIndex = startIndex;
	ASN1OctetString cookie = null;
	do {
		int pageSize = Math.min(currentStartIndex, 100);
		searchRequest.setControls(new Control[]{new SimplePagedResultsControl(pageSize, cookie, true)});
		setControls(searchRequest, controls);
		SearchResult searchResult = ldapConnection.search(searchRequest);

		currentStartIndex -= searchResult.getEntryCount();
		try {
			SimplePagedResultsControl c = SimplePagedResultsControl.get(searchResult);
			if (c != null) {
				cookie = c.getCookie();
			}
		} catch (LDAPException ex) {
			log.error("Error while accessing cookie", ex);
			throw new InvalidSimplePageControlException(ex.getResultCode(), "Error while accessing cookie");
		}
	} while ((cookie != null) && (cookie.getValueLength() > 0) && (currentStartIndex > 0));

	return cookie;
}
 
開發者ID:GluuFederation,項目名稱:oxCore,代碼行數:26,代碼來源:LdapOperationsServiceImpl.java

示例2: setControls

import com.unboundid.ldap.sdk.Control; //導入依賴的package包/類
private void setControls(SearchRequest searchRequest, Control... controls) {
	if (!ArrayHelper.isEmpty(controls)) {
		Control[] newControls;
		if (ArrayHelper.isEmpty(searchRequest.getControls())) {
			newControls = controls;
		} else {
			newControls = ArrayHelper.arrayMerge(searchRequest.getControls(), controls);
		}

		searchRequest.setControls(newControls);
	}
}
 
開發者ID:GluuFederation,項目名稱:oxCore,代碼行數:13,代碼來源:LdapOperationsServiceImpl.java

示例3: search

import com.unboundid.ldap.sdk.Control; //導入依賴的package包/類
SearchResult search(String dn, Filter filter, int searchLimit, int sizeLimit, Control[] controls,
String... attributes) throws SearchException;
 
開發者ID:GluuFederation,項目名稱:oxCore,代碼行數:3,代碼來源:LdapOperationService.java

示例4: search

import com.unboundid.ldap.sdk.Control; //導入依賴的package包/類
@Override
public SearchResult search(String dn, Filter filter, int searchLimit, int sizeLimit, Control[] controls, String... attributes)
		throws SearchException {
	return search(dn, filter, SearchScope.SUB, searchLimit, sizeLimit, controls, attributes);
}
 
開發者ID:GluuFederation,項目名稱:oxCore,代碼行數:6,代碼來源:LdapOperationsServiceImpl.java


注:本文中的com.unboundid.ldap.sdk.Control類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。