本文整理匯總了Java中org.springframework.ldap.core.DirContextOperations.getAttributes方法的典型用法代碼示例。如果您正苦於以下問題:Java DirContextOperations.getAttributes方法的具體用法?Java DirContextOperations.getAttributes怎麽用?Java DirContextOperations.getAttributes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.ldap.core.DirContextOperations
的用法示例。
在下文中一共展示了DirContextOperations.getAttributes方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: mapBuilderFromContext
import org.springframework.ldap.core.DirContextOperations; //導入方法依賴的package包/類
Principal.Builder mapBuilderFromContext(DirContextOperations context) {
final String entityId = context.getStringAttribute(getConstants().getKimLdapIdProperty());
final String principalName = context.getStringAttribute(getConstants().getKimLdapNameProperty());
final Principal.Builder person = Principal.Builder.create(principalName);
if (entityId == null) {
throw new InvalidLdapEntityException("LDAP Search Results yielded an invalid result with attributes "
+ context.getAttributes());
}
person.setPrincipalId(entityId);
person.setEntityId(entityId);
person.setActive(isPersonActive(context));
return person;
}
示例2: mapBuilderFromContext
import org.springframework.ldap.core.DirContextOperations; //導入方法依賴的package包/類
EntityDefault.Builder mapBuilderFromContext(DirContextOperations context) {
final String entityId = context.getStringAttribute(getConstants().getKimLdapIdProperty());
final String principalName = context.getStringAttribute(getConstants().getKimLdapNameProperty());
final EntityDefault.Builder person = EntityDefault.Builder.create(entityId);
if (entityId == null) {
throw new InvalidLdapEntityException("LDAP Search Results yielded an invalid result with attributes "
+ context.getAttributes());
}
person.setAffiliations(new ArrayList<EntityAffiliation.Builder>());
person.setExternalIdentifiers(new ArrayList<EntityExternalIdentifier.Builder>());
final EntityExternalIdentifier.Builder externalId = EntityExternalIdentifier.Builder.create();
externalId.setExternalIdentifierTypeCode(getConstants().getTaxExternalIdTypeCode());
externalId.setExternalId(entityId);
person.getExternalIdentifiers().add(externalId);
person.setAffiliations(getAffiliationMapper().mapBuilderFromContext(context));
person.setEntityTypeContactInfos(new ArrayList<EntityTypeContactInfoDefault.Builder>());
person.getEntityTypeContactInfos().add(getEntityTypeContactInfoDefaultMapper().mapBuilderFromContext(context));
person.setName(getDefaultNameMapper().mapBuilderFromContext(context));
person.setEntityId(entityId);
person.setEmployment(getEmploymentMapper().mapBuilderFromContext(context));
person.setEntityId(entityId);
person.setPrincipals(new ArrayList<Principal.Builder>());
//inactivate unless we find a matching affiliation
person.setActive(true);
final Principal.Builder defaultPrincipal = Principal.Builder.create(principalName);
defaultPrincipal.setPrincipalId(entityId);
defaultPrincipal.setEntityId(entityId);
person.getPrincipals().add(defaultPrincipal);
return person;
}
示例3: mapBuilderFromContext
import org.springframework.ldap.core.DirContextOperations; //導入方法依賴的package包/類
Entity.Builder mapBuilderFromContext(DirContextOperations context) {
final String entityId = context.getStringAttribute(getConstants().getKimLdapIdProperty());
final String principalName = context.getStringAttribute(getConstants().getKimLdapNameProperty());
final Entity.Builder person = Entity.Builder.create();
person.setId(entityId);
if (entityId == null) {
throw new InvalidLdapEntityException("LDAP Search Results yielded an invalid result with attributes "
+ context.getAttributes());
}
person.setAffiliations(new ArrayList<EntityAffiliation.Builder>());
person.setExternalIdentifiers(new ArrayList<EntityExternalIdentifier.Builder>());
final EntityExternalIdentifier.Builder externalId = EntityExternalIdentifier.Builder.create();
externalId.setExternalIdentifierTypeCode(getConstants().getTaxExternalIdTypeCode());
externalId.setExternalId(entityId);
person.getExternalIdentifiers().add(externalId);
person.setAffiliations(getAffiliationMapper().mapBuilderFromContext(context));
person.setEntityTypes(new ArrayList<EntityTypeContactInfo.Builder>());
person.getEntityTypeContactInfos().add(getEntityTypeContactInfoMapper().mapBuilderFromContext(context));
final List<EntityName.Builder> names = new ArrayList<EntityName.Builder>();
final EntityName.Builder name = getDefaultNameMapper().mapBuilderFromContext(context);
names.add(name);
name.setDefaultValue(true);
person.setNames(names);
person.setId(entityId);
final EntityEmployment.Builder employmentInfo = (EntityEmployment.Builder) getEmploymentMapper().mapFromContext(context);
final EntityAffiliation.Builder employeeAffiliation = getAffiliation(getConstants().getEmployeeAffiliationCodes(), person);
//only add employee information if we have an employee affiliation, otherwise ignore
if (employeeAffiliation != null && employmentInfo != null) {
employeeAffiliation.getAffiliationType().setEmploymentAffiliationType(true);
employmentInfo.setEntityAffiliation(employeeAffiliation);
person.getEmploymentInformation().add(employmentInfo);
}
person.setPrincipals(new ArrayList<Principal.Builder>());
person.setActive(true);
final Principal.Builder defaultPrincipal = Principal.Builder.create(principalName);
defaultPrincipal.setPrincipalId(entityId);
defaultPrincipal.setEntityId(entityId);
person.getPrincipals().add(defaultPrincipal);
return person;
}