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

All Known Implementing Classes:
RoleGroupManagerImpl

@Transactional
public interface RoleGroupManager


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 nameRoleGroup)
          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 roleGroupId)
          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.
 java.lang.String updateRoleGroup(RoleGroupTO roleGroupTO)
          Update the role group in the registry.
 

Method Detail

init

void init()
Create the "admin" group role if not already exists in database


createRoleGroup

java.lang.String createRoleGroup(RoleGroupTO roleGroupTO)
                                 throws RoleGroupException
Add a new Role Group in registry. The Role Group name must be specified.

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

@Transactional(readOnly=true)
java.util.List<RoleGroupTO> getAllRoleGroup()
                                            throws RoleGroupException
Return the list of all role group in the registry

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

getRoleGroupNotInUser

@Transactional(readOnly=true)
java.util.List<RoleGroupTO> getRoleGroupNotInUser(java.lang.String idUser)
                                                  throws RoleGroupException
Return the list of role group associate with user

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

getRoleGroup

@Transactional(readOnly=true)
RoleGroupTO getRoleGroup(java.lang.String nameRoleGroup)
                         throws RoleGroupException
Retrieve the role group matching the given name

Parameters:
nameRoleGroup - 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

void removeRoleGroup(java.lang.String roleGroupId)
                     throws RoleGroupException
Remove the role group matching the given id from the registry.

Parameters:
roleGroupId - an RoleGroup id
Throws:
RoleGroupException

updateRoleGroup

java.lang.String updateRoleGroup(RoleGroupTO roleGroupTO)
                                 throws RoleGroupException
Update the role group in the registry.

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

addUser

void addUser(java.lang.String idUser,
             java.lang.String idRoleGroup)
             throws RoleGroupException
Add the user matching the given idUser to the roleGroup matching the given idRoleGroup

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

removeUser

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

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


Copyright © 2008-2010 eBMWebsourcing. All Rights Reserved.