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