public class UserService extends AbstractRestService
list
,
get
,
create
andupdate
methods as well as some utilities to the cycle client application.
The arrangement of methods is compatible with angular JS
$resource
.Constructor and Description |
---|
UserService() |
Modifier and Type | Method and Description |
---|---|
String |
changePassword(long userId,
PasswordChangeDTO data) |
UserDTO |
create(UserDTO data) |
void |
delete(long id) |
UserDTO |
get(long id) |
protected User |
getUserById(long id) |
boolean |
isNameAvailable(String name) |
List<UserDTO> |
list()
$resource specific methods
|
protected String |
sendWelcomeEmail(User user,
String password)
Sends a welcome email to the user.
|
UserDTO |
update(UserDTO data) |
badRequest, internalServerError, notAllowed, notFound, redirectTo
public UserDTO get(long id)
@RolesAllowed(value="admin") @Transactional public UserDTO update(UserDTO data)
@RolesAllowed(value="admin") public UserDTO create(UserDTO data)
@RolesAllowed(value="admin") @Transactional public void delete(long id)
public boolean isNameAvailable(String name)
@Transactional public String changePassword(long userId, PasswordChangeDTO data)
protected String sendWelcomeEmail(User user, String password)
user
- the new userprotected User getUserById(long id)
Copyright © 2015. All rights reserved.