org.musicontroller.service
Class UserServiceImpl

java.lang.Object
  extended by org.musicontroller.service.UserServiceImpl
All Implemented Interfaces:
UserService

public class UserServiceImpl
extends java.lang.Object
implements UserService

Implementation of the UserService.

Author:
Varienaja

Constructor Summary
UserServiceImpl()
           
 
Method Summary
 void addUser(IUser user)
          Persists a new User-object in the database.
 UserDao getDao()
          Getter for the UserDao.
 IUser getUserById(long id)
          Returns the User that was persisted under the ID given.
 java.util.List<Role> listRoles()
          Queries the database for a list of all Roles.
 java.util.List<IUser> listUsers()
          Queries the database for a list of all users.
 void saveUser(IUser user)
          Saves changs to an existing user.
 void setDao(UserDao dao)
          Setter for the UserDao.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserServiceImpl

public UserServiceImpl()
Method Detail

getDao

public UserDao getDao()
Getter for the UserDao.

Returns:
The UserDao.

setDao

public void setDao(UserDao dao)
Setter for the UserDao.

Parameters:
dao - The UserDao.

addUser

public void addUser(IUser user)
             throws java.lang.Exception
Description copied from interface: UserService
Persists a new User-object in the database.

Specified by:
addUser in interface UserService
Parameters:
user - The new User
Throws:
java.lang.Exception - when the User's loginname is not unique.

saveUser

public void saveUser(IUser user)
Description copied from interface: UserService
Saves changs to an existing user.

Specified by:
saveUser in interface UserService
Parameters:
user - The changed user.

listUsers

public java.util.List<IUser> listUsers()
Description copied from interface: UserService
Queries the database for a list of all users. The list returned is sorted by loginname.

Specified by:
listUsers in interface UserService
Returns:
A list of users, sorted on loginname.

listRoles

public java.util.List<Role> listRoles()
Description copied from interface: UserService
Queries the database for a list of all Roles.

Specified by:
listRoles in interface UserService
Returns:
A list or roles.

getUserById

public IUser getUserById(long id)
Description copied from interface: UserService
Returns the User that was persisted under the ID given.

Specified by:
getUserById in interface UserService
Parameters:
id - The Id
Returns:
The User with that id, or null if there was no such user.


Copyright © 2010 A.J.V.. All Rights Reserved.