|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openwms.core.service.spring.UserServiceImpl
@Transactional @Service(value="userService") public class UserServiceImpl
An UserServiceImpl is a Spring supported transactional implementation of a
general UserService
. Using Spring 2 annotation support autowires
collaborators, therefore XML configuration becomes obsolete. This class is
marked with Springs Service
annotation to benefit from Springs
exception translation intercepter. Traditional CRUD operations are delegated
to an UserDao
.
This implementation can be autowired with the name "userService".
UserDao
Field Summary | |
---|---|
static String |
COMPONENT_NAME
Springs service name. |
Constructor Summary | |
---|---|
UserServiceImpl()
|
Method Summary | |
---|---|
void |
changeUserPassword(UserPassword userPassword)
Change the current User s password. |
SystemUser |
createSystemUser()
Create and return the SystemUser . |
List<User> |
findAll()
Find and return all User s. |
User |
getTemplate(String username)
Return a transient User entity object, serving as a template. |
void |
remove(User user)
Remove an User . |
User |
save(User user)
Update the given User or persist it when it is a transient one. |
User |
saveUserProfile(User user,
UserPassword userPassword,
UserPreference... prefs)
Save changes on an User and additionally save the User's password
and preferences. |
void |
uploadImageFile(String username,
byte[] image)
Call this method to store an image for an User . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String COMPONENT_NAME
Constructor Detail |
---|
public UserServiceImpl()
Method Detail |
---|
public List<User> findAll()
User
s.
findAll
in interface UserService
User
s@FireAfterTransaction(events=UserChangedEvent.class) public void uploadImageFile(String username, byte[] image)
User
.
uploadImageFile
in interface UserService
username
- Username of the User
image
- Image to be stored
UserNotFoundException
- when no User was found with this username.@FireAfterTransaction(events=UserChangedEvent.class) public User save(User user)
User
or persist it when it is a transient one.
save
in interface UserService
user
- User
entity to save
User
instance
IllegalArgumentException
- when user
is null
@FireAfterTransaction(events=UserChangedEvent.class) public void remove(User user)
User
.
remove
in interface UserService
user
- User
to be removed
IllegalArgumentException
- when user
is null
@Transactional(readOnly=true) public User getTemplate(String username)
User
entity object, serving as a template.
Marked as readOnly
transactional method.
getTemplate
in interface UserService
username
- Username of the User
User
template@Transactional(readOnly=true) public SystemUser createSystemUser()
SystemUser
.
Marked as readOnly
transactional method.
createSystemUser
in interface UserService
SystemUser
instance@FireAfterTransaction(events=UserChangedEvent.class) public void changeUserPassword(UserPassword userPassword)
User
s password.
changeUserPassword
in interface UserService
userPassword
- The UserPassword
to change
IllegalArgumentException
- when userPassword
is null
ServiceRuntimeException
- when userPassword
is not a valid password
UserNotFoundException
- when no User
exist@FireAfterTransaction(events=UserChangedEvent.class) public User saveUserProfile(User user, UserPassword userPassword, UserPreference... prefs)
User
and additionally save the User's password
and preferences.
saveUserProfile
in interface UserService
user
- The User
to changeuserPassword
- The User
s passwordprefs
- An array of UserPreference
objects
User
instance
IllegalArgumentException
- when user
is null
UserService.saveUserProfile(org.openwms.core.domain.system.usermanagement.User,
org.openwms.core.domain.system.usermanagement.UserPassword,
org.openwms.core.domain.system.usermanagement.UserPreference[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |