001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.exception.PortalException;
018    import com.liferay.portal.kernel.exception.SystemException;
019    import com.liferay.portal.kernel.transaction.Isolation;
020    import com.liferay.portal.kernel.transaction.Propagation;
021    import com.liferay.portal.kernel.transaction.Transactional;
022    
023    /**
024     * Provides the local service interface for Role. Methods of this
025     * service will not have security checks based on the propagated JAAS
026     * credentials because this service can only be accessed from within the same
027     * VM.
028     *
029     * @author Brian Wing Shun Chan
030     * @see RoleLocalServiceUtil
031     * @see com.liferay.portal.service.base.RoleLocalServiceBaseImpl
032     * @see com.liferay.portal.service.impl.RoleLocalServiceImpl
033     * @generated
034     */
035    @Transactional(isolation = Isolation.PORTAL, rollbackFor =  {
036            PortalException.class, SystemException.class})
037    public interface RoleLocalService extends BaseLocalService,
038            PersistedModelLocalService {
039            /*
040             * NOTE FOR DEVELOPERS:
041             *
042             * Never modify or reference this interface directly. Always use {@link RoleLocalServiceUtil} to access the role local service. Add custom service methods to {@link com.liferay.portal.service.impl.RoleLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.
043             */
044    
045            /**
046            * Adds the role to the database. Also notifies the appropriate model listeners.
047            *
048            * @param role the role
049            * @return the role that was added
050            * @throws SystemException if a system exception occurred
051            */
052            public com.liferay.portal.model.Role addRole(
053                    com.liferay.portal.model.Role role)
054                    throws com.liferay.portal.kernel.exception.SystemException;
055    
056            /**
057            * Creates a new role with the primary key. Does not add the role to the database.
058            *
059            * @param roleId the primary key for the new role
060            * @return the new role
061            */
062            public com.liferay.portal.model.Role createRole(long roleId);
063    
064            /**
065            * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param roleId the primary key of the role
068            * @return the role that was removed
069            * @throws PortalException if a role with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public com.liferay.portal.model.Role deleteRole(long roleId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException;
075    
076            /**
077            * Deletes the role from the database. Also notifies the appropriate model listeners.
078            *
079            * @param role the role
080            * @return the role that was removed
081            * @throws PortalException
082            * @throws SystemException if a system exception occurred
083            */
084            public com.liferay.portal.model.Role deleteRole(
085                    com.liferay.portal.model.Role role)
086                    throws com.liferay.portal.kernel.exception.PortalException,
087                            com.liferay.portal.kernel.exception.SystemException;
088    
089            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
090    
091            /**
092            * Performs a dynamic query on the database and returns the matching rows.
093            *
094            * @param dynamicQuery the dynamic query
095            * @return the matching rows
096            * @throws SystemException if a system exception occurred
097            */
098            @SuppressWarnings("rawtypes")
099            public java.util.List dynamicQuery(
100                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
101                    throws com.liferay.portal.kernel.exception.SystemException;
102    
103            /**
104            * Performs a dynamic query on the database and returns a range of the matching rows.
105            *
106            * <p>
107            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
108            * </p>
109            *
110            * @param dynamicQuery the dynamic query
111            * @param start the lower bound of the range of model instances
112            * @param end the upper bound of the range of model instances (not inclusive)
113            * @return the range of matching rows
114            * @throws SystemException if a system exception occurred
115            */
116            @SuppressWarnings("rawtypes")
117            public java.util.List dynamicQuery(
118                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
119                    int end) throws com.liferay.portal.kernel.exception.SystemException;
120    
121            /**
122            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
123            *
124            * <p>
125            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
126            * </p>
127            *
128            * @param dynamicQuery the dynamic query
129            * @param start the lower bound of the range of model instances
130            * @param end the upper bound of the range of model instances (not inclusive)
131            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
132            * @return the ordered range of matching rows
133            * @throws SystemException if a system exception occurred
134            */
135            @SuppressWarnings("rawtypes")
136            public java.util.List dynamicQuery(
137                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
138                    int end,
139                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
140                    throws com.liferay.portal.kernel.exception.SystemException;
141    
142            /**
143            * Returns the number of rows that match the dynamic query.
144            *
145            * @param dynamicQuery the dynamic query
146            * @return the number of rows that match the dynamic query
147            * @throws SystemException if a system exception occurred
148            */
149            public long dynamicQueryCount(
150                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
151                    throws com.liferay.portal.kernel.exception.SystemException;
152    
153            /**
154            * Returns the number of rows that match the dynamic query.
155            *
156            * @param dynamicQuery the dynamic query
157            * @param projection the projection to apply to the query
158            * @return the number of rows that match the dynamic query
159            * @throws SystemException if a system exception occurred
160            */
161            public long dynamicQueryCount(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
163                    com.liferay.portal.kernel.dao.orm.Projection projection)
164                    throws com.liferay.portal.kernel.exception.SystemException;
165    
166            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
167            public com.liferay.portal.model.Role fetchRole(long roleId)
168                    throws com.liferay.portal.kernel.exception.SystemException;
169    
170            /**
171            * Returns the role with the matching UUID and company.
172            *
173            * @param uuid the role's UUID
174            * @param companyId the primary key of the company
175            * @return the matching role, or <code>null</code> if a matching role could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179            public com.liferay.portal.model.Role fetchRoleByUuidAndCompanyId(
180                    java.lang.String uuid, long companyId)
181                    throws com.liferay.portal.kernel.exception.SystemException;
182    
183            /**
184            * Returns the role with the primary key.
185            *
186            * @param roleId the primary key of the role
187            * @return the role
188            * @throws PortalException if a role with the primary key could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
192            public com.liferay.portal.model.Role getRole(long roleId)
193                    throws com.liferay.portal.kernel.exception.PortalException,
194                            com.liferay.portal.kernel.exception.SystemException;
195    
196            @Override
197            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
198            public com.liferay.portal.model.PersistedModel getPersistedModel(
199                    java.io.Serializable primaryKeyObj)
200                    throws com.liferay.portal.kernel.exception.PortalException,
201                            com.liferay.portal.kernel.exception.SystemException;
202    
203            /**
204            * Returns the role with the matching UUID and company.
205            *
206            * @param uuid the role's UUID
207            * @param companyId the primary key of the company
208            * @return the matching role
209            * @throws PortalException if a matching role could not be found
210            * @throws SystemException if a system exception occurred
211            */
212            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213            public com.liferay.portal.model.Role getRoleByUuidAndCompanyId(
214                    java.lang.String uuid, long companyId)
215                    throws com.liferay.portal.kernel.exception.PortalException,
216                            com.liferay.portal.kernel.exception.SystemException;
217    
218            /**
219            * Returns a range of all the roles.
220            *
221            * <p>
222            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RoleModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
223            * </p>
224            *
225            * @param start the lower bound of the range of roles
226            * @param end the upper bound of the range of roles (not inclusive)
227            * @return the range of roles
228            * @throws SystemException if a system exception occurred
229            */
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public java.util.List<com.liferay.portal.model.Role> getRoles(int start,
232                    int end) throws com.liferay.portal.kernel.exception.SystemException;
233    
234            /**
235            * Returns the number of roles.
236            *
237            * @return the number of roles
238            * @throws SystemException if a system exception occurred
239            */
240            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241            public int getRolesCount()
242                    throws com.liferay.portal.kernel.exception.SystemException;
243    
244            /**
245            * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
246            *
247            * @param role the role
248            * @return the role that was updated
249            * @throws SystemException if a system exception occurred
250            */
251            public com.liferay.portal.model.Role updateRole(
252                    com.liferay.portal.model.Role role)
253                    throws com.liferay.portal.kernel.exception.SystemException;
254    
255            /**
256            * @throws SystemException if a system exception occurred
257            */
258            public void addGroupRole(long groupId, long roleId)
259                    throws com.liferay.portal.kernel.exception.SystemException;
260    
261            /**
262            * @throws SystemException if a system exception occurred
263            */
264            public void addGroupRole(long groupId, com.liferay.portal.model.Role role)
265                    throws com.liferay.portal.kernel.exception.SystemException;
266    
267            /**
268            * @throws SystemException if a system exception occurred
269            */
270            public void addGroupRoles(long groupId, long[] roleIds)
271                    throws com.liferay.portal.kernel.exception.SystemException;
272    
273            /**
274            * @throws SystemException if a system exception occurred
275            */
276            public void addGroupRoles(long groupId,
277                    java.util.List<com.liferay.portal.model.Role> Roles)
278                    throws com.liferay.portal.kernel.exception.SystemException;
279    
280            /**
281            * @throws SystemException if a system exception occurred
282            */
283            public void clearGroupRoles(long groupId)
284                    throws com.liferay.portal.kernel.exception.SystemException;
285    
286            /**
287            * @throws SystemException if a system exception occurred
288            */
289            public void deleteGroupRole(long groupId, long roleId)
290                    throws com.liferay.portal.kernel.exception.SystemException;
291    
292            /**
293            * @throws SystemException if a system exception occurred
294            */
295            public void deleteGroupRole(long groupId, com.liferay.portal.model.Role role)
296                    throws com.liferay.portal.kernel.exception.SystemException;
297    
298            /**
299            * @throws SystemException if a system exception occurred
300            */
301            public void deleteGroupRoles(long groupId, long[] roleIds)
302                    throws com.liferay.portal.kernel.exception.SystemException;
303    
304            /**
305            * @throws SystemException if a system exception occurred
306            */
307            public void deleteGroupRoles(long groupId,
308                    java.util.List<com.liferay.portal.model.Role> Roles)
309                    throws com.liferay.portal.kernel.exception.SystemException;
310    
311            /**
312            * @throws SystemException if a system exception occurred
313            */
314            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
315            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
316                    long groupId)
317                    throws com.liferay.portal.kernel.exception.SystemException;
318    
319            /**
320            * @throws SystemException if a system exception occurred
321            */
322            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
324                    long groupId, int start, int end)
325                    throws com.liferay.portal.kernel.exception.SystemException;
326    
327            /**
328            * @throws SystemException if a system exception occurred
329            */
330            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
331            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
332                    long groupId, int start, int end,
333                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
334                    throws com.liferay.portal.kernel.exception.SystemException;
335    
336            /**
337            * @throws SystemException if a system exception occurred
338            */
339            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
340            public int getGroupRolesCount(long groupId)
341                    throws com.liferay.portal.kernel.exception.SystemException;
342    
343            /**
344            * @throws SystemException if a system exception occurred
345            */
346            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
347            public boolean hasGroupRole(long groupId, long roleId)
348                    throws com.liferay.portal.kernel.exception.SystemException;
349    
350            /**
351            * @throws SystemException if a system exception occurred
352            */
353            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
354            public boolean hasGroupRoles(long groupId)
355                    throws com.liferay.portal.kernel.exception.SystemException;
356    
357            /**
358            * @throws SystemException if a system exception occurred
359            */
360            public void setGroupRoles(long groupId, long[] roleIds)
361                    throws com.liferay.portal.kernel.exception.SystemException;
362    
363            /**
364            * @throws SystemException if a system exception occurred
365            */
366            public void addUserRole(long userId, long roleId)
367                    throws com.liferay.portal.kernel.exception.SystemException;
368    
369            /**
370            * @throws SystemException if a system exception occurred
371            */
372            public void addUserRole(long userId, com.liferay.portal.model.Role role)
373                    throws com.liferay.portal.kernel.exception.SystemException;
374    
375            /**
376            * @throws PortalException
377            * @throws SystemException if a system exception occurred
378            */
379            public void addUserRoles(long userId, long[] roleIds)
380                    throws com.liferay.portal.kernel.exception.PortalException,
381                            com.liferay.portal.kernel.exception.SystemException;
382    
383            /**
384            * @throws PortalException
385            * @throws SystemException if a system exception occurred
386            */
387            public void addUserRoles(long userId,
388                    java.util.List<com.liferay.portal.model.Role> Roles)
389                    throws com.liferay.portal.kernel.exception.PortalException,
390                            com.liferay.portal.kernel.exception.SystemException;
391    
392            /**
393            * @throws SystemException if a system exception occurred
394            */
395            public void clearUserRoles(long userId)
396                    throws com.liferay.portal.kernel.exception.SystemException;
397    
398            /**
399            * @throws SystemException if a system exception occurred
400            */
401            public void deleteUserRole(long userId, long roleId)
402                    throws com.liferay.portal.kernel.exception.SystemException;
403    
404            /**
405            * @throws SystemException if a system exception occurred
406            */
407            public void deleteUserRole(long userId, com.liferay.portal.model.Role role)
408                    throws com.liferay.portal.kernel.exception.SystemException;
409    
410            /**
411            * @throws SystemException if a system exception occurred
412            */
413            public void deleteUserRoles(long userId, long[] roleIds)
414                    throws com.liferay.portal.kernel.exception.SystemException;
415    
416            /**
417            * @throws SystemException if a system exception occurred
418            */
419            public void deleteUserRoles(long userId,
420                    java.util.List<com.liferay.portal.model.Role> Roles)
421                    throws com.liferay.portal.kernel.exception.SystemException;
422    
423            /**
424            * @throws SystemException if a system exception occurred
425            */
426            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
427            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
428                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
429    
430            /**
431            * @throws SystemException if a system exception occurred
432            */
433            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
434            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
435                    long userId, int start, int end)
436                    throws com.liferay.portal.kernel.exception.SystemException;
437    
438            /**
439            * @throws SystemException if a system exception occurred
440            */
441            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
442            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
443                    long userId, int start, int end,
444                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
445                    throws com.liferay.portal.kernel.exception.SystemException;
446    
447            /**
448            * @throws SystemException if a system exception occurred
449            */
450            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
451            public int getUserRolesCount(long userId)
452                    throws com.liferay.portal.kernel.exception.SystemException;
453    
454            /**
455            * @throws SystemException if a system exception occurred
456            */
457            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
458            public boolean hasUserRole(long userId, long roleId)
459                    throws com.liferay.portal.kernel.exception.SystemException;
460    
461            /**
462            * @throws SystemException if a system exception occurred
463            */
464            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
465            public boolean hasUserRoles(long userId)
466                    throws com.liferay.portal.kernel.exception.SystemException;
467    
468            /**
469            * @throws PortalException
470            * @throws SystemException if a system exception occurred
471            */
472            public void setUserRoles(long userId, long[] roleIds)
473                    throws com.liferay.portal.kernel.exception.PortalException,
474                            com.liferay.portal.kernel.exception.SystemException;
475    
476            /**
477            * Returns the Spring bean ID for this bean.
478            *
479            * @return the Spring bean ID for this bean
480            */
481            public java.lang.String getBeanIdentifier();
482    
483            /**
484            * Sets the Spring bean ID for this bean.
485            *
486            * @param beanIdentifier the Spring bean ID for this bean
487            */
488            public void setBeanIdentifier(java.lang.String beanIdentifier);
489    
490            /**
491            * Adds a role. The user is reindexed after role is added.
492            *
493            * @param userId the primary key of the user
494            * @param companyId the primary key of the company
495            * @param name the role's name
496            * @param titleMap the role's localized titles (optionally
497            <code>null</code>)
498            * @param descriptionMap the role's localized descriptions (optionally
499            <code>null</code>)
500            * @param type the role's type (optionally <code>0</code>)
501            * @return the role
502            * @throws PortalException if the class name or the role name were
503            invalid, if the role is a duplicate, or if a user with the
504            primary key could not be found
505            * @throws SystemException if a system exception occurred
506            * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long,
507            String, Map, Map, int, String, ServiceContext)}
508            */
509            public com.liferay.portal.model.Role addRole(long userId, long companyId,
510                    java.lang.String name,
511                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
512                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
513                    int type)
514                    throws com.liferay.portal.kernel.exception.PortalException,
515                            com.liferay.portal.kernel.exception.SystemException;
516    
517            /**
518            * Adds a role with additional parameters. The user is reindexed after role
519            * is added.
520            *
521            * @param userId the primary key of the user
522            * @param companyId the primary key of the company
523            * @param name the role's name
524            * @param titleMap the role's localized titles (optionally
525            <code>null</code>)
526            * @param descriptionMap the role's localized descriptions (optionally
527            <code>null</code>)
528            * @param type the role's type (optionally <code>0</code>)
529            * @param className the name of the class for which the role is created
530            (optionally <code>null</code>)
531            * @param classPK the primary key of the class for which the role is
532            created (optionally <code>0</code>)
533            * @return the role
534            * @throws PortalException if the class name or the role name were
535            invalid, if the role is a duplicate, or if a user with the
536            primary key could not be found
537            * @throws SystemException if a system exception occurred
538            * @deprecated As of 6.2.0, replaced by {@link #addRole(long, String, long,
539            String, Map, Map, int, String, ServiceContext)}
540            */
541            public com.liferay.portal.model.Role addRole(long userId, long companyId,
542                    java.lang.String name,
543                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
544                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
545                    int type, java.lang.String className, long classPK)
546                    throws com.liferay.portal.kernel.exception.PortalException,
547                            com.liferay.portal.kernel.exception.SystemException;
548    
549            /**
550            * Adds a role with additional parameters. The user is reindexed after role
551            * is added.
552            *
553            * @param userId the primary key of the user
554            * @param className the name of the class for which the role is created
555            (optionally <code>null</code>)
556            * @param classPK the primary key of the class for which the role is
557            created (optionally <code>0</code>)
558            * @param name the role's name
559            * @param titleMap the role's localized titles (optionally
560            <code>null</code>)
561            * @param descriptionMap the role's localized descriptions (optionally
562            <code>null</code>)
563            * @param type the role's type (optionally <code>0</code>)
564            * @param subtype the role's subtype (optionally <code>null</code>)
565            * @param serviceContext the service context to be applied (optionally
566            <code>null</code>). Can set expando bridge attributes for the
567            role.
568            * @return the role
569            * @throws PortalException if the class name or the role name were invalid,
570            if the role is a duplicate, or if a user with the primary key
571            could not be found
572            * @throws SystemException if a system exception occurred
573            */
574            public com.liferay.portal.model.Role addRole(long userId,
575                    java.lang.String className, long classPK, java.lang.String name,
576                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
577                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
578                    int type, java.lang.String subtype,
579                    com.liferay.portal.service.ServiceContext serviceContext)
580                    throws com.liferay.portal.kernel.exception.PortalException,
581                            com.liferay.portal.kernel.exception.SystemException;
582    
583            /**
584            * Checks to ensure that the system roles map has appropriate default roles
585            * in each company.
586            *
587            * @throws PortalException if the current user did not have permission to
588            set applicable permissions on a role
589            * @throws SystemException if a system exception occurred
590            */
591            public void checkSystemRoles()
592                    throws com.liferay.portal.kernel.exception.PortalException,
593                            com.liferay.portal.kernel.exception.SystemException;
594    
595            /**
596            * Checks to ensure that the system roles map has appropriate default roles
597            * in the company.
598            *
599            * @param companyId the primary key of the company
600            * @throws PortalException if the current user did not have permission to
601            set applicable permissions on a role
602            * @throws SystemException if a system exception occurred
603            */
604            public void checkSystemRoles(long companyId)
605                    throws com.liferay.portal.kernel.exception.PortalException,
606                            com.liferay.portal.kernel.exception.SystemException;
607    
608            /**
609            * Returns the role with the name in the company.
610            *
611            * <p>
612            * The method searches the system roles map first for default roles. If a
613            * role with the name is not found, then the method will query the database.
614            * </p>
615            *
616            * @param companyId the primary key of the company
617            * @param name the role's name
618            * @return Returns the role with the name or <code>null</code> if a role
619            with the name could not be found in the company
620            * @throws SystemException if a system exception occurred
621            */
622            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
623            public com.liferay.portal.model.Role fetchRole(long companyId,
624                    java.lang.String name)
625                    throws com.liferay.portal.kernel.exception.SystemException;
626    
627            /**
628            * Returns the default role for the group with the primary key.
629            *
630            * <p>
631            * If the group is a site, then the default role is {@link
632            * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an
633            * organization, then the default role is {@link
634            * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group
635            * is a user or user group, then the default role is {@link
636            * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group
637            * types, the default role is {@link
638            * com.liferay.portal.model.RoleConstants#USER}.
639            * </p>
640            *
641            * @param groupId the primary key of the group
642            * @return the default role for the group with the primary key
643            * @throws PortalException if a group with the primary key could not be
644            found, or if a default role could not be found for the group
645            * @throws SystemException if a system exception occurred
646            */
647            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
648            public com.liferay.portal.model.Role getDefaultGroupRole(long groupId)
649                    throws com.liferay.portal.kernel.exception.PortalException,
650                            com.liferay.portal.kernel.exception.SystemException;
651    
652            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
653            public java.util.List<com.liferay.portal.model.Role> getResourceBlockRoles(
654                    long resourceBlockId, java.lang.String className,
655                    java.lang.String actionId)
656                    throws com.liferay.portal.kernel.exception.SystemException;
657    
658            /**
659            * Returns a map of role names to associated action IDs for the named
660            * resource in the company within the permission scope.
661            *
662            * @param companyId the primary key of the company
663            * @param name the resource name
664            * @param scope the permission scope
665            * @param primKey the primary key of the resource's class
666            * @return the role names and action IDs
667            * @throws SystemException if a system exception occurred
668            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P(
669            long, String, int, String)
670            */
671            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
672            public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
673                    long companyId, java.lang.String name, int scope,
674                    java.lang.String primKey)
675                    throws com.liferay.portal.kernel.exception.SystemException;
676    
677            /**
678            * Returns all the roles associated with the action ID in the company within
679            * the permission scope.
680            *
681            * @param companyId the primary key of the company
682            * @param name the resource name
683            * @param scope the permission scope
684            * @param primKey the primary key of the resource's class
685            * @param actionId the name of the resource action
686            * @return the roles
687            * @throws SystemException if a system exception occurred
688            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A(
689            long, String, int, String, String)
690            */
691            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
692            public java.util.List<com.liferay.portal.model.Role> getResourceRoles(
693                    long companyId, java.lang.String name, int scope,
694                    java.lang.String primKey, java.lang.String actionId)
695                    throws com.liferay.portal.kernel.exception.SystemException;
696    
697            /**
698            * Returns the role with the name in the company.
699            *
700            * <p>
701            * The method searches the system roles map first for default roles. If a
702            * role with the name is not found, then the method will query the database.
703            * </p>
704            *
705            * @param companyId the primary key of the company
706            * @param name the role's name
707            * @return the role with the name
708            * @throws PortalException if a role with the name could not be found in the
709            company
710            * @throws SystemException if a system exception occurred
711            */
712            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
713            public com.liferay.portal.model.Role getRole(long companyId,
714                    java.lang.String name)
715                    throws com.liferay.portal.kernel.exception.PortalException,
716                            com.liferay.portal.kernel.exception.SystemException;
717    
718            /**
719            * Returns all the roles of the type and subtype.
720            *
721            * @param type the role's type (optionally <code>0</code>)
722            * @param subtype the role's subtype (optionally <code>null</code>)
723            * @return the roles of the type and subtype
724            * @throws SystemException if a system exception occurred
725            */
726            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
727            public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
728                    java.lang.String subtype)
729                    throws com.liferay.portal.kernel.exception.SystemException;
730    
731            /**
732            * Returns all the roles in the company.
733            *
734            * @param companyId the primary key of the company
735            * @return the roles in the company
736            * @throws SystemException if a system exception occurred
737            */
738            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
739            public java.util.List<com.liferay.portal.model.Role> getRoles(
740                    long companyId)
741                    throws com.liferay.portal.kernel.exception.SystemException;
742    
743            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
744            public java.util.List<com.liferay.portal.model.Role> getRoles(
745                    long companyId, int[] types)
746                    throws com.liferay.portal.kernel.exception.SystemException;
747    
748            /**
749            * Returns all the roles with the primary keys.
750            *
751            * @param roleIds the primary keys of the roles
752            * @return the roles with the primary keys
753            * @throws PortalException if any one of the roles with the primary keys
754            could not be found
755            * @throws SystemException if a system exception occurred
756            */
757            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
758            public java.util.List<com.liferay.portal.model.Role> getRoles(
759                    long[] roleIds)
760                    throws com.liferay.portal.kernel.exception.PortalException,
761                            com.liferay.portal.kernel.exception.SystemException;
762    
763            /**
764            * Returns all the roles of the subtype.
765            *
766            * @param subtype the role's subtype (optionally <code>null</code>)
767            * @return the roles of the subtype
768            * @throws SystemException if a system exception occurred
769            */
770            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
771            public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
772                    java.lang.String subtype)
773                    throws com.liferay.portal.kernel.exception.SystemException;
774    
775            /**
776            * Returns the number of roles of the subtype.
777            *
778            * @param subtype the role's subtype (optionally <code>null</code>)
779            * @return the number of roles of the subtype
780            * @throws SystemException if a system exception occurred
781            */
782            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
783            public int getSubtypeRolesCount(java.lang.String subtype)
784                    throws com.liferay.portal.kernel.exception.SystemException;
785    
786            /**
787            * Returns the team role in the company.
788            *
789            * @param companyId the primary key of the company
790            * @param teamId the primary key of the team
791            * @return the team role in the company
792            * @throws PortalException if a role could not be found in the team and
793            company
794            * @throws SystemException if a system exception occurred
795            */
796            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
797            public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId)
798                    throws com.liferay.portal.kernel.exception.PortalException,
799                            com.liferay.portal.kernel.exception.SystemException;
800    
801            /**
802            * Returns all the roles of the type.
803            *
804            * @param type the role's type (optionally <code>0</code>)
805            * @return the range of the roles of the type
806            * @throws SystemException if a system exception occurred
807            */
808            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
809            public java.util.List<com.liferay.portal.model.Role> getTypeRoles(int type)
810                    throws com.liferay.portal.kernel.exception.SystemException;
811    
812            /**
813            * Returns a range of all the roles of the type.
814            *
815            * @param type the role's type (optionally <code>0</code>)
816            * @param start the lower bound of the range of roles to return
817            * @param end the upper bound of the range of roles to return (not
818            inclusive)
819            * @return the range of the roles of the type
820            * @throws SystemException if a system exception occurred
821            */
822            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
823            public java.util.List<com.liferay.portal.model.Role> getTypeRoles(
824                    int type, int start, int end)
825                    throws com.liferay.portal.kernel.exception.SystemException;
826    
827            /**
828            * Returns the number of roles of the type.
829            *
830            * @param type the role's type (optionally <code>0</code>)
831            * @return the number of roles of the type
832            * @throws SystemException if a system exception occurred
833            */
834            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
835            public int getTypeRolesCount(int type)
836                    throws com.liferay.portal.kernel.exception.SystemException;
837    
838            /**
839            * Returns all the user's roles within the user group.
840            *
841            * @param userId the primary key of the user
842            * @param groupId the primary key of the group
843            * @return the user's roles within the user group
844            * @throws SystemException if a system exception occurred
845            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole(
846            long, long)
847            */
848            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
849            public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
850                    long userId, long groupId)
851                    throws com.liferay.portal.kernel.exception.SystemException;
852    
853            /**
854            * Returns all the user's roles within the user group.
855            *
856            * @param userId the primary key of the user
857            * @param groupId the primary key of the group
858            * @return the user's roles within the user group
859            * @throws SystemException if a system exception occurred
860            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole(
861            long, long)
862            */
863            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
864            public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
865                    long userId, long groupId)
866                    throws com.liferay.portal.kernel.exception.SystemException;
867    
868            /**
869            * Returns the union of all the user's roles within the groups.
870            *
871            * @param userId the primary key of the user
872            * @param groups the groups (optionally <code>null</code>)
873            * @return the union of all the user's roles within the groups
874            * @throws SystemException if a system exception occurred
875            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
876            long, List)
877            */
878            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
879            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
880                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
881                    throws com.liferay.portal.kernel.exception.SystemException;
882    
883            /**
884            * Returns all the user's roles within the group.
885            *
886            * @param userId the primary key of the user
887            * @param groupId the primary key of the group
888            * @return the user's roles within the group
889            * @throws SystemException if a system exception occurred
890            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
891            long, long)
892            */
893            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
894            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
895                    long userId, long groupId)
896                    throws com.liferay.portal.kernel.exception.SystemException;
897    
898            /**
899            * Returns the union of all the user's roles within the groups.
900            *
901            * @param userId the primary key of the user
902            * @param groupIds the primary keys of the groups
903            * @return the union of all the user's roles within the groups
904            * @throws SystemException if a system exception occurred
905            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
906            long, long[])
907            */
908            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
909            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
910                    long userId, long[] groupIds)
911                    throws com.liferay.portal.kernel.exception.SystemException;
912    
913            /**
914            * Returns <code>true</code> if the user is associated with the named
915            * regular role.
916            *
917            * @param userId the primary key of the user
918            * @param companyId the primary key of the company
919            * @param name the name of the role
920            * @param inherited whether to include the user's inherited roles in the
921            search
922            * @return <code>true</code> if the user is associated with the regular
923            role; <code>false</code> otherwise
924            * @throws PortalException if a default user for the company could not be
925            found
926            * @throws SystemException if a system exception occurred
927            */
928            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
929            public boolean hasUserRole(long userId, long companyId,
930                    java.lang.String name, boolean inherited)
931                    throws com.liferay.portal.kernel.exception.PortalException,
932                            com.liferay.portal.kernel.exception.SystemException;
933    
934            /**
935            * Returns <code>true</code> if the user has any one of the named regular
936            * roles.
937            *
938            * @param userId the primary key of the user
939            * @param companyId the primary key of the company
940            * @param names the names of the roles
941            * @param inherited whether to include the user's inherited roles in the
942            search
943            * @return <code>true</code> if the user has any one of the regular roles;
944            <code>false</code> otherwise
945            * @throws PortalException if any one of the roles with the names could not
946            be found in the company or if the default user for the company
947            could not be found
948            * @throws SystemException if a system exception occurred
949            */
950            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
951            public boolean hasUserRoles(long userId, long companyId,
952                    java.lang.String[] names, boolean inherited)
953                    throws com.liferay.portal.kernel.exception.PortalException,
954                            com.liferay.portal.kernel.exception.SystemException;
955    
956            /**
957            * Returns a role with the name in the company.
958            *
959            * @param companyId the primary key of the company
960            * @param name the role's name (optionally <code>null</code>)
961            * @return the role with the name, or <code>null</code> if a role with the
962            name could not be found in the company
963            * @throws SystemException if a system exception occurred
964            */
965            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
966            public com.liferay.portal.model.Role loadFetchRole(long companyId,
967                    java.lang.String name)
968                    throws com.liferay.portal.kernel.exception.SystemException;
969    
970            /**
971            * Returns a role with the name in the company.
972            *
973            * @param companyId the primary key of the company
974            * @param name the role's name
975            * @return the role with the name in the company
976            * @throws PortalException if a role with the name could not be found in the
977            company
978            * @throws SystemException if a system exception occurred
979            */
980            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
981            public com.liferay.portal.model.Role loadGetRole(long companyId,
982                    java.lang.String name)
983                    throws com.liferay.portal.kernel.exception.PortalException,
984                            com.liferay.portal.kernel.exception.SystemException;
985    
986            /**
987            * Returns an ordered range of all the roles that match the keywords and
988            * types.
989            *
990            * <p>
991            * Useful when paginating results. Returns a maximum of <code>end -
992            * start</code> instances. <code>start</code> and <code>end</code> are not
993            * primary keys, they are indexes in the result set. Thus, <code>0</code>
994            * refers to the first result in the set. Setting both <code>start</code>
995            * and <code>end</code> to {@link
996            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
997            * result set.
998            * </p>
999            *
1000            * @param companyId the primary key of the company
1001            * @param keywords the keywords (space separated), which may occur in the
1002            role's name or description (optionally <code>null</code>)
1003            * @param types the role types (optionally <code>null</code>)
1004            * @param start the lower bound of the range of roles to return
1005            * @param end the upper bound of the range of roles to return (not
1006            inclusive)
1007            * @param obc the comparator to order the roles (optionally
1008            <code>null</code>)
1009            * @return the ordered range of the matching roles, ordered by
1010            <code>obc</code>
1011            * @throws SystemException if a system exception occurred
1012            * @see com.liferay.portal.service.persistence.RoleFinder
1013            */
1014            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1015            public java.util.List<com.liferay.portal.model.Role> search(
1016                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
1017                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1018                    throws com.liferay.portal.kernel.exception.SystemException;
1019    
1020            /**
1021            * Returns an ordered range of all the roles that match the keywords, types,
1022            * and params.
1023            *
1024            * <p>
1025            * Useful when paginating results. Returns a maximum of <code>end -
1026            * start</code> instances. <code>start</code> and <code>end</code> are not
1027            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1028            * refers to the first result in the set. Setting both <code>start</code>
1029            * and <code>end</code> to {@link
1030            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1031            * result set.
1032            * </p>
1033            *
1034            * @param companyId the primary key of the company
1035            * @param keywords the keywords (space separated), which may occur in the
1036            role's name or description (optionally <code>null</code>)
1037            * @param types the role types (optionally <code>null</code>)
1038            * @param params the finder parameters. Can specify values for the
1039            "usersRoles" key. For more information, see {@link
1040            com.liferay.portal.service.persistence.RoleFinder}
1041            * @param start the lower bound of the range of roles to return
1042            * @param end the upper bound of the range of roles to return (not
1043            inclusive)
1044            * @param obc the comparator to order the roles (optionally
1045            <code>null</code>)
1046            * @return the ordered range of the matching roles, ordered by
1047            <code>obc</code>
1048            * @throws SystemException if a system exception occurred
1049            * @see com.liferay.portal.service.persistence.RoleFinder
1050            */
1051            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1052            public java.util.List<com.liferay.portal.model.Role> search(
1053                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
1054                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1055                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1056                    throws com.liferay.portal.kernel.exception.SystemException;
1057    
1058            /**
1059            * Returns an ordered range of all the roles that match the name,
1060            * description, and types.
1061            *
1062            * <p>
1063            * Useful when paginating results. Returns a maximum of <code>end -
1064            * start</code> instances. <code>start</code> and <code>end</code> are not
1065            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1066            * refers to the first result in the set. Setting both <code>start</code>
1067            * and <code>end</code> to {@link
1068            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1069            * result set.
1070            * </p>
1071            *
1072            * @param companyId the primary key of the company
1073            * @param name the role's name (optionally <code>null</code>)
1074            * @param description the role's description (optionally <code>null</code>)
1075            * @param types the role types (optionally <code>null</code>)
1076            * @param start the lower bound of the range of the roles to return
1077            * @param end the upper bound of the range of the roles to return (not
1078            inclusive)
1079            * @param obc the comparator to order the roles (optionally
1080            <code>null</code>)
1081            * @return the ordered range of the matching roles, ordered by
1082            <code>obc</code>
1083            * @throws SystemException if a system exception occurred
1084            * @see com.liferay.portal.service.persistence.RoleFinder
1085            */
1086            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1087            public java.util.List<com.liferay.portal.model.Role> search(
1088                    long companyId, java.lang.String name, java.lang.String description,
1089                    java.lang.Integer[] types, int start, int end,
1090                    com.liferay.portal.kernel.util.OrderByComparator obc)
1091                    throws com.liferay.portal.kernel.exception.SystemException;
1092    
1093            /**
1094            * Returns an ordered range of all the roles that match the name,
1095            * description, types, and params.
1096            *
1097            * <p>
1098            * Useful when paginating results. Returns a maximum of <code>end -
1099            * start</code> instances. <code>start</code> and <code>end</code> are not
1100            * primary keys, they are indexes in the result set. Thus, <code>0</code>
1101            * refers to the first result in the set. Setting both <code>start</code>
1102            * and <code>end</code> to {@link
1103            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full
1104            * result set.
1105            * </p>
1106            *
1107            * @param companyId the primary key of the company
1108            * @param name the role's name (optionally <code>null</code>)
1109            * @param description the role's description (optionally <code>null</code>)
1110            * @param types the role types (optionally <code>null</code>)
1111            * @param params the finder's parameters. Can specify values for the
1112            "usersRoles" key. For more information, see {@link
1113            com.liferay.portal.service.persistence.RoleFinder}
1114            * @param start the lower bound of the range of the roles to return
1115            * @param end the upper bound of the range of the roles to return (not
1116            inclusive)
1117            * @param obc the comparator to order the roles (optionally
1118            <code>null</code>)
1119            * @return the ordered range of the matching roles, ordered by
1120            <code>obc</code>
1121            * @throws SystemException if a system exception occurred
1122            * @see com.liferay.portal.service.persistence.RoleFinder
1123            */
1124            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1125            public java.util.List<com.liferay.portal.model.Role> search(
1126                    long companyId, java.lang.String name, java.lang.String description,
1127                    java.lang.Integer[] types,
1128                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
1129                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
1130                    throws com.liferay.portal.kernel.exception.SystemException;
1131    
1132            /**
1133            * Returns the number of roles that match the keywords and types.
1134            *
1135            * @param companyId the primary key of the company
1136            * @param keywords the keywords (space separated), which may occur in the
1137            role's name or description (optionally <code>null</code>)
1138            * @param types the role types (optionally <code>null</code>)
1139            * @return the number of matching roles
1140            * @throws SystemException if a system exception occurred
1141            */
1142            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1143            public int searchCount(long companyId, java.lang.String keywords,
1144                    java.lang.Integer[] types)
1145                    throws com.liferay.portal.kernel.exception.SystemException;
1146    
1147            /**
1148            * Returns the number of roles that match the keywords, types and params.
1149            *
1150            * @param companyId the primary key of the company
1151            * @param keywords the keywords (space separated), which may occur in the
1152            role's name or description (optionally <code>null</code>)
1153            * @param types the role types (optionally <code>null</code>)
1154            * @param params the finder parameters. For more information, see {@link
1155            com.liferay.portal.service.persistence.RoleFinder}
1156            * @return the number of matching roles
1157            * @throws SystemException if a system exception occurred
1158            */
1159            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1160            public int searchCount(long companyId, java.lang.String keywords,
1161                    java.lang.Integer[] types,
1162                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1163                    throws com.liferay.portal.kernel.exception.SystemException;
1164    
1165            /**
1166            * Returns the number of roles that match the name, description, and types.
1167            *
1168            * @param companyId the primary key of the company
1169            * @param name the role's name (optionally <code>null</code>)
1170            * @param description the role's description (optionally <code>null</code>)
1171            * @param types the role types (optionally <code>null</code>)
1172            * @return the number of matching roles
1173            * @throws SystemException if a system exception occurred
1174            */
1175            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1176            public int searchCount(long companyId, java.lang.String name,
1177                    java.lang.String description, java.lang.Integer[] types)
1178                    throws com.liferay.portal.kernel.exception.SystemException;
1179    
1180            /**
1181            * Returns the number of roles that match the name, description, types, and
1182            * params.
1183            *
1184            * @param companyId the primary key of the company
1185            * @param name the role's name (optionally <code>null</code>)
1186            * @param description the role's description (optionally <code>null</code>)
1187            * @param types the role types (optionally <code>null</code>)
1188            * @param params the finder parameters. Can specify values for the
1189            "usersRoles" key. For more information, see {@link
1190            com.liferay.portal.service.persistence.RoleFinder}
1191            * @return the number of matching roles
1192            * @throws SystemException if a system exception occurred
1193            */
1194            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
1195            public int searchCount(long companyId, java.lang.String name,
1196                    java.lang.String description, java.lang.Integer[] types,
1197                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
1198                    throws com.liferay.portal.kernel.exception.SystemException;
1199    
1200            /**
1201            * Removes the matching roles associated with the user. The user is
1202            * reindexed after the roles are removed.
1203            *
1204            * @param userId the primary key of the user
1205            * @param roleIds the primary keys of the roles
1206            * @throws PortalException if a user with the primary key could not be found
1207            or if a role with any one of the primary keys could not be found
1208            * @throws SystemException if a system exception occurred
1209            */
1210            public void unsetUserRoles(long userId, long[] roleIds)
1211                    throws com.liferay.portal.kernel.exception.PortalException,
1212                            com.liferay.portal.kernel.exception.SystemException;
1213    
1214            /**
1215            * Updates the role with the primary key.
1216            *
1217            * @param roleId the primary key of the role
1218            * @param name the role's new name
1219            * @param titleMap the new localized titles (optionally <code>null</code>)
1220            to replace those existing for the role
1221            * @param descriptionMap the new localized descriptions (optionally
1222            <code>null</code>) to replace those existing for the role
1223            * @param subtype the role's new subtype (optionally <code>null</code>)
1224            * @param serviceContext the service context to be applied (optionally
1225            <code>null</code>). Can set expando bridge attributes for the
1226            role.
1227            * @return the role with the primary key
1228            * @throws PortalException if a role with the primary could not be found or
1229            if the role's name was invalid
1230            * @throws SystemException if a system exception occurred
1231            */
1232            public com.liferay.portal.model.Role updateRole(long roleId,
1233                    java.lang.String name,
1234                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
1235                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
1236                    java.lang.String subtype,
1237                    com.liferay.portal.service.ServiceContext serviceContext)
1238                    throws com.liferay.portal.kernel.exception.PortalException,
1239                            com.liferay.portal.kernel.exception.SystemException;
1240    }