Liferay 6.1.2-ce-ga3

com.liferay.portal.service
Class RoleServiceWrapper

java.lang.Object
  extended by com.liferay.portal.service.RoleServiceWrapper
All Implemented Interfaces:
BaseService, RoleService, ServiceWrapper<RoleService>

public class RoleServiceWrapper
extends Object
implements RoleService, ServiceWrapper<RoleService>

This class is a wrapper for RoleService.

See Also:
RoleService
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time it is generated.

Constructor Summary
RoleServiceWrapper(RoleService roleService)
           
 
Method Summary
 Role addRole(String className, long classPK, String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, int type, String subType)
          Adds a role.
 Role addRole(String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, int type)
          Deprecated. addRole(String, long, String, Map, Map, int, String)
 void addUserRoles(long userId, long[] roleIds)
          Adds the roles to the user.
 void deleteRole(long roleId)
          Deletes the role with the primary key and its associated permissions.
 String getBeanIdentifier()
          Returns the Spring bean ID for this bean.
 List<Role> getGroupRoles(long groupId)
          Returns all the roles associated with the group.
 Role getRole(long roleId)
          Returns the role with the primary key.
 Role getRole(long companyId, String name)
          Returns the role with the name in the company.
 List<Role> getUserGroupGroupRoles(long userId, long groupId)
          Returns all the user's roles within the user group.
 List<Role> getUserGroupRoles(long userId, long groupId)
          Returns all the user's roles within the user group.
 List<Role> getUserRelatedRoles(long userId, List<Group> groups)
          Returns the union of all the user's roles within the groups.
 List<Role> getUserRoles(long userId)
          Returns all the roles associated with the user.
 RoleService getWrappedRoleService()
          Deprecated. Renamed to getWrappedService()
 RoleService getWrappedService()
           
 boolean hasUserRole(long userId, long companyId, String name, boolean inherited)
          Returns true if the user is associated with the named regular role.
 boolean hasUserRoles(long userId, long companyId, String[] names, boolean inherited)
          Returns true if the user has any one of the named regular roles.
 void setBeanIdentifier(String beanIdentifier)
          Sets the Spring bean ID for this bean.
 void setWrappedRoleService(RoleService roleService)
          Deprecated. Renamed to setWrappedService(com.liferay.portal.service.RoleService)
 void setWrappedService(RoleService roleService)
           
 void unsetUserRoles(long userId, long[] roleIds)
          Removes the matching roles associated with the user.
 Role updateRole(long roleId, String name, Map<Locale,String> titleMap, Map<Locale,String> descriptionMap, String subtype)
          Updates the role with the primary key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleServiceWrapper

public RoleServiceWrapper(RoleService roleService)
Method Detail

getBeanIdentifier

public String getBeanIdentifier()
Returns the Spring bean ID for this bean.

Specified by:
getBeanIdentifier in interface RoleService
Returns:
the Spring bean ID for this bean

setBeanIdentifier

public void setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean.

Specified by:
setBeanIdentifier in interface RoleService
Parameters:
beanIdentifier - the Spring bean ID for this bean

addRole

public Role addRole(String className,
                    long classPK,
                    String name,
                    Map<Locale,String> titleMap,
                    Map<Locale,String> descriptionMap,
                    int type,
                    String subType)
             throws PortalException,
                    SystemException
Adds a role. The user is reindexed after role is added.

Specified by:
addRole in interface RoleService
Parameters:
className - the name of the class for which the role is created
classPK - the primary key of the class for which the role is created (optionally 0)
name - the role's name
titleMap - the role's localized titles (optionally null)
descriptionMap - the role's localized descriptions (optionally null)
type - the role's type (optionally 0)
subType - the role's subtype (optionally null)
Returns:
the role
Throws:
PortalException - if a user with the primary key could not be found, if the user did not have permission to add roles, if the class name or the role name were invalid, or if the role is a duplicate
SystemException - if a system exception occurred

addRole

public Role addRole(String name,
                    Map<Locale,String> titleMap,
                    Map<Locale,String> descriptionMap,
                    int type)
             throws PortalException,
                    SystemException
Deprecated. addRole(String, long, String, Map, Map, int, String)

Adds a role. The user is reindexed after role is added.

Specified by:
addRole in interface RoleService
Parameters:
name - the role's name
titleMap - the role's localized titles (optionally null)
descriptionMap - the role's localized descriptions (optionally null)
type - the role's type (optionally 0)
Returns:
the role
Throws:
PortalException - if a user with the primary key could not be found, if the user did not have permission to add roles, if the class name or the role name were invalid, or if the role is a duplicate
SystemException - if a system exception occurred

addUserRoles

public void addUserRoles(long userId,
                         long[] roleIds)
                  throws PortalException,
                         SystemException
Adds the roles to the user. The user is reindexed after the roles are added.

Specified by:
addUserRoles in interface RoleService
Parameters:
userId - the primary key of the user
roleIds - the primary keys of the roles
Throws:
PortalException - if a user with the primary key could not be found or if the user did not have permission to assign members to one of the roles
SystemException - if a system exception occurred

deleteRole

public void deleteRole(long roleId)
                throws PortalException,
                       SystemException
Deletes the role with the primary key and its associated permissions.

Specified by:
deleteRole in interface RoleService
Parameters:
roleId - the primary key of the role
Throws:
PortalException - if the user did not have permission to delete the role, if a role with the primary key could not be found, if the role is a default system role, or if the role's resource could not be found
SystemException - if a system exception occurred

getGroupRoles

public List<Role> getGroupRoles(long groupId)
                         throws PortalException,
                                SystemException
Returns all the roles associated with the group.

Specified by:
getGroupRoles in interface RoleService
Parameters:
groupId - the primary key of the group
Returns:
the roles associated with the group
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getRole

public Role getRole(long roleId)
             throws PortalException,
                    SystemException
Returns the role with the primary key.

Specified by:
getRole in interface RoleService
Parameters:
roleId - the primary key of the role
Returns:
the role with the primary key
Throws:
PortalException - if a role with the primary key could not be found or if the user did not have permission to view the role
SystemException - if a system exception occurred

getRole

public Role getRole(long companyId,
                    String name)
             throws PortalException,
                    SystemException
Returns the role with the name in the company.

The method searches the system roles map first for default roles. If a role with the name is not found, then the method will query the database.

Specified by:
getRole in interface RoleService
Parameters:
companyId - the primary key of the company
name - the role's name
Returns:
the role with the name
Throws:
PortalException - if a role with the name could not be found in the company or if the user did not have permission to view the role
SystemException - if a system exception occurred

getUserGroupGroupRoles

public List<Role> getUserGroupGroupRoles(long userId,
                                         long groupId)
                                  throws PortalException,
                                         SystemException
Returns all the user's roles within the user group.

Specified by:
getUserGroupGroupRoles in interface RoleService
Parameters:
userId - the primary key of the user
groupId - the primary key of the group
Returns:
the user's roles within the user group
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getUserGroupRoles

public List<Role> getUserGroupRoles(long userId,
                                    long groupId)
                             throws PortalException,
                                    SystemException
Returns all the user's roles within the user group.

Specified by:
getUserGroupRoles in interface RoleService
Parameters:
userId - the primary key of the user
groupId - the primary key of the group
Returns:
the user's roles within the user group
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getUserRelatedRoles

public List<Role> getUserRelatedRoles(long userId,
                                      List<Group> groups)
                               throws PortalException,
                                      SystemException
Returns the union of all the user's roles within the groups.

Specified by:
getUserRelatedRoles in interface RoleService
Parameters:
userId - the primary key of the user
groups - the groups (optionally null)
Returns:
the union of all the user's roles within the groups
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

getUserRoles

public List<Role> getUserRoles(long userId)
                        throws PortalException,
                               SystemException
Returns all the roles associated with the user.

Specified by:
getUserRoles in interface RoleService
Parameters:
userId - the primary key of the user
Returns:
the roles associated with the user
Throws:
PortalException - if a portal exception occurred
SystemException - if a system exception occurred

hasUserRole

public boolean hasUserRole(long userId,
                           long companyId,
                           String name,
                           boolean inherited)
                    throws PortalException,
                           SystemException
Returns true if the user is associated with the named regular role.

Specified by:
hasUserRole in interface RoleService
Parameters:
userId - the primary key of the user
companyId - the primary key of the company
name - the name of the role
inherited - whether to include the user's inherited roles in the search
Returns:
true if the user is associated with the regular role; false otherwise
Throws:
PortalException - if a role with the name could not be found in the company or if a default user for the company could not be found
SystemException - if a system exception occurred

hasUserRoles

public boolean hasUserRoles(long userId,
                            long companyId,
                            String[] names,
                            boolean inherited)
                     throws PortalException,
                            SystemException
Returns true if the user has any one of the named regular roles.

Specified by:
hasUserRoles in interface RoleService
Parameters:
userId - the primary key of the user
companyId - the primary key of the company
names - the names of the roles
inherited - whether to include the user's inherited roles in the search
Returns:
true if the user has any one of the regular roles; false otherwise
Throws:
PortalException - if any one of the roles with the names could not be found in the company or if the default user for the company could not be found
SystemException - if a system exception occurred

unsetUserRoles

public void unsetUserRoles(long userId,
                           long[] roleIds)
                    throws PortalException,
                           SystemException
Removes the matching roles associated with the user. The user is reindexed after the roles are removed.

Specified by:
unsetUserRoles in interface RoleService
Parameters:
userId - the primary key of the user
roleIds - the primary keys of the roles
Throws:
PortalException - if a user with the primary key could not be found, if the user did not have permission to remove members from a role, or if a role with any one of the primary keys could not be found
SystemException - if a system exception occurred

updateRole

public Role updateRole(long roleId,
                       String name,
                       Map<Locale,String> titleMap,
                       Map<Locale,String> descriptionMap,
                       String subtype)
                throws PortalException,
                       SystemException
Updates the role with the primary key.

Specified by:
updateRole in interface RoleService
Parameters:
roleId - the primary key of the role
name - the role's new name
titleMap - the new localized titles (optionally null) to replace those existing for the role
descriptionMap - the new localized descriptions (optionally null) to replace those existing for the role
subtype - the role's new subtype (optionally null)
Returns:
the role with the primary key
Throws:
PortalException - if the user did not have permission to update the role, if a role with the primary could not be found, or if the role's name was invalid
SystemException - if a system exception occurred

getWrappedRoleService

public RoleService getWrappedRoleService()
Deprecated. Renamed to getWrappedService()


setWrappedRoleService

public void setWrappedRoleService(RoleService roleService)
Deprecated. Renamed to setWrappedService(com.liferay.portal.service.RoleService)


getWrappedService

public RoleService getWrappedService()
Specified by:
getWrappedService in interface ServiceWrapper<RoleService>

setWrappedService

public void setWrappedService(RoleService roleService)
Specified by:
setWrappedService in interface ServiceWrapper<RoleService>

Liferay 6.1.2-ce-ga3