当前位置: 首页>>代码示例>>Java>>正文


Java SearchResultEntry.getAttributeValue方法代码示例

本文整理汇总了Java中com.unboundid.ldap.sdk.SearchResultEntry.getAttributeValue方法的典型用法代码示例。如果您正苦于以下问题:Java SearchResultEntry.getAttributeValue方法的具体用法?Java SearchResultEntry.getAttributeValue怎么用?Java SearchResultEntry.getAttributeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.unboundid.ldap.sdk.SearchResultEntry的用法示例。


在下文中一共展示了SearchResultEntry.getAttributeValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: get

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
public UserLdapDetails get(SearchResultEntry entry) {
  String company = "";
  try {
    company = getCompanyByDn(entry.getParentDNString());
  } catch (LDAPException e) {
    logger.warn("Failed to extract company from entry");
  }

  return new UserLdapDetails(
    entry.getAttributeValue("givenName"),
    entry.getAttributeValue("sn"),
    entry.getAttributeValue("mail"),
    entry.getAttributeValue("telephoneNumber"),
    entry.getAttributeValue("l"),
    entry.getAttributeValue("title"),
    company
  );
}
 
开发者ID:sinnerschrader,项目名称:SkillWill,代码行数:19,代码来源:UserLdapDetailsFactory.java

示例2: searchAlternateNames

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
private Set<AuthorName> searchAlternateNames(String uid, AuthorName primaryName) {

		Set<AuthorName> alternateNames = new HashSet<AuthorName>();
		String filter = "(&(objectClass=weillCornellEduSORRecord)(weillCornellEduCWID=" + uid + "))";
		List<SearchResultEntry> results = searchWithBaseDN(filter, "ou=sors,dc=weill,dc=cornell,dc=edu");
		for (SearchResultEntry entry : results) {
			AuthorName authorName = new AuthorName(
					entry.getAttributeValue("givenName"),
					entry.getAttributeValue("weillCornellEduMiddleName"),
					entry.getAttributeValue("sn").replace("- M.D.", "")); //Added fix for some surnames having degree in their surnames - M.D.
			if (!primaryName.equals(authorName)) {
				alternateNames.add(authorName);
			}
		}
		return alternateNames;
	}
 
开发者ID:wcmc-its,项目名称:ReCiter,代码行数:17,代码来源:LdapIdentityDaoImpl.java

示例3: getUserInfo

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
private UserInfo getUserInfo(SearchResultEntry entry) {
	UserInfo result = new UserInfo();
	result.setUserId(entry.getAttributeValue("cn"));		
	String name = entry.getAttributeValue(givenNameAttribute);
	String name2 = entry.getAttributeValue(surNameAttribute);
	if (null != name) {
		if (null != name2) {
			name = name + " " + name2;
		}
	} else {
		name = name2;
	}
	result.setUserName(name);
	result.setUserLocale(entry.getAttributeValue(localeAttribute));
	result.setUserOrganization(entry.getAttributeValue(organizationAttribute));
	result.setUserDivision(entry.getAttributeValue(divisionAttribute));
	result.setRoles(getRoles(entry));
	return result;
}
 
开发者ID:geomajas,项目名称:geomajas-project-server,代码行数:20,代码来源:LdapAuthenticationService.java

示例4: searchEmails

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
private Set<String> searchEmails(String uid) {
	String filter = "(&(objectClass=weillCornellEduSORRecord)(weillCornellEduCWID=" + uid + "))";
	List<SearchResultEntry> results = searchWithBaseDN(filter, "ou=sors,dc=weill,dc=cornell,dc=edu");
	Set<String> emails = new HashSet<>();
	if (results != null) {
		for (SearchResultEntry entry : results) {
			if (entry.getAttributeValue("mail") != null && !entry.getAttributeValue("mail").isEmpty()) {
				emails.add(entry.getAttributeValue("mail"));
			}
		}
	}
	return emails;
}
 
开发者ID:wcmc-its,项目名称:ReCiter,代码行数:14,代码来源:LdapIdentityDaoImpl.java

示例5: getProgramsForStudents

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
private Set<String> getProgramsForStudents(String uid) {
	Set<String> departments = new HashSet<>();
	String filter = "(&(objectClass=weillCornellEduSORRecord)(weillCornellEduCWID=" + uid + "))";
	List<SearchResultEntry> results = searchWithBaseDN(filter, "ou=students,ou=sors,dc=weill,dc=cornell,dc=edu");
	for (SearchResultEntry entry : results) {
		if(entry.getAttributeValue("weillCornellEduProgram") != null && !entry.getAttributeValue("weillCornellEduProgram").isEmpty()) {
			departments.add(entry.getAttributeValue("weillCornellEduProgram"));
		}
	}
	return departments;

}
 
开发者ID:wcmc-its,项目名称:ReCiter,代码行数:13,代码来源:LdapIdentityDaoImpl.java

示例6: getHrRelationship

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
private void getHrRelationship(String uid) {
	String filter = "| ldapsearch domain=ED search='(&(objectClass=eduPerson)"
			+ "(|(weillCornellEduPersonTypeCode=academic-faculty-weillfulltime)"
			+ "(weillCornellEduPersonTypeCode=academic-faculty-weillparttime)"
			+ "(weillCornellEduPersonTypeCode=student-phd-*)"
			+ "(weillCornellEduPersonTypeCode=student-md-phd-tri-i)))' attrs='weillCornellEduCWID' "
			+ "| fields weillCornellEduCWID "
			+ "| join weillCornellEduCWID type=inner ["
			+ "| ldapsearch domain=ED search='(&(ou=employees)"
			+ "(objectClass=weillCornellEduSORRecord))' "
			+ "attrs='weillCornellEduCWID,weillCornellEduPrimaryDepartment,weillCornellEduPrimaryDepartmentCode' "
			+ "| fields weillCornellEduCWID,weillCornellEduPrimaryDepartment,weillCornellEduPrimaryDepartmentCode] "
			+ "| rename weillCornellEduCWID as targetCWID "
			+ "| join weillCornellEduPrimaryDepartmentCode type=inner ["
			+ "| ldapsearch domain=ED search='(&(ou=employees)(objectClass=weillCornellEduSORRecord))' "
			+ "attrs='weillCornellEduPrimaryDepartmentCode,weillCornellEduCWID' "
			+ "| stats dc(weillCornellEduCWID) AS count by weillCornellEduPrimaryDepartmentCode "
			+ "| where count < 90] "
			+ "| join weillCornellEduPrimaryDepartmentCode type=left max=0 ["
			+ "| ldapsearch domain=ED search='(&(ou=employees)(objectClass=weillCornellEduSORRecord))' "
			+ "attrs='weillCornellEduPrimaryDepartmentCode,weillCornellEduCWID,sn,givenName' "
			+ "| rename weillCornellEduCWID AS relationshipCWID "
			+ "| fields relationshipCWID, weillCornellEduPrimaryDepartmentCode, sn, givenName] "
			+ "| fields - _* "
			+ "| fields  targetCWID, relationshipCWID, sn, givenName, count, "
			+ "weillCornellEduPrimaryDepartmentCode, weillCornellEduPrimaryDepartment "
			+ "| where targetCWID != relationshipCWID";
	List<SearchResultEntry> results = searchWithBaseDN(filter, "ou=students,ou=sors,dc=weill,dc=cornell,dc=edu");
	for (SearchResultEntry entry : results) {
		if(entry.getAttributeValue("firstname") != null && !entry.getAttributeValue("firstname").isEmpty()) {
			
		}
	}
}
 
开发者ID:wcmc-its,项目名称:ReCiter,代码行数:35,代码来源:LdapIdentityDaoImpl.java

示例7: searchByCwid

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
/**
 * Search LDAP to retrieve name for a given uid.
 * 
 * @param uid
 * 
 * @return AuthorName if found, otherwise null.
 */
private AuthorName searchByCwid(String uid) {
	String filter = "(&(objectClass=eduPerson)" + "(weillCornellEduCWID=" + uid + "))";
	List<SearchResultEntry> results = searchWithBaseDN(filter, "ou=people,dc=weill,dc=cornell,dc=edu");
	if (results != null && !results.isEmpty()) {
		SearchResultEntry entry = results.get(0);
		if(entry.getAttributeValue("weillCornellEduCWID") != null && !entry.getAttributeValue("weillCornellEduCWID").isEmpty()) {
			return new AuthorName(entry.getAttributeValue("givenName"),
					entry.getAttributeValue("weillCornellEduMiddleName"),
					entry.getAttributeValue("sn").replace("- M.D.", ""));
		}
	}
	return null;
}
 
开发者ID:wcmc-its,项目名称:ReCiter,代码行数:21,代码来源:LdapIdentityDaoImpl.java

示例8: createTeamFromLdap

import com.unboundid.ldap.sdk.SearchResultEntry; //导入方法依赖的package包/类
private TeamModel createTeamFromLdap(SearchResultEntry teamEntry) {
	TeamModel answer = new TeamModel(teamEntry.getAttributeValue("cn"));
	// potentially retrieve other attributes here in the future
	
	return answer;		
}
 
开发者ID:warpfork,项目名称:gitblit,代码行数:7,代码来源:LdapUserService.java


注:本文中的com.unboundid.ldap.sdk.SearchResultEntry.getAttributeValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。