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