org.ow2.dragon.service.administration
Class UserManagerImpl

java.lang.Object
  extended by org.ow2.dragon.service.administration.UserManagerImpl
All Implemented Interfaces:
UserManager

public class UserManagerImpl
extends java.lang.Object
implements UserManager

Author:
strino - eBM WebSourcing

Constructor Summary
UserManagerImpl()
           
 
Method Summary
 void addRoleGroup(java.lang.String idUser, java.lang.String idRoleGroup)
          Add the role group matching the given idRoleGroup to the user matching the given idUser
 java.lang.String createUser(UserTO userTO)
          Add a new User in registry.
 java.util.List<UserTO> getAllUser()
          Return the list of all users in the registry
 UserTO getUser(java.lang.String userId)
          Retrieve the user matching the given name
 UserTO getUserByLogin(java.lang.String login)
          Retrieve the user matching the given login
 java.util.List<UserTO> getUserNotInRoleGroup(java.lang.String idRoleGroup)
          Return the list of users associate with role group
 void init()
          Create user (master) if not already exists in database
 void removeRoleGroup(java.lang.String idUser, java.lang.String idRoleGroup)
          Remove the role group matching the given idRoleGroup from the list of role groups of the user matching the given idUser.
 void removeUser(java.lang.String userId)
          Remove the user matching the given id from the registry.
 void setRoleGroupDAO(RoleGroupDAO roleGroupDAO)
           
 void setRolesAndUsersTransfertObjectAssembler(RolesAndUsersTransfertObjectAssembler rolesAndUsersTransfertObjectAssembler)
           
 void setUserDAO(UserDAO userDAO)
           
 java.lang.String updateUser(UserTO userTO)
          Update the user in the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserManagerImpl

public UserManagerImpl()
Method Detail

init

public void init()
Description copied from interface: UserManager
Create user (master) if not already exists in database

Specified by:
init in interface UserManager

createUser

public java.lang.String createUser(UserTO userTO)
                            throws UserException
Description copied from interface: UserManager
Add a new User in registry. The User name must be specified.

Specified by:
createUser in interface UserManager
Parameters:
userTO - the UserTO handling data of the User to create
Returns:
the id of the added User
Throws:
UserException - if you try to create an user with name that already exists or an user without name

getAllUser

public java.util.List<UserTO> getAllUser()
                                  throws UserException
Description copied from interface: UserManager
Return the list of all users in the registry

Specified by:
getAllUser in interface UserManager
Returns:
the List of all UserTO in the registry, couldn't be null, can be empty
Throws:
UserException

getUserNotInRoleGroup

public java.util.List<UserTO> getUserNotInRoleGroup(java.lang.String idRoleGroup)
                                             throws UserException
Description copied from interface: UserManager
Return the list of users associate with role group

Specified by:
getUserNotInRoleGroup in interface UserManager
Parameters:
idRoleGroup - an RoleGroup id
Returns:
the List of UserTO associate with RoleGroup, couldn't be null, can be empty
Throws:
UserException

getUser

public UserTO getUser(java.lang.String userId)
               throws UserException
Description copied from interface: UserManager
Retrieve the user matching the given name

Specified by:
getUser in interface UserManager
Returns:
the UserTO handling data of the User that matches the given id
Throws:
UserException - if no role group found for the given name

getUserByLogin

public UserTO getUserByLogin(java.lang.String login)
                      throws UserException
Description copied from interface: UserManager
Retrieve the user matching the given login

Specified by:
getUserByLogin in interface UserManager
Parameters:
login - an User login
Returns:
the UserTO handling data of the User that matches the given id
Throws:
UserException - if no role group found for the given name

removeUser

public void removeUser(java.lang.String userId)
                throws UserException
Description copied from interface: UserManager
Remove the user matching the given id from the registry.

Specified by:
removeUser in interface UserManager
Parameters:
userId - an User id
Throws:
UserException

updateUser

public java.lang.String updateUser(UserTO userTO)
                            throws UserException
Description copied from interface: UserManager
Update the user in the registry.

Specified by:
updateUser in interface UserManager
Parameters:
userTO - the UserTO handling data of the User to update
Returns:
the updated user ID
Throws:
UserException - if an error occurs during user update : user to update doesn't exist or have the same name as an other registered user

addRoleGroup

public void addRoleGroup(java.lang.String idUser,
                         java.lang.String idRoleGroup)
                  throws UserException
Description copied from interface: UserManager
Add the role group matching the given idRoleGroup to the user matching the given idUser

Specified by:
addRoleGroup in interface UserManager
Parameters:
idUser - an User id
idRoleGroup - a RoleGroup id
Throws:
UserException - if at least one of the given id doesn't exist in database

removeRoleGroup

public void removeRoleGroup(java.lang.String idUser,
                            java.lang.String idRoleGroup)
                     throws UserException
Description copied from interface: UserManager
Remove the role group matching the given idRoleGroup from the list of role groups of the user matching the given idUser. The role group isn't removed from the registry and can be re-affected to any organization

Specified by:
removeRoleGroup in interface UserManager
Parameters:
idUser - an User id
idRoleGroup - a RoleGroup id
Throws:
UserException - if no organization found for the given id

setRolesAndUsersTransfertObjectAssembler

public void setRolesAndUsersTransfertObjectAssembler(RolesAndUsersTransfertObjectAssembler rolesAndUsersTransfertObjectAssembler)

setUserDAO

public void setUserDAO(UserDAO userDAO)

setRoleGroupDAO

public void setRoleGroupDAO(RoleGroupDAO roleGroupDAO)


Copyright © 2008-2010 eBMWebsourcing. All Rights Reserved.