本文整理汇总了Java中org.osiam.resources.scim.UpdateUser类的典型用法代码示例。如果您正苦于以下问题:Java UpdateUser类的具体用法?Java UpdateUser怎么用?Java UpdateUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UpdateUser类属于org.osiam.resources.scim包,在下文中一共展示了UpdateUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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));
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例9: synchronizeLdapData
import org.osiam.resources.scim.UpdateUser; //导入依赖的package包/类
private User synchronizeLdapData(DirContextOperations ldapUserData, User user) {
User userToReturn = user;
if (userToReturn == null) {
User newUser = osiamLdapUserContextMapper.mapUser(ldapUserData);
userToReturn = resourceServerConnector.createUser(newUser);
} else if (syncUserData) {
UpdateUser updateUser = osiamLdapUserContextMapper.mapUpdateUser(user, ldapUserData);
userToReturn = resourceServerConnector.updateUser(user.getId(), updateUser);
}
return userToReturn;
}
示例10: updateUser
import org.osiam.resources.scim.UpdateUser; //导入依赖的package包/类
@Command(description = "Update the given user.", startsSubshell = true)
public Object updateUser(
@Param(value = "userName", description = "The name of the user.")
String userName) throws IOException{
final UpdateUserBuilder builder;
final User user;
if(inRecordMode()){
user = null;
builder = new UpdateUserBuilder(null);
}else{
user = getUser(userName);
if(user == null) return "There is no user with the name \"" + userName + "\"!";
builder = new UpdateUserBuilder(user);
}
final Shell subShell = ShellBuilder.subshell("update-user[" + userName + "]", shell)
.behavior()
.disableExitCommand()
.addHandler(builder)
.build();
output.out()
.normal("In this subshell you can edit the user. Leave this sub shell via \"commit\" to persist the changes.")
.println();
subShell.commandLoop();
if(inRecordMode()){
return null;
}else{
final UpdateUser update = builder.build();
if(update == null) return null;
return connector.updateUser(user.getId(), update, accessToken);
}
}
示例11: id_is_null_by_updating_single_user_raises_exception
import org.osiam.resources.scim.UpdateUser; //导入依赖的package包/类
@Test(expected = IllegalArgumentException.class)
public void id_is_null_by_updating_single_user_raises_exception() throws Exception {
UpdateUser updateUser = new UpdateUser.Builder().build();
service.updateUser(null, updateUser, accessToken);
fail("Exception expected");
}
示例12: null_access_token__by_updating_user_rases_exception
import org.osiam.resources.scim.UpdateUser; //导入依赖的package包/类
@Test(expected = NullPointerException.class)
public void null_access_token__by_updating_user_rases_exception() throws Exception {
UpdateUser updateUser = new UpdateUser.Builder().build();
service.updateUser(UPDATE_USER_ID, updateUser, null);
fail("Exception expected");
}
示例13: updateUser
import org.osiam.resources.scim.UpdateUser; //导入依赖的package包/类
public User updateUser(String userId, UpdateUser user) {
return createOsiamConnector().updateUser(userId, user, osiamAccessTokenProvider.createAccessToken());
}
示例14: 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();
}
示例15: updateName
import org.osiam.resources.scim.UpdateUser; //导入依赖的package包/类
private void updateName(UpdateUser.Builder updateBuilder, DirContextOperations ldapUserData) {
updateBuilder.updateName(getName(ldapUserData));
}