本文整理了Java中com.clusterra.iam.core.application.user.UserId.<init>()
方法的一些代码示例,展示了UserId.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UserId.<init>()
方法的具体详情如下:
包路径:com.clusterra.iam.core.application.user.UserId
类名称:UserId
方法名:<init>
暂无
代码示例来源:origin: com.clusterra/pmbok-document
public UserId getModifiedByUserId() {
return new UserId(modifiedByUserId);
}
代码示例来源:origin: com.clusterra/clusterra-pmbok-document
public UserId getCreatedByUserId() {
return new UserId(createdByUserId);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
private void delete(User user) {
applicationEventPublisher.publishEvent(new UserDeletingEvent(this, new UserId(user.getId())));
userRepository.delete(user);
applicationEventPublisher.publishEvent(new UserDeletedEvent(this, new UserId(user.getId())));
}
代码示例来源:origin: com.clusterra/iam-rest
@RequestMapping(value = "/{id}/disable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> disable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.disable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/iam-rest
@RequestMapping(value = "/{id}/enable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> enable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.enable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-rest
@RequestMapping(value = "/{id}/disable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> disable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.disable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-rest
@RequestMapping(value = "/{id}/cancel-invitation", method = RequestMethod.PUT)
public ResponseEntity<UserResource> cancelInvitation(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.cancelInvitation(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/iam-rest
@RequestMapping(value = "/{id}/cancel-invitation", method = RequestMethod.PUT)
public ResponseEntity<UserResource> cancelInvitation(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.cancelInvitation(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-rest
@RequestMapping(value = "/{id}/enable", method = RequestMethod.PUT)
public ResponseEntity<UserResource> enable(@PathVariable String id) throws UserNotFoundException {
User user = userCommandService.enable(new UserId(id));
return new ResponseEntity<>(userResourceAssembler.toResource(user), HttpStatus.ACCEPTED);
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public List<UserId> findUsersByGroup(GroupDescriptor groupDescriptor) {
List<User> users = authorizedMembershipRepository.findUsersByGroupId(groupDescriptor.getGroupId());
List<UserId> result = new ArrayList<>(users.size());
for (User user : users) {
result.add(new UserId(user.getId()));
}
return result;
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public List<UserId> findUsersByGroupAndRole(GroupDescriptor groupDescriptor, RoleDescriptor roleDescriptor) {
List<User> users = authorizedMembershipRepository.findUsersByGroupIdAndRoleId(groupDescriptor.getGroupId(), roleDescriptor.getRoleId());
List<UserId> result = new ArrayList<>(users.size());
for (User user : users) {
result.add(new UserId(user.getId()));
}
return result;
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
@Transactional
public User invite(TenantId tenantId, String email) throws EmailAlreadyExistsException, InvalidEmailException, TenantNotFoundException {
User user = createUser(tenantId, email);
user.setActivationToken();
userRepository.save(user);
applicationEventPublisher.publishEvent(new UserInvitedEvent(this, tenantId, new UserId(user.getId()), email, user.getActivationToken().getToken()));
return user;
}
代码示例来源:origin: com.clusterra/clusterra-pmbok-rest-api
private String getDisplayName(String userId) throws UserNotFoundException {
if (userId == null) {
return "n/a";
}
return userQueryService.findUser(new UserId(userId)).getPerson().getDisplayName();
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
private User createUser(TenantId tenantId, String email) throws InvalidEmailException, EmailAlreadyExistsException, TenantNotFoundException {
checkEmail(email);
Tenant tenant = tenantQueryService.find(tenantId);
User user = new User(EmailValidor.validate(email), tenant);
userRepository.save(user);
applicationEventPublisher.publishEvent(new UserCreatedEvent(this, tenantId, new UserId(user.getId())));
return user;
}
代码示例来源:origin: com.clusterra/pmbok-rest-api
private String getDisplayName(String userId) throws UserNotFoundException {
if (userId == null) {
return "n/a";
}
return userQueryService.findUser(new UserId(userId)).getPerson().getDisplayName();
}
代码示例来源:origin: com.clusterra/clusterra-pmbok-rest-api
private String getDisplayName(String userId) throws UserNotFoundException {
if (userId == null) {
return "n/a";
}
return userQueryService.findUser(new UserId(userId)).getPerson().getDisplayName();
}
代码示例来源:origin: com.clusterra/pmbok-rest-api
private String getDisplayName(String userId) throws UserNotFoundException {
if (userId == null) {
return "n/a";
}
return userQueryService.findUser(new UserId(userId)).getPerson().getDisplayName();
}
代码示例来源:origin: com.clusterra/clusterra-iam-core
private void setPassword(User user, String password) {
user.updatePassword(encryptionService.encrypt(password));
user.resetPasswordToken();
String email = user.getPerson().getContactInformation().getEmail();
applicationEventPublisher.publishEvent(new PasswordChangedEvent(this, new UserId(user.getId()), email));
}
代码示例来源:origin: com.clusterra/iam-rest
@Override
protected UserResource instantiateResource(User entity) {
List<RoleDescriptor> roles = service.findRolesByUser(new UserId(entity.getId()));
return new UserResource(
entity.getId(),
entity.getPerson().getFirstName(),
entity.getPerson().getLastName(),
entity.getPerson().getDisplayName(),
entity.getLogin(),
entity.getPerson().getContactInformation().getEmail(),
entity.getPerson().getAvatarId(),
entity.isEnabled(), toNames(roles));
}
代码示例来源:origin: com.clusterra/clusterra-iam-rest
@Override
protected UserResource instantiateResource(User entity) {
List<RoleDescriptor> roles = service.findRolesByUser(new UserId(entity.getId()));
return new UserResource(
entity.getId(),
entity.getPerson().getFirstName(),
entity.getPerson().getLastName(),
entity.getPerson().getDisplayName(),
entity.getLogin(),
entity.getPerson().getContactInformation().getEmail(),
entity.getPerson().getAvatarId(),
entity.isEnabled(), toNames(roles));
}
内容来源于网络,如有侵权,请联系作者删除!