org.ow2.dragon.service.administration
Class RoleGroupManagerImpl

java.lang.Object
  extended by org.ow2.dragon.service.administration.RoleGroupManagerImpl
All Implemented Interfaces:
RoleGroupManager

public class RoleGroupManagerImpl
extends java.lang.Object
implements RoleGroupManager

Author:
strino - eBM WebSourcing

Constructor Summary
RoleGroupManagerImpl()
           
 
Method Summary
 void addUser(java.lang.String idUser, java.lang.String idRoleGroup)
          Add the user matching the given idUser to the roleGroup matching the given idRoleGroup
 java.lang.String createRoleGroup(RoleGroupTO roleGroupTO)
          Add a new Role Group in registry.
 java.util.List<RoleGroupTO> getAllRoleGroup()
          Return the list of all role group in the registry
 RoleGroupTO getRoleGroup(java.lang.String idGroup)
          Retrieve the role group matching the given name
 java.util.List<RoleGroupTO> getRoleGroupNotInUser(java.lang.String idUser)
          Return the list of role group associate with user
 void init()
          Create the "admin" group role if not already exists in database
 void removeRoleGroup(java.lang.String idGroup)
          Remove the role group matching the given id from the registry.
 void removeUser(java.lang.String idUser, java.lang.String idRoleGroup)
          Remove the user matching the given idUser from the list of users of the roleGroup matching the given idRoleGroup.
 void setRoleDAO(RoleDAO roleDAO)
           
 void setRoleGroupDAO(RoleGroupDAO roleGroupDAO)
           
 void setRolesAndUsersTransfertObjectAssembler(RolesAndUsersTransfertObjectAssembler rolesAndUsersTransfertObjectAssembler)
           
 void setUserDAO(UserDAO userDAO)
           
 java.lang.String updateRoleGroup(RoleGroupTO roleGroupTO)
          Update the role group in the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleGroupManagerImpl

public RoleGroupManagerImpl()
Method Detail

init

public void init()
Description copied from interface: RoleGroupManager
Create the "admin" group role if not already exists in database

Specified by:
init in interface RoleGroupManager

createRoleGroup

public java.lang.String createRoleGroup(RoleGroupTO roleGroupTO)
                                 throws RoleGroupException
Description copied from interface: RoleGroupManager
Add a new Role Group in registry. The Role Group name must be specified.

Specified by:
createRoleGroup in interface RoleGroupManager
Parameters:
roleGroupTO - the RoleGroupTO handling data of the RoleGroup to create
Returns:
the id of the added RoleGroup
Throws:
RoleGroupException - if you try to create an role group with name that already exists or an role group without name

getAllRoleGroup

public java.util.List<RoleGroupTO> getAllRoleGroup()
                                            throws RoleGroupException
Description copied from interface: RoleGroupManager
Return the list of all role group in the registry

Specified by:
getAllRoleGroup in interface RoleGroupManager
Returns:
the List of all RoleGroupTO in the registry, couldn't be null, can be empty
Throws:
RoleGroupException

getRoleGroupNotInUser

public java.util.List<RoleGroupTO> getRoleGroupNotInUser(java.lang.String idUser)
                                                  throws RoleGroupException
Description copied from interface: RoleGroupManager
Return the list of role group associate with user

Specified by:
getRoleGroupNotInUser in interface RoleGroupManager
Parameters:
idUser - an User id
Returns:
the List of role group associate with user , couldn't be null, can be empty
Throws:
RoleGroupException

getRoleGroup

public RoleGroupTO getRoleGroup(java.lang.String idGroup)
                         throws RoleGroupException
Description copied from interface: RoleGroupManager
Retrieve the role group matching the given name

Specified by:
getRoleGroup in interface RoleGroupManager
Parameters:
idGroup - an RoleGroup name
Returns:
the RoleGroupTO handling data of the RoleGroup that matches the given id
Throws:
RoleGroupException - if no role group found for the given name

removeRoleGroup

public void removeRoleGroup(java.lang.String idGroup)
                     throws RoleGroupException
Description copied from interface: RoleGroupManager
Remove the role group matching the given id from the registry.

Specified by:
removeRoleGroup in interface RoleGroupManager
Parameters:
idGroup - an RoleGroup id
Throws:
RoleGroupException

updateRoleGroup

public java.lang.String updateRoleGroup(RoleGroupTO roleGroupTO)
                                 throws RoleGroupException
Description copied from interface: RoleGroupManager
Update the role group in the registry.

Specified by:
updateRoleGroup in interface RoleGroupManager
Parameters:
roleGroupTO - the RoleGroupTO handling data of the RoleGroup to update
Returns:
the updated role group ID
Throws:
RoleGroupException - if an error occurs during role group update : role group to update doesn't exist or have the same name as an other registered role group

removeUser

public void removeUser(java.lang.String idUser,
                       java.lang.String idRoleGroup)
                throws RoleGroupException
Description copied from interface: RoleGroupManager
Remove the user matching the given idUser from the list of users of the roleGroup matching the given idRoleGroup. The user isn't removed from the registry and can be re-affected to any roles

Specified by:
removeUser in interface RoleGroupManager
Parameters:
idUser - an User id
idRoleGroup - a RoleGroup id
Throws:
RoleGroupException - if no organization found for the given id

addUser

public void addUser(java.lang.String idUser,
                    java.lang.String idRoleGroup)
             throws RoleGroupException
Description copied from interface: RoleGroupManager
Add the user matching the given idUser to the roleGroup matching the given idRoleGroup

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

setRolesAndUsersTransfertObjectAssembler

public void setRolesAndUsersTransfertObjectAssembler(RolesAndUsersTransfertObjectAssembler rolesAndUsersTransfertObjectAssembler)

setRoleGroupDAO

public void setRoleGroupDAO(RoleGroupDAO roleGroupDAO)

setRoleDAO

public void setRoleDAO(RoleDAO roleDAO)

setUserDAO

public void setUserDAO(UserDAO userDAO)


Copyright © 2008-2010 eBMWebsourcing. All Rights Reserved.