Liferay 6.0-ee-sp2

com.liferay.portal.service
Interface RoleLocalService

All Superinterfaces:
PersistedModelLocalService
All Known Implementing Classes:
RoleLocalServiceWrapper

@Transactional(isolation=PORTAL,
               rollbackFor={PortalException.class,SystemException.class})
public interface RoleLocalService
extends PersistedModelLocalService

The interface for the role local service.

This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.

See Also:
RoleLocalServiceUtil, RoleLocalServiceBaseImpl, com.liferay.portal.service.impl.RoleLocalServiceImpl

Method Summary
 Role addRole(long userId, long companyId, String name, Map<Locale,String> titleMap, String description, int type)
           
 Role addRole(long userId, long companyId, String name, Map<Locale,String> titleMap, String description, int type, String className, long classPK)
           
 Role addRole(Role role)
          Adds the role to the database.
 void addUserRoles(long userId, long[] roleIds)
           
 void checkSystemRoles()
           
 void checkSystemRoles(long companyId)
           
 Role createRole(long roleId)
          Creates a new role with the primary key.
 void deleteRole(long roleId)
          Deletes the role with the primary key from the database.
 void deleteRole(Role role)
          Deletes the role from the database.
 List dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
 List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
 List dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
 long dynamicQueryCount(DynamicQuery dynamicQuery)
          Returns the number of rows that match the dynamic query.
 String getBeanIdentifier()
          Returns the Spring bean ID for this bean.
 Role getDefaultGroupRole(long groupId)
           
 List<Role> getGroupRoles(long groupId)
           
 PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
 Map<String,List<String>> getResourceRoles(long companyId, String name, int scope, String primKey)
           
 List<Role> getResourceRoles(long companyId, String name, int scope, String primKey, String actionId)
           
 Role getRole(long roleId)
          Returns the role with the primary key.
 Role getRole(long companyId, String name)
           
 List<Role> getRoles(int start, int end)
          Returns a range of all the roles.
 List<Role> getRoles(int type, String subtype)
           
 List<Role> getRoles(long companyId)
           
 List<Role> getRoles(long[] roleIds)
           
 int getRolesCount()
          Returns the number of roles.
 List<Role> getSubtypeRoles(String subtype)
           
 int getSubtypeRolesCount(String subtype)
           
 Role getTeamRole(long companyId, long teamId)
           
 List<Role> getUserGroupGroupRoles(long userId, long groupId)
           
 List<Role> getUserGroupRoles(long userId, long groupId)
           
 List<Role> getUserRelatedRoles(long userId, List<Group> groups)
           
 List<Role> getUserRelatedRoles(long userId, long groupId)
           
 List<Role> getUserRelatedRoles(long userId, long[] groupIds)
           
 List<Role> getUserRoles(long userId)
           
 boolean hasUserRole(long userId, long roleId)
           
 boolean hasUserRole(long userId, long companyId, String name, boolean inherited)
          Returns true if the user has the regular role.
 boolean hasUserRoles(long userId, long companyId, String[] names, boolean inherited)
          Returns true if the user has any one of the specified regular roles.
 List<Role> search(long companyId, String keywords, Integer[] types, int start, int end, OrderByComparator obc)
           
 List<Role> search(long companyId, String keywords, Integer[] types, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator obc)
           
 List<Role> search(long companyId, String name, String description, Integer[] types, int start, int end, OrderByComparator obc)
           
 List<Role> search(long companyId, String name, String description, Integer[] types, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator obc)
           
 int searchCount(long companyId, String keywords, Integer[] types)
           
 int searchCount(long companyId, String keywords, Integer[] types, LinkedHashMap<String,Object> params)
           
 int searchCount(long companyId, String name, String description, Integer[] types)
           
 int searchCount(long companyId, String name, String description, Integer[] types, LinkedHashMap<String,Object> params)
           
 void setBeanIdentifier(String beanIdentifier)
          Sets the Spring bean ID for this bean.
 void setUserRoles(long userId, long[] roleIds)
           
 void unsetUserRoles(long userId, long[] roleIds)
           
 Role updateRole(long roleId, String name, Map<Locale,String> titleMap, String description, String subtype)
           
 Role updateRole(Role role)
          Updates the role in the database or adds it if it does not yet exist.
 Role updateRole(Role role, boolean merge)
          Updates the role in the database or adds it if it does not yet exist.
 

Method Detail

addRole

Role addRole(Role role)
             throws SystemException
Adds the role to the database. Also notifies the appropriate model listeners.

Parameters:
role - the role
Returns:
the role that was added
Throws:
SystemException - if a system exception occurred

createRole

Role createRole(long roleId)
Creates a new role with the primary key. Does not add the role to the database.

Parameters:
roleId - the primary key for the new role
Returns:
the new role

deleteRole

void deleteRole(long roleId)
                throws PortalException,
                       SystemException
Deletes the role with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
roleId - the primary key of the role
Throws:
PortalException - if a role with the primary key could not be found
SystemException - if a system exception occurred

deleteRole

void deleteRole(Role role)
                throws PortalException,
                       SystemException
Deletes the role from the database. Also notifies the appropriate model listeners.

Parameters:
role - the role
Throws:
PortalException
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery)
                  throws SystemException
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query
Returns:
the matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery,
                  int start,
                  int end)
                  throws SystemException
Performs a dynamic query on the database and returns a range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
Returns:
the range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

List dynamicQuery(DynamicQuery dynamicQuery,
                  int start,
                  int end,
                  OrderByComparator orderByComparator)
                  throws SystemException
Performs a dynamic query on the database and returns an ordered range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

long dynamicQueryCount(DynamicQuery dynamicQuery)
                       throws SystemException
Returns the number of rows that match the dynamic query.

Parameters:
dynamicQuery - the dynamic query
Returns:
the number of rows that match the dynamic query
Throws:
SystemException - if a system exception occurred

getRole

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Role getRole(long roleId)
             throws PortalException,
                    SystemException
Returns the role with the primary key.

Parameters:
roleId - the primary key of the role
Returns:
the role
Throws:
PortalException - if a role with the primary key could not be found
SystemException - if a system exception occurred

getPersistedModel

@Transactional(propagation=SUPPORTS,
               readOnly=true)
PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                 throws PortalException,
                                        SystemException
Specified by:
getPersistedModel in interface PersistedModelLocalService
Throws:
PortalException
SystemException

getRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getRoles(int start,
                                                             int end)
                    throws SystemException
Returns a range of all the roles.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of roles
end - the upper bound of the range of roles (not inclusive)
Returns:
the range of roles
Throws:
SystemException - if a system exception occurred

getRolesCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getRolesCount()
                  throws SystemException
Returns the number of roles.

Returns:
the number of roles
Throws:
SystemException - if a system exception occurred

updateRole

Role updateRole(Role role)
                throws SystemException
Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
role - the role
Returns:
the role that was updated
Throws:
SystemException - if a system exception occurred

updateRole

Role updateRole(Role role,
                boolean merge)
                throws SystemException
Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
role - the role
merge - whether to merge the role with the current session. See BatchSession.update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean) for an explanation.
Returns:
the role that was updated
Throws:
SystemException - if a system exception occurred

getBeanIdentifier

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

Returns:
the Spring bean ID for this bean

setBeanIdentifier

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

Parameters:
beanIdentifier - the Spring bean ID for this bean

addRole

Role addRole(long userId,
             long companyId,
             String name,
             Map<Locale,String> titleMap,
             String description,
             int type)
             throws PortalException,
                    SystemException
Throws:
PortalException
SystemException

addRole

Role addRole(long userId,
             long companyId,
             String name,
             Map<Locale,String> titleMap,
             String description,
             int type,
             String className,
             long classPK)
             throws PortalException,
                    SystemException
Throws:
PortalException
SystemException

addUserRoles

void addUserRoles(long userId,
                  long[] roleIds)
                  throws PortalException,
                         SystemException
Throws:
PortalException
SystemException

checkSystemRoles

void checkSystemRoles()
                      throws PortalException,
                             SystemException
Throws:
PortalException
SystemException

checkSystemRoles

void checkSystemRoles(long companyId)
                      throws PortalException,
                             SystemException
Throws:
PortalException
SystemException

getDefaultGroupRole

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Role getDefaultGroupRole(long groupId)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

getGroupRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getGroupRoles(long groupId)
                         throws SystemException
Throws:
SystemException

getResourceRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Map<String,List<String>> getResourceRoles(long companyId,
                                                                                   String name,
                                                                                   int scope,
                                                                                   String primKey)
                                          throws SystemException
Throws:
SystemException

getResourceRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getResourceRoles(long companyId,
                                                                     String name,
                                                                     int scope,
                                                                     String primKey,
                                                                     String actionId)
                            throws SystemException
Throws:
SystemException

getRole

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Role getRole(long companyId,
                                                      String name)
             throws PortalException,
                    SystemException
Throws:
PortalException
SystemException

getRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getRoles(int type,
                                                             String subtype)
                    throws SystemException
Throws:
SystemException

getRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getRoles(long companyId)
                    throws SystemException
Throws:
SystemException

getRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getRoles(long[] roleIds)
                    throws PortalException,
                           SystemException
Throws:
PortalException
SystemException

getSubtypeRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getSubtypeRoles(String subtype)
                           throws SystemException
Throws:
SystemException

getSubtypeRolesCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int getSubtypeRolesCount(String subtype)
                         throws SystemException
Throws:
SystemException

getTeamRole

@Transactional(propagation=SUPPORTS,
               readOnly=true)
Role getTeamRole(long companyId,
                                                          long teamId)
                 throws PortalException,
                        SystemException
Throws:
PortalException
SystemException

getUserGroupGroupRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getUserGroupGroupRoles(long userId,
                                                                           long groupId)
                                  throws SystemException
Throws:
SystemException

getUserGroupRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getUserGroupRoles(long userId,
                                                                      long groupId)
                             throws SystemException
Throws:
SystemException

getUserRelatedRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getUserRelatedRoles(long userId,
                                                                        List<Group> groups)
                               throws SystemException
Throws:
SystemException

getUserRelatedRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getUserRelatedRoles(long userId,
                                                                        long groupId)
                               throws SystemException
Throws:
SystemException

getUserRelatedRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getUserRelatedRoles(long userId,
                                                                        long[] groupIds)
                               throws SystemException
Throws:
SystemException

getUserRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> getUserRoles(long userId)
                        throws SystemException
Throws:
SystemException

hasUserRole

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasUserRole(long userId,
                                                             long roleId)
                    throws SystemException
Throws:
SystemException

hasUserRole

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasUserRole(long userId,
                                                             long companyId,
                                                             String name,
                                                             boolean inherited)
                    throws PortalException,
                           SystemException
Returns true if the user has the regular role.

Returns:
true if the user has the regular role
Throws:
PortalException
SystemException

hasUserRoles

@Transactional(propagation=SUPPORTS,
               readOnly=true)
boolean hasUserRoles(long userId,
                                                              long companyId,
                                                              String[] names,
                                                              boolean inherited)
                     throws PortalException,
                            SystemException
Returns true if the user has any one of the specified regular roles.

Returns:
true if the user has the regular role
Throws:
PortalException
SystemException

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> search(long companyId,
                                                           String keywords,
                                                           Integer[] types,
                                                           int start,
                                                           int end,
                                                           OrderByComparator obc)
                  throws SystemException
Throws:
SystemException

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> search(long companyId,
                                                           String keywords,
                                                           Integer[] types,
                                                           LinkedHashMap<String,Object> params,
                                                           int start,
                                                           int end,
                                                           OrderByComparator obc)
                  throws SystemException
Throws:
SystemException

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> search(long companyId,
                                                           String name,
                                                           String description,
                                                           Integer[] types,
                                                           int start,
                                                           int end,
                                                           OrderByComparator obc)
                  throws SystemException
Throws:
SystemException

search

@Transactional(propagation=SUPPORTS,
               readOnly=true)
List<Role> search(long companyId,
                                                           String name,
                                                           String description,
                                                           Integer[] types,
                                                           LinkedHashMap<String,Object> params,
                                                           int start,
                                                           int end,
                                                           OrderByComparator obc)
                  throws SystemException
Throws:
SystemException

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         String keywords,
                                                         Integer[] types)
                throws SystemException
Throws:
SystemException

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         String keywords,
                                                         Integer[] types,
                                                         LinkedHashMap<String,Object> params)
                throws SystemException
Throws:
SystemException

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         String name,
                                                         String description,
                                                         Integer[] types)
                throws SystemException
Throws:
SystemException

searchCount

@Transactional(propagation=SUPPORTS,
               readOnly=true)
int searchCount(long companyId,
                                                         String name,
                                                         String description,
                                                         Integer[] types,
                                                         LinkedHashMap<String,Object> params)
                throws SystemException
Throws:
SystemException

setUserRoles

void setUserRoles(long userId,
                  long[] roleIds)
                  throws PortalException,
                         SystemException
Throws:
PortalException
SystemException

unsetUserRoles

void unsetUserRoles(long userId,
                    long[] roleIds)
                    throws PortalException,
                           SystemException
Throws:
PortalException
SystemException

updateRole

Role updateRole(long roleId,
                String name,
                Map<Locale,String> titleMap,
                String description,
                String subtype)
                throws PortalException,
                       SystemException
Throws:
PortalException
SystemException

Liferay 6.0-ee-sp2