本文整理汇总了Java中org.ldaptive.LdapException.getLocalizedMessage方法的典型用法代码示例。如果您正苦于以下问题:Java LdapException.getLocalizedMessage方法的具体用法?Java LdapException.getLocalizedMessage怎么用?Java LdapException.getLocalizedMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ldaptive.LdapException
的用法示例。
在下文中一共展示了LdapException.getLocalizedMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: next
import org.ldaptive.LdapException; //导入方法依赖的package包/类
@Override
public LdapEntry next() {
final String dn = dnsIterator.next();
final SearchRequest request = new SearchRequest();
request.setBaseDn(dn);
request.setSearchFilter(usersFilter);
request.setSearchScope(OBJECT);
request.setReturnAttributes(returnAttrs);
request.setSearchEntryHandlers(new ObjectGuidHandler());
try {
final Response<SearchResult> response = searchOp.execute(request);
if (response.getResultCode() != SUCCESS) {
throw new SyncException(
format(
"Couldn't get entry dn '%s', result code is '%s'", dn, response.getResultCode()));
}
return response.getResult().getEntry();
} catch (LdapException x) {
throw new SyncException(x.getLocalizedMessage(), x);
}
}
示例2: select
import org.ldaptive.LdapException; //导入方法依赖的package包/类
@Override
public Iterable<LdapEntry> select(Connection connection) {
final SearchRequest groupsSearch = new SearchRequest();
groupsSearch.setBaseDn(baseDn);
groupsSearch.setSearchFilter(new SearchFilter(groupsFilter));
groupsSearch.setSearchScope(SUBTREE);
groupsSearch.setReturnAttributes(membersAttr);
groupsSearch.setSearchEntryHandlers(new RangeEntryHandler());
try {
final Response<SearchResult> response = new SearchOperation(connection).execute(groupsSearch);
if (response.getResultCode() != SUCCESS) {
throw new SyncException("Couldn't get groups, result code is " + response.getResultCode());
}
return new RequestEachEntryIterable(
response
.getResult()
.getEntries()
.stream()
.flatMap(entry -> entry.getAttribute(membersAttr).getStringValues().stream())
.collect(toSet()),
connection,
usersFilter,
returnAttrs);
} catch (LdapException x) {
throw new SyncException(x.getLocalizedMessage(), x);
}
}
示例3: requestNextPage
import org.ldaptive.LdapException; //导入方法依赖的package包/类
private void requestNextPage() {
try {
response = prClient.execute(request, cm);
if (response.getResultCode() != SUCCESS) {
throw new SyncException(
"Couldn't get a next page of entries, result code is " + response.getResultCode());
}
delegate = response.getResult().getEntries().iterator();
} catch (LdapException x) {
throw new SyncException(x.getLocalizedMessage(), x);
}
}