本文整理汇总了Java中org.osiam.resources.scim.User.getUserName方法的典型用法代码示例。如果您正苦于以下问题:Java User.getUserName方法的具体用法?Java User.getUserName怎么用?Java User.getUserName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.osiam.resources.scim.User
的用法示例。
在下文中一共展示了User.getUserName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractUserName
import org.osiam.resources.scim.User; //导入方法依赖的package包/类
private String extractUserName(AbstractAuthenticationEvent appEvent) {
if (appEvent.getSource() != null && appEvent.getSource() instanceof InternalAuthentication) {
InternalAuthentication internalAuth = (InternalAuthentication) appEvent.getSource();
if (internalAuth.getPrincipal() != null) {
if (internalAuth.getPrincipal() instanceof User) {
User user = (User) internalAuth.getPrincipal();
return user.getUserName();
}
if (internalAuth.getPrincipal() instanceof String) {
return (String) internalAuth.getPrincipal();
}
}
}
return null;
}
示例2: updateUserName
import org.osiam.resources.scim.User; //导入方法依赖的package包/类
private void updateUserName(User user, UserEntity userEntity, Set<String> attributes) {
if (attributes.contains("userName")) {
throw new OsiamException("Attribute 'userName' cannot be deleted.");
}
String userName = user.getUserName();
if (!Strings.isNullOrEmpty(userName)) {
if (userDao.isUserNameAlreadyTaken(userName, userEntity.getId().toString())) {
throw new ResourceExistsException(String.format("User with userName '%s' already exists", userName));
}
userEntity.setUserName(userName);
}
}
示例3: checkIfInternalUserExists
import org.osiam.resources.scim.User; //导入方法依赖的package包/类
private void checkIfInternalUserExists(User user) {
if (user != null && !hasAuthServerExtension(user)) {
throw new LdapAuthenticationProcessException("Can't create the ldap user with the username '"
+ user.getUserName() + "'. An internal user with the same username already exists.");
}
}
示例4: validateJsonUser
import org.osiam.resources.scim.User; //导入方法依赖的package包/类
@Override
public User validateJsonUser(String json) throws IOException {
User user = mapper.readValue(json, User.class);
if (user.getUserName() == null || user.getUserName().isEmpty()) {
throw new IllegalArgumentException("The attribute 'userName' is mandatory and MUST NOT be null");
}
return user;
}