本文整理汇总了Java中org.ldaptive.SearchResult.getEntry方法的典型用法代码示例。如果您正苦于以下问题:Java SearchResult.getEntry方法的具体用法?Java SearchResult.getEntry怎么用?Java SearchResult.getEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ldaptive.SearchResult
的用法示例。
在下文中一共展示了SearchResult.getEntry方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: containsResultEntry
import org.ldaptive.SearchResult; //导入方法依赖的package包/类
/**
* Checks to see if response has a result.
*
* @param response the response
* @return true, if successful
*/
public static boolean containsResultEntry(final Response<SearchResult> response) {
final SearchResult result = response.getResult();
if (result != null && result.getEntry() != null) {
return true;
}
return false;
}
示例2: processSpnegoAttribute
import org.ldaptive.SearchResult; //导入方法依赖的package包/类
/**
* Verify spnego attribute value.
*
* @param searchResult the search result
* @return true if attribute value exists and has a value
*/
protected boolean processSpnegoAttribute(final Response<SearchResult> searchResult) {
final SearchResult result = searchResult.getResult();
if (result == null || result.getEntries().isEmpty()) {
logger.debug("Spnego attribute is not found in the search results");
return false;
}
final LdapEntry entry = result.getEntry();
final LdapAttribute attribute = entry.getAttribute(this.spnegoAttributeName);
return verifySpnegyAttributeValue(attribute);
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:18,代码来源:LdapSpnegoKnownClientSystemsFilterAction.java
示例3: hasResults
import org.ldaptive.SearchResult; //导入方法依赖的package包/类
/**
* Checks to see if response has a result.
*
* @param response the response
* @return true, if successful
*/
private boolean hasResults(final Response<SearchResult> response) {
final SearchResult result = response.getResult();
if (result != null && result.getEntry() != null) {
return true;
}
logger.trace("Requested ldap operation did not return a result or an ldap entry. Code: {}, Message: {}",
response.getResultCode(), response.getMessage());
return false;
}
示例4: generate
import org.ldaptive.SearchResult; //导入方法依赖的package包/类
@Override
public CommonProfile generate(final WebContext context, final CommonProfile profile) {
Assert.notNull(this.connectionFactory, "connectionFactory must not be null");
Assert.notNull(this.userSearchExecutor, "userSearchExecutor must not be null");
final String username = profile.getId();
final SearchResult userResult;
try {
LOGGER.debug("Attempting to get details for user [{}].", username);
final Response<SearchResult> response = this.userSearchExecutor.search(
this.connectionFactory,
Beans.newLdaptiveSearchFilter(this.userSearchExecutor.getSearchFilter().getFilter(),
Beans.LDAP_SEARCH_FILTER_DEFAULT_PARAM_NAME, Collections.singletonList(username)));
LOGGER.debug("LDAP user search response: [{}]", response);
userResult = response.getResult();
if (userResult.size() == 0) {
throw new RuntimeException(new AccountNotFoundException(username + " not found."));
}
if (userResult.size() > 1 && !this.allowMultipleResults) {
throw new IllegalStateException(
"Found multiple results for user which is not allowed (allowMultipleResults=false).");
}
final LdapEntry userEntry = userResult.getEntry();
return generateAuthorizationForLdapEntry(profile, userEntry);
} catch (final LdapException e) {
throw new RuntimeException("LDAP error fetching details for user.", e);
}
}
示例5: processSpnegoAttribute
import org.ldaptive.SearchResult; //导入方法依赖的package包/类
/**
* Verify spnego attribute value.
*
* @param searchResult the search result
* @return true if attribute value exists and has a value
*/
protected boolean processSpnegoAttribute(final Response<SearchResult> searchResult) {
final SearchResult result = searchResult.getResult();
if (result == null || result.getEntries().isEmpty()) {
LOGGER.debug("Spnego attribute is not found in the search results");
return false;
}
final LdapEntry entry = result.getEntry();
final LdapAttribute attribute = entry.getAttribute(this.spnegoAttributeName);
LOGGER.debug("Spnego attribute [{}] found as [{}] for [{}]", attribute.getName(), attribute.getStringValue(), entry.getDn());
return verifySpnegoAttributeValue(attribute);
}
示例6: containsResultEntry
import org.ldaptive.SearchResult; //导入方法依赖的package包/类
/**
* Checks to see if response has a result.
*
* @param response the response
* @return true, if successful
*/
public static boolean containsResultEntry(final Response<SearchResult> response) {
final SearchResult result = response.getResult();
return result != null && result.getEntry() != null;
}