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


Java UpdateUser.Builder方法代码示例

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


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

示例1: updatePhoto

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updatePhoto(UpdateUser.Builder updateBuilder, List<Photo> photos, String value, String scimAttribute) {
    try {
        for (Photo photo : photos) {
            if (photo.getType() != null && photo.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
                updateBuilder.deletePhoto(photo);
            }
        }
        if (value.length() > 0) {
            Photo newPhoto = new Photo.Builder()
                    .setValue(new URI(value))
                    .setType(new Photo.Type(LdapAuthentication.LDAP_PROVIDER))
                    .build();
            updateBuilder.addPhoto(newPhoto);
        }
    } catch (URISyntaxException e) {
        throw new LdapConfigurationException("Could not map the ldap attibute '"
                + scimLdapAttributes.toLdapAttribute(scimAttribute) + "' with the value '" + value
                + "' into an scim photo because the value could not be converted into an URI.", e);
    }
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:21,代码来源:OsiamLdapUserContextMapper.java

示例2: updateAddress

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updateAddress(UpdateUser.Builder updateBuilder, List<Address> addresses,
        DirContextOperations ldapUserData) {
    for (Address address : addresses) {
        if (address.getType() != null && address.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteAddress(address);
        }
    }

    List<Address> newAddresses = getAddresses(ldapUserData);
    if (!newAddresses.isEmpty()) {
        updateBuilder.addAddress(newAddresses.get(0));
    }
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:14,代码来源:OsiamLdapUserContextMapper.java

示例3: updateEmail

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updateEmail(UpdateUser.Builder updateBuilder, List<Email> emails, String emailValue) {
    Email newEmail = new Email.Builder().setValue(emailValue)
            .setType(new Email.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (Email email : emails) {
        if (email.getType() != null && email.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteEmail(email);
        }
    }
    updateBuilder.addEmail(newEmail);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:11,代码来源:OsiamLdapUserContextMapper.java

示例4: updateEntitlement

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updateEntitlement(UpdateUser.Builder updateBuilder, List<Entitlement> entitlements, String value) {
    Entitlement newEntitlement = new Entitlement.Builder().setValue(value)
            .setType(new Entitlement.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (Entitlement entitlement : entitlements) {
        if (entitlement.getType() != null
                && entitlement.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteEntitlement(entitlement);
        }
    }
    updateBuilder.addEntitlement(newEntitlement);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:12,代码来源:OsiamLdapUserContextMapper.java

示例5: updateIm

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updateIm(UpdateUser.Builder updateBuilder, List<Im> ims, String value) {
    Im newIm = new Im.Builder().setValue(value).setType(new Im.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (Im im : ims) {
        if (im.getType() != null && im.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteIm(im);
        }
    }
    updateBuilder.addIm(newIm);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:10,代码来源:OsiamLdapUserContextMapper.java

示例6: updatePhoneNumber

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updatePhoneNumber(UpdateUser.Builder updateBuilder, List<PhoneNumber> phoneNumbers, String value) {
    PhoneNumber newPhoneNumber = new PhoneNumber.Builder().setValue(value)
            .setType(new PhoneNumber.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (PhoneNumber phoneNumber : phoneNumbers) {
        if (phoneNumber.getType() != null
                && phoneNumber.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deletePhoneNumber(phoneNumber);
        }
    }
    updateBuilder.addPhoneNumber(newPhoneNumber);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:12,代码来源:OsiamLdapUserContextMapper.java

示例7: updateRole

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updateRole(UpdateUser.Builder updateBuilder, List<Role> roles, String value) {
    Role newRole = new Role.Builder().setValue(value).setType(new Role.Type(LdapAuthentication.LDAP_PROVIDER))
            .build();
    for (Role role : roles) {
        if (role.getType() != null && role.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteRole(role);
        }
    }
    updateBuilder.addRole(newRole);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:11,代码来源:OsiamLdapUserContextMapper.java

示例8: updateX509Certificate

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updateX509Certificate(UpdateUser.Builder updateBuilder, List<X509Certificate> x509Certificates,
        String value) {
    X509Certificate newX509Certificate = new X509Certificate.Builder().setValue(value)
            .setType(new X509Certificate.Type(LdapAuthentication.LDAP_PROVIDER)).build();
    for (X509Certificate x509Certificate : x509Certificates) {
        if (x509Certificate.getType() != null
                && x509Certificate.getType().toString().equals(LdapAuthentication.LDAP_PROVIDER)) {
            updateBuilder.deleteX509Certificate(x509Certificate);
        }
    }
    updateBuilder.addX509Certificate(newX509Certificate);
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:13,代码来源:OsiamLdapUserContextMapper.java

示例9: mapUpdateUser

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
public UpdateUser mapUpdateUser(User user, DirContextOperations ldapUserData) {

        UpdateUser.Builder updateBuilder = new UpdateUser.Builder();

        for (String scimAttribute : scimLdapAttributes.scimAttributes()) {
            String ldapValue = ldapUserData.getStringAttribute(scimLdapAttributes.toLdapAttribute(scimAttribute));

            if (ldapValue == null) {
                ldapValue = "";
            }

            switch (scimAttribute) {
            case "userName":
                break;
            case "displayName":
                updateBuilder.updateDisplayName(ldapValue);
                break;
            case "email":
                updateEmail(updateBuilder, user.getEmails(), ldapValue);
                break;
            case "entitlement":
                updateEntitlement(updateBuilder, user.getEntitlements(), ldapValue);
                break;
            case "externalId":
                updateBuilder.updateExternalId(ldapValue);
                break;
            case "im":
                updateIm(updateBuilder, user.getIms(), ldapValue);
                break;
            case "locale":
                updateBuilder.updateLocale(ldapValue);
                break;
            case "nickName":
                updateBuilder.updateNickName(ldapValue);
                break;
            case "phoneNumber":
                updatePhoneNumber(updateBuilder, user.getPhoneNumbers(), ldapValue);
                break;
            case "photo":
                updatePhoto(updateBuilder, user.getPhotos(), ldapValue, scimAttribute);
                break;
            case "preferredLanguage":
                updateBuilder.updatePreferredLanguage(ldapValue);
                break;
            case "profileUrl":
                updateBuilder.updateProfileUrl(ldapValue);
                break;
            case "role":
                updateRole(updateBuilder, user.getRoles(), ldapValue);
                break;
            case "timezone":
                updateBuilder.updateTimezone(ldapValue);
                break;
            case "title":
                updateBuilder.updateTitle(ldapValue);
                break;
            case "userType":
                updateBuilder.updateUserType(ldapValue);
                break;
            case "x509Certificate":
                updateX509Certificate(updateBuilder, user.getX509Certificates(), ldapValue);
                break;
            default:
                if (!scimAttribute.startsWith("address.") && !scimAttribute.startsWith("name.")) {
                    throw createAttributeNotRecognizedException(scimAttribute);
                }
            }
        }

        updateAddress(updateBuilder, user.getAddresses(), ldapUserData);
        updateName(updateBuilder, ldapUserData);

        return updateBuilder.build();
    }
 
开发者ID:osiam,项目名称:auth-server,代码行数:75,代码来源:OsiamLdapUserContextMapper.java

示例10: updateName

import org.osiam.resources.scim.UpdateUser; //导入方法依赖的package包/类
private void updateName(UpdateUser.Builder updateBuilder, DirContextOperations ldapUserData) {
    updateBuilder.updateName(getName(ldapUserData));
}
 
开发者ID:osiam,项目名称:auth-server,代码行数:4,代码来源:OsiamLdapUserContextMapper.java


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