org.camunda.bpm.cycle.web.service.resource
Class UserService

java.lang.Object
  extended by org.camunda.bpm.cycle.web.service.AbstractRestService
      extended by org.camunda.bpm.cycle.web.service.resource.UserService

public class UserService
extends AbstractRestService

This is the user rest controller which exposes user 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.

Author:
nico.rehwaldt

Constructor Summary
UserService()
           
 
Method Summary
 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)
           
 
Methods inherited from class org.camunda.bpm.cycle.web.service.AbstractRestService
badRequest, internalServerError, notAllowed, notFound, redirectTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserService

public UserService()
Method Detail

list

public List<UserDTO> list()
$resource specific methods


get

public UserDTO get(long id)

update

@RolesAllowed(value="admin")
@Transactional
public UserDTO update(UserDTO data)

create

@RolesAllowed(value="admin")
public UserDTO create(UserDTO data)

delete

@RolesAllowed(value="admin")
@Transactional
public void delete(long id)

isNameAvailable

public boolean isNameAvailable(String name)

changePassword

@Transactional
public String changePassword(long userId,
                                           PasswordChangeDTO data)

sendWelcomeEmail

protected String sendWelcomeEmail(User user,
                                  String password)
Sends a welcome email to the user. If the email can be sent successfully, this method returns the string "success". Otherwise this method returns an exception message.

Parameters:
user - the new user
Returns:
a string indicating the outcome of the email sending operation

getUserById

protected User getUserById(long id)


Copyright © 2014 camunda services GmbH. All rights reserved.