org.ow2.dragon.api.service.administration
Interface UserManager

All Known Implementing Classes:
UserManagerImpl

@Transactional
public interface UserManager

A manager of User. Provides methods to create, retrieve, delete or update User and to manage role group related to User. Method arguments must be non null, unless the contrary is explicitly specified.

Author:
ambarthe, ofabre - eBM WebSourcing

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.
 java.lang.String updateUser(UserTO userTO)
          Update the user in the registry.
 

Method Detail

init

void init()
Create user (master) if not already exists in database


createUser

java.lang.String createUser(UserTO userTO)
                            throws UserException
Add a new User in registry. The User name must be specified.

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

@Transactional(readOnly=true)
java.util.List<UserTO> getAllUser()
                                  throws UserException
Return the list of all users in the registry

Returns:
the List of all UserTO in the registry, couldn't be null, can be empty
Throws:
UserException

getUserNotInRoleGroup

@Transactional(readOnly=true)
java.util.List<UserTO> getUserNotInRoleGroup(java.lang.String idRoleGroup)
                                             throws UserException
Return the list of users associate with role group

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

getUser

@Transactional(readOnly=true)
UserTO getUser(java.lang.String userId)
               throws UserException
Retrieve the user matching the given name

Parameters:
userName - an User name
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

@Transactional(readOnly=true)
UserTO getUserByLogin(java.lang.String login)
                      throws UserException
Retrieve the user matching the given login

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

void removeUser(java.lang.String userId)
                throws UserException
Remove the user matching the given id from the registry.

Parameters:
userId - an User id
Throws:
UserException

updateUser

java.lang.String updateUser(UserTO userTO)
                            throws UserException
Update the user in the registry.

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

void addRoleGroup(java.lang.String idUser,
                  java.lang.String idRoleGroup)
                  throws UserException
Add the role group matching the given idRoleGroup to the user matching the given idUser

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

void removeRoleGroup(java.lang.String idUser,
                     java.lang.String idRoleGroup)
                     throws UserException
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

Parameters:
idUser - an User id
idRoleGroup - a RoleGroup id
Throws:
UserException - if no organization found for the given id


Copyright © 2008-2010 eBMWebsourcing. All Rights Reserved.