001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    /**
018     * <p>
019     * This class is a wrapper for {@link RoleLocalService}.
020     * </p>
021     *
022     * @author    Brian Wing Shun Chan
023     * @see       RoleLocalService
024     * @generated
025     */
026    public class RoleLocalServiceWrapper implements RoleLocalService,
027            ServiceWrapper<RoleLocalService> {
028            public RoleLocalServiceWrapper(RoleLocalService roleLocalService) {
029                    _roleLocalService = roleLocalService;
030            }
031    
032            /**
033            * Adds the role to the database. Also notifies the appropriate model listeners.
034            *
035            * @param role the role
036            * @return the role that was added
037            * @throws SystemException if a system exception occurred
038            */
039            public com.liferay.portal.model.Role addRole(
040                    com.liferay.portal.model.Role role)
041                    throws com.liferay.portal.kernel.exception.SystemException {
042                    return _roleLocalService.addRole(role);
043            }
044    
045            /**
046            * Creates a new role with the primary key. Does not add the role to the database.
047            *
048            * @param roleId the primary key for the new role
049            * @return the new role
050            */
051            public com.liferay.portal.model.Role createRole(long roleId) {
052                    return _roleLocalService.createRole(roleId);
053            }
054    
055            /**
056            * Deletes the role with the primary key from the database. Also notifies the appropriate model listeners.
057            *
058            * @param roleId the primary key of the role
059            * @throws PortalException if a role with the primary key could not be found
060            * @throws SystemException if a system exception occurred
061            */
062            public void deleteRole(long roleId)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    _roleLocalService.deleteRole(roleId);
066            }
067    
068            /**
069            * Deletes the role from the database. Also notifies the appropriate model listeners.
070            *
071            * @param role the role
072            * @throws PortalException
073            * @throws SystemException if a system exception occurred
074            */
075            public void deleteRole(com.liferay.portal.model.Role role)
076                    throws com.liferay.portal.kernel.exception.PortalException,
077                            com.liferay.portal.kernel.exception.SystemException {
078                    _roleLocalService.deleteRole(role);
079            }
080    
081            /**
082            * Performs a dynamic query on the database and returns the matching rows.
083            *
084            * @param dynamicQuery the dynamic query
085            * @return the matching rows
086            * @throws SystemException if a system exception occurred
087            */
088            @SuppressWarnings("rawtypes")
089            public java.util.List dynamicQuery(
090                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
091                    throws com.liferay.portal.kernel.exception.SystemException {
092                    return _roleLocalService.dynamicQuery(dynamicQuery);
093            }
094    
095            /**
096            * Performs a dynamic query on the database and returns a range of the matching rows.
097            *
098            * <p>
099            * 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.
100            * </p>
101            *
102            * @param dynamicQuery the dynamic query
103            * @param start the lower bound of the range of model instances
104            * @param end the upper bound of the range of model instances (not inclusive)
105            * @return the range of matching rows
106            * @throws SystemException if a system exception occurred
107            */
108            @SuppressWarnings("rawtypes")
109            public java.util.List dynamicQuery(
110                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
111                    int end) throws com.liferay.portal.kernel.exception.SystemException {
112                    return _roleLocalService.dynamicQuery(dynamicQuery, start, end);
113            }
114    
115            /**
116            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
117            *
118            * <p>
119            * 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.
120            * </p>
121            *
122            * @param dynamicQuery the dynamic query
123            * @param start the lower bound of the range of model instances
124            * @param end the upper bound of the range of model instances (not inclusive)
125            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
126            * @return the ordered range of matching rows
127            * @throws SystemException if a system exception occurred
128            */
129            @SuppressWarnings("rawtypes")
130            public java.util.List dynamicQuery(
131                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
132                    int end,
133                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
134                    throws com.liferay.portal.kernel.exception.SystemException {
135                    return _roleLocalService.dynamicQuery(dynamicQuery, start, end,
136                            orderByComparator);
137            }
138    
139            /**
140            * Returns the number of rows that match the dynamic query.
141            *
142            * @param dynamicQuery the dynamic query
143            * @return the number of rows that match the dynamic query
144            * @throws SystemException if a system exception occurred
145            */
146            public long dynamicQueryCount(
147                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
148                    throws com.liferay.portal.kernel.exception.SystemException {
149                    return _roleLocalService.dynamicQueryCount(dynamicQuery);
150            }
151    
152            public com.liferay.portal.model.Role fetchRole(long roleId)
153                    throws com.liferay.portal.kernel.exception.SystemException {
154                    return _roleLocalService.fetchRole(roleId);
155            }
156    
157            /**
158            * Returns the role with the primary key.
159            *
160            * @param roleId the primary key of the role
161            * @return the role
162            * @throws PortalException if a role with the primary key could not be found
163            * @throws SystemException if a system exception occurred
164            */
165            public com.liferay.portal.model.Role getRole(long roleId)
166                    throws com.liferay.portal.kernel.exception.PortalException,
167                            com.liferay.portal.kernel.exception.SystemException {
168                    return _roleLocalService.getRole(roleId);
169            }
170    
171            public com.liferay.portal.model.PersistedModel getPersistedModel(
172                    java.io.Serializable primaryKeyObj)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    return _roleLocalService.getPersistedModel(primaryKeyObj);
176            }
177    
178            /**
179            * Returns a range of all the roles.
180            *
181            * <p>
182            * 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.
183            * </p>
184            *
185            * @param start the lower bound of the range of roles
186            * @param end the upper bound of the range of roles (not inclusive)
187            * @return the range of roles
188            * @throws SystemException if a system exception occurred
189            */
190            public java.util.List<com.liferay.portal.model.Role> getRoles(int start,
191                    int end) throws com.liferay.portal.kernel.exception.SystemException {
192                    return _roleLocalService.getRoles(start, end);
193            }
194    
195            /**
196            * Returns the number of roles.
197            *
198            * @return the number of roles
199            * @throws SystemException if a system exception occurred
200            */
201            public int getRolesCount()
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return _roleLocalService.getRolesCount();
204            }
205    
206            /**
207            * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
208            *
209            * @param role the role
210            * @return the role that was updated
211            * @throws SystemException if a system exception occurred
212            */
213            public com.liferay.portal.model.Role updateRole(
214                    com.liferay.portal.model.Role role)
215                    throws com.liferay.portal.kernel.exception.SystemException {
216                    return _roleLocalService.updateRole(role);
217            }
218    
219            /**
220            * Updates the role in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
221            *
222            * @param role the role
223            * @param merge whether to merge the role with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
224            * @return the role that was updated
225            * @throws SystemException if a system exception occurred
226            */
227            public com.liferay.portal.model.Role updateRole(
228                    com.liferay.portal.model.Role role, boolean merge)
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return _roleLocalService.updateRole(role, merge);
231            }
232    
233            /**
234            * Returns the Spring bean ID for this bean.
235            *
236            * @return the Spring bean ID for this bean
237            */
238            public java.lang.String getBeanIdentifier() {
239                    return _roleLocalService.getBeanIdentifier();
240            }
241    
242            /**
243            * Sets the Spring bean ID for this bean.
244            *
245            * @param beanIdentifier the Spring bean ID for this bean
246            */
247            public void setBeanIdentifier(java.lang.String beanIdentifier) {
248                    _roleLocalService.setBeanIdentifier(beanIdentifier);
249            }
250    
251            /**
252            * Adds a role. The user is reindexed after role is added.
253            *
254            * @param userId the primary key of the user
255            * @param companyId the primary key of the company
256            * @param name the role's name
257            * @param titleMap the role's localized titles (optionally
258            <code>null</code>)
259            * @param descriptionMap the role's localized descriptions (optionally
260            <code>null</code>)
261            * @param type the role's type (optionally <code>0</code>)
262            * @return the role
263            * @throws PortalException if the class name or the role name
264            were invalid, if the role is a duplicate, or if a user with the primary key could not be
265            found
266            * @throws SystemException if a system exception occurred
267            */
268            public com.liferay.portal.model.Role addRole(long userId, long companyId,
269                    java.lang.String name,
270                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
271                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
272                    int type)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException {
275                    return _roleLocalService.addRole(userId, companyId, name, titleMap,
276                            descriptionMap, type);
277            }
278    
279            /**
280            * Adds a role with additional parameters. The user is reindexed after role
281            * is added.
282            *
283            * @param userId the primary key of the user
284            * @param companyId the primary key of the company
285            * @param name the role's name
286            * @param titleMap the role's localized titles (optionally
287            <code>null</code>)
288            * @param descriptionMap the role's localized descriptions (optionally
289            <code>null</code>)
290            * @param type the role's type (optionally <code>0</code>)
291            * @param className the name of the class for which the role is created
292            (optionally <code>null</code>)
293            * @param classPK the primary key of the class for which the role is
294            created (optionally <code>0</code>)
295            * @return the role
296            * @throws PortalException if the class name or the role name
297            were invalid, if the role is a duplicate, or if a user with the primary key could not be
298            found
299            * @throws SystemException if a system exception occurred
300            */
301            public com.liferay.portal.model.Role addRole(long userId, long companyId,
302                    java.lang.String name,
303                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
304                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
305                    int type, java.lang.String className, long classPK)
306                    throws com.liferay.portal.kernel.exception.PortalException,
307                            com.liferay.portal.kernel.exception.SystemException {
308                    return _roleLocalService.addRole(userId, companyId, name, titleMap,
309                            descriptionMap, type, className, classPK);
310            }
311    
312            /**
313            * Adds the roles to the user. The user is reindexed after the roles are
314            * added.
315            *
316            * @param userId the primary key of the user
317            * @param roleIds the primary keys of the roles
318            * @throws PortalException if a user with the primary key could not be
319            found
320            * @throws SystemException if a system exception occurred
321            * @see com.liferay.portal.service.persistence.UserPersistence#addRoles(
322            long, long[])
323            */
324            public void addUserRoles(long userId, long[] roleIds)
325                    throws com.liferay.portal.kernel.exception.PortalException,
326                            com.liferay.portal.kernel.exception.SystemException {
327                    _roleLocalService.addUserRoles(userId, roleIds);
328            }
329    
330            /**
331            * Checks to ensure that the system roles map has appropriate default roles
332            * in each company.
333            *
334            * @throws PortalException if the current user did not have permission to
335            set applicable permissions on a role
336            * @throws SystemException if a system exception occurred
337            */
338            public void checkSystemRoles()
339                    throws com.liferay.portal.kernel.exception.PortalException,
340                            com.liferay.portal.kernel.exception.SystemException {
341                    _roleLocalService.checkSystemRoles();
342            }
343    
344            /**
345            * Checks to ensure that the system roles map has appropriate default roles
346            * in the company.
347            *
348            * @param companyId the primary key of the company
349            * @throws PortalException if the current user did not have permission to
350            set applicable permissions on a role
351            * @throws SystemException if a system exception occurred
352            */
353            public void checkSystemRoles(long companyId)
354                    throws com.liferay.portal.kernel.exception.PortalException,
355                            com.liferay.portal.kernel.exception.SystemException {
356                    _roleLocalService.checkSystemRoles(companyId);
357            }
358    
359            /**
360            * Returns the role with the name in the company.
361            *
362            * <p>
363            * The method searches the system roles map first for default roles. If a
364            * role with the name is not found, then the method will query the
365            * database.
366            * </p>
367            *
368            * @param companyId the primary key of the company
369            * @param name the role's name
370            * @return Returns the role with the name or <code>null</code> if a role
371            with the name could not be found in the company
372            * @throws SystemException if a system exception occurred
373            */
374            public com.liferay.portal.model.Role fetchRole(long companyId,
375                    java.lang.String name)
376                    throws com.liferay.portal.kernel.exception.SystemException {
377                    return _roleLocalService.fetchRole(companyId, name);
378            }
379    
380            /**
381            * Returns the default role for the group with the primary key.
382            *
383            * <p>
384            * If the group is a site, then the default role is {@link
385            * com.liferay.portal.model.RoleConstants#SITE_MEMBER}. If the group is an
386            * organization, then the default role is {@link
387            * com.liferay.portal.model.RoleConstants#ORGANIZATION_USER}. If the group
388            * is a user or user group, then the default role is {@link
389            * com.liferay.portal.model.RoleConstants#POWER_USER}. For all other group
390            * types, the default role is {@link
391            * com.liferay.portal.model.RoleConstants#USER}.
392            * </p>
393            *
394            * @param groupId the primary key of the group
395            * @return the default role for the group with the primary key
396            * @throws PortalException if a group with the primary key could not be
397            found, or if a default role could not be found for the group
398            * @throws SystemException if a system exception occurred
399            */
400            public com.liferay.portal.model.Role getDefaultGroupRole(long groupId)
401                    throws com.liferay.portal.kernel.exception.PortalException,
402                            com.liferay.portal.kernel.exception.SystemException {
403                    return _roleLocalService.getDefaultGroupRole(groupId);
404            }
405    
406            /**
407            * Returns all the roles associated with the group.
408            *
409            * @param groupId the primary key of the group
410            * @return the roles associated with the group
411            * @throws SystemException if a system exception occurred
412            */
413            public java.util.List<com.liferay.portal.model.Role> getGroupRoles(
414                    long groupId)
415                    throws com.liferay.portal.kernel.exception.SystemException {
416                    return _roleLocalService.getGroupRoles(groupId);
417            }
418    
419            /**
420            * Returns a map of role names to associated action IDs for the named
421            * resource in the company within the permission scope.
422            *
423            * @param companyId the primary key of the company
424            * @param name the resource name
425            * @param scope the permission scope
426            * @param primKey the primary key of the resource's class
427            * @return the role names and action IDs
428            * @throws SystemException if a system exception occurred
429            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P(
430            long, String, int, String)
431            */
432            public java.util.Map<java.lang.String, java.util.List<java.lang.String>> getResourceRoles(
433                    long companyId, java.lang.String name, int scope,
434                    java.lang.String primKey)
435                    throws com.liferay.portal.kernel.exception.SystemException {
436                    return _roleLocalService.getResourceRoles(companyId, name, scope,
437                            primKey);
438            }
439    
440            /**
441            * Returns all the roles associated with the action ID in the company
442            * within the permission scope.
443            *
444            * @param companyId the primary key of the company
445            * @param name the resource name
446            * @param scope the permission scope
447            * @param primKey the primary key of the resource's class
448            * @param actionId the name of the resource action
449            * @return the roles
450            * @throws SystemException if a system exception occurred
451            * @see com.liferay.portal.service.persistence.RoleFinder#findByC_N_S_P_A(
452            long, String, int, String, String)
453            */
454            public java.util.List<com.liferay.portal.model.Role> getResourceRoles(
455                    long companyId, java.lang.String name, int scope,
456                    java.lang.String primKey, java.lang.String actionId)
457                    throws com.liferay.portal.kernel.exception.SystemException {
458                    return _roleLocalService.getResourceRoles(companyId, name, scope,
459                            primKey, actionId);
460            }
461    
462            /**
463            * Returns the role with the name in the company.
464            *
465            * <p>
466            * The method searches the system roles map first for default roles. If a
467            * role with the name is not found, then the method will query the
468            * database.
469            * </p>
470            *
471            * @param companyId the primary key of the company
472            * @param name the role's name
473            * @return the role with the name
474            * @throws PortalException if a role with the name could not be found in
475            the company
476            * @throws SystemException if a system exception occurred
477            */
478            public com.liferay.portal.model.Role getRole(long companyId,
479                    java.lang.String name)
480                    throws com.liferay.portal.kernel.exception.PortalException,
481                            com.liferay.portal.kernel.exception.SystemException {
482                    return _roleLocalService.getRole(companyId, name);
483            }
484    
485            /**
486            * Returns all the roles of the type and subtype.
487            *
488            * @param type the role's type (optionally <code>0</code>)
489            * @param subtype the role's subtype (optionally <code>null</code>)
490            * @return the roles of the type and subtype
491            * @throws SystemException if a system exception occurred
492            */
493            public java.util.List<com.liferay.portal.model.Role> getRoles(int type,
494                    java.lang.String subtype)
495                    throws com.liferay.portal.kernel.exception.SystemException {
496                    return _roleLocalService.getRoles(type, subtype);
497            }
498    
499            /**
500            * Returns all the roles in the company.
501            *
502            * @param companyId the primary key of the company
503            * @return the roles in the company
504            * @throws SystemException if a system exception occurred
505            */
506            public java.util.List<com.liferay.portal.model.Role> getRoles(
507                    long companyId)
508                    throws com.liferay.portal.kernel.exception.SystemException {
509                    return _roleLocalService.getRoles(companyId);
510            }
511    
512            /**
513            * Returns all the roles with the primary keys.
514            *
515            * @param roleIds the primary keys of the roles
516            * @return the roles with the primary keys
517            * @throws PortalException if any one of the roles with the primary keys
518            could not be found
519            * @throws SystemException if a system exception occurred
520            */
521            public java.util.List<com.liferay.portal.model.Role> getRoles(
522                    long[] roleIds)
523                    throws com.liferay.portal.kernel.exception.PortalException,
524                            com.liferay.portal.kernel.exception.SystemException {
525                    return _roleLocalService.getRoles(roleIds);
526            }
527    
528            /**
529            * Returns all the roles of the subtype.
530            *
531            * @param subtype the role's subtype (optionally <code>null</code>)
532            * @return the roles of the subtype
533            * @throws SystemException if a system exception occurred
534            */
535            public java.util.List<com.liferay.portal.model.Role> getSubtypeRoles(
536                    java.lang.String subtype)
537                    throws com.liferay.portal.kernel.exception.SystemException {
538                    return _roleLocalService.getSubtypeRoles(subtype);
539            }
540    
541            /**
542            * Returns the number of roles of the subtype.
543            *
544            * @param subtype the role's subtype (optionally <code>null</code>)
545            * @return the number of roles of the subtype
546            * @throws SystemException if a system exception occurred
547            */
548            public int getSubtypeRolesCount(java.lang.String subtype)
549                    throws com.liferay.portal.kernel.exception.SystemException {
550                    return _roleLocalService.getSubtypeRolesCount(subtype);
551            }
552    
553            /**
554            * Returns the team role in the company.
555            *
556            * @param companyId the primary key of the company
557            * @param teamId the primary key of the team
558            * @return the team role in the company
559            * @throws PortalException if a role could not be found in the team and
560            company
561            * @throws SystemException if a system exception occurred
562            */
563            public com.liferay.portal.model.Role getTeamRole(long companyId, long teamId)
564                    throws com.liferay.portal.kernel.exception.PortalException,
565                            com.liferay.portal.kernel.exception.SystemException {
566                    return _roleLocalService.getTeamRole(companyId, teamId);
567            }
568    
569            /**
570            * Returns all the user's roles within the user group.
571            *
572            * @param userId the primary key of the user
573            * @param groupId the primary key of the group
574            * @return the user's roles within the user group
575            * @throws SystemException if a system exception occurred
576            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupGroupRole(
577            long, long)
578            */
579            public java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
580                    long userId, long groupId)
581                    throws com.liferay.portal.kernel.exception.SystemException {
582                    return _roleLocalService.getUserGroupGroupRoles(userId, groupId);
583            }
584    
585            /**
586            * Returns all the user's roles within the user group.
587            *
588            * @param userId the primary key of the user
589            * @param groupId the primary key of the group
590            * @return the user's roles within the user group
591            * @throws SystemException if a system exception occurred
592            * @see com.liferay.portal.service.persistence.RoleFinder#findByUserGroupRole(
593            long, long)
594            */
595            public java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
596                    long userId, long groupId)
597                    throws com.liferay.portal.kernel.exception.SystemException {
598                    return _roleLocalService.getUserGroupRoles(userId, groupId);
599            }
600    
601            /**
602            * Returns the union of all the user's roles within the groups.
603            *
604            * @param userId the primary key of the user
605            * @param groups the groups (optionally <code>null</code>)
606            * @return the union of all the user's roles within the groups
607            * @throws SystemException if a system exception occurred
608            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
609            long, List)
610            */
611            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
612                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
613                    throws com.liferay.portal.kernel.exception.SystemException {
614                    return _roleLocalService.getUserRelatedRoles(userId, groups);
615            }
616    
617            /**
618            * Returns all the user's roles within the group.
619            *
620            * @param userId the primary key of the user
621            * @param groupId the primary key of the group
622            * @return the user's roles within the group
623            * @throws SystemException if a system exception occurred
624            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
625            long, long)
626            */
627            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
628                    long userId, long groupId)
629                    throws com.liferay.portal.kernel.exception.SystemException {
630                    return _roleLocalService.getUserRelatedRoles(userId, groupId);
631            }
632    
633            /**
634            * Returns the union of all the user's roles within the groups.
635            *
636            * @param userId the primary key of the user
637            * @param groupIds the primary keys of the groups
638            * @return the union of all the user's roles within the groups
639            * @throws SystemException if a system exception occurred
640            * @see com.liferay.portal.service.persistence.RoleFinder#findByU_G(
641            long, long[])
642            */
643            public java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
644                    long userId, long[] groupIds)
645                    throws com.liferay.portal.kernel.exception.SystemException {
646                    return _roleLocalService.getUserRelatedRoles(userId, groupIds);
647            }
648    
649            /**
650            * Returns all the roles associated with the user.
651            *
652            * @param userId the primary key of the user
653            * @return the roles associated with the user
654            * @throws SystemException if a system exception occurred
655            */
656            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
657                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
658                    return _roleLocalService.getUserRoles(userId);
659            }
660    
661            /**
662            * Returns <code>true</code> if the user is associated with the role.
663            *
664            * @param userId the primary key of the user
665            * @param roleId the primary key of the role
666            * @return <code>true</code> if the user is associated with the role;
667            <code>false</code> otherwise
668            * @throws SystemException if a system exception occurred
669            */
670            public boolean hasUserRole(long userId, long roleId)
671                    throws com.liferay.portal.kernel.exception.SystemException {
672                    return _roleLocalService.hasUserRole(userId, roleId);
673            }
674    
675            /**
676            * Returns <code>true</code> if the user is associated with the named
677            * regular role.
678            *
679            * @param userId the primary key of the user
680            * @param companyId the primary key of the company
681            * @param name the name of the role
682            * @param inherited whether to include the user's inherited roles in the
683            search
684            * @return <code>true</code> if the user is associated with the regular
685            role; <code>false</code> otherwise
686            * @throws PortalException if a role with the name could not be found in
687            the company or if a default user for the company could not be
688            found
689            * @throws SystemException if a system exception occurred
690            */
691            public boolean hasUserRole(long userId, long companyId,
692                    java.lang.String name, boolean inherited)
693                    throws com.liferay.portal.kernel.exception.PortalException,
694                            com.liferay.portal.kernel.exception.SystemException {
695                    return _roleLocalService.hasUserRole(userId, companyId, name, inherited);
696            }
697    
698            /**
699            * Returns <code>true</code> if the user has any one of the named regular
700            * roles.
701            *
702            * @param userId the primary key of the user
703            * @param companyId the primary key of the company
704            * @param names the names of the roles
705            * @param inherited whether to include the user's inherited roles in the
706            search
707            * @return <code>true</code> if the user has any one of the regular roles;
708            <code>false</code> otherwise
709            * @throws PortalException if any one of the roles with the names could not
710            be found in the company or if the default user for the company
711            could not be found
712            * @throws SystemException if a system exception occurred
713            */
714            public boolean hasUserRoles(long userId, long companyId,
715                    java.lang.String[] names, boolean inherited)
716                    throws com.liferay.portal.kernel.exception.PortalException,
717                            com.liferay.portal.kernel.exception.SystemException {
718                    return _roleLocalService.hasUserRoles(userId, companyId, names,
719                            inherited);
720            }
721    
722            /**
723            * Returns a role with the name in the company.
724            *
725            * @param companyId the primary key of the company
726            * @param name the role's name (optionally <code>null</code>)
727            * @return the role with the name, or <code>null</code> if a role with the
728            name could not be found in the company
729            * @throws SystemException if a system exception occurred
730            */
731            public com.liferay.portal.model.Role loadFetchRole(long companyId,
732                    java.lang.String name)
733                    throws com.liferay.portal.kernel.exception.SystemException {
734                    return _roleLocalService.loadFetchRole(companyId, name);
735            }
736    
737            /**
738            * Returns a role with the name in the company.
739            *
740            * @param companyId the primary key of the company
741            * @param name the role's name
742            * @return the role with the name in the company
743            * @throws PortalException if a role with the name could not be found in
744            the company
745            * @throws SystemException if a system exception occurred
746            */
747            public com.liferay.portal.model.Role loadGetRole(long companyId,
748                    java.lang.String name)
749                    throws com.liferay.portal.kernel.exception.PortalException,
750                            com.liferay.portal.kernel.exception.SystemException {
751                    return _roleLocalService.loadGetRole(companyId, name);
752            }
753    
754            /**
755            * Returns an ordered range of all the roles that match the keywords and
756            * types.
757            *
758            * <p>
759            * Useful when paginating results. Returns a maximum of <code>end -
760            * start</code> instances. <code>start</code> and <code>end</code> are not
761            * primary keys, they are indexes in the result set. Thus, <code>0</code>
762            * refers to the first result in the set. Setting both <code>start</code>
763            * and <code>end</code> to {@link
764            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
765            * full result set.
766            * </p>
767            *
768            * @param companyId the primary key of the company
769            * @param keywords the keywords (space separated), which may occur in the
770            role's name or description (optionally <code>null</code>)
771            * @param types the role types (optionally <code>null</code>)
772            * @param start the lower bound of the range of roles to return
773            * @param end the upper bound of the range of roles to return (not
774            inclusive)
775            * @param obc the comparator to order the roles (optionally
776            <code>null</code>)
777            * @return the ordered range of the matching roles, ordered by
778            <code>obc</code>
779            * @throws SystemException if a system exception occurred
780            * @see com.liferay.portal.service.persistence.RoleFinder
781            */
782            public java.util.List<com.liferay.portal.model.Role> search(
783                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
784                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
785                    throws com.liferay.portal.kernel.exception.SystemException {
786                    return _roleLocalService.search(companyId, keywords, types, start, end,
787                            obc);
788            }
789    
790            /**
791            * Returns an ordered range of all the roles that match the keywords,
792            * types, and params.
793            *
794            * <p>
795            * Useful when paginating results. Returns a maximum of <code>end -
796            * start</code> instances. <code>start</code> and <code>end</code> are not
797            * primary keys, they are indexes in the result set. Thus, <code>0</code>
798            * refers to the first result in the set. Setting both <code>start</code>
799            * and <code>end</code> to {@link
800            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
801            * full result set.
802            * </p>
803            *
804            * @param companyId the primary key of the company
805            * @param keywords the keywords (space separated), which may occur in the
806            role's name or description (optionally <code>null</code>)
807            * @param types the role types (optionally <code>null</code>)
808            * @param params the finder parameters. Can specify values for
809            "permissionsResourceId" and "usersRoles" keys. For more
810            information, see {@link
811            com.liferay.portal.service.persistence.RoleFinder}
812            * @param start the lower bound of the range of roles to return
813            * @param end the upper bound of the range of roles to return (not
814            inclusive)
815            * @param obc the comparator to order the roles (optionally
816            <code>null</code>)
817            * @return the ordered range of the matching roles, ordered by
818            <code>obc</code>
819            * @throws SystemException if a system exception occurred
820            * @see com.liferay.portal.service.persistence.RoleFinder
821            */
822            public java.util.List<com.liferay.portal.model.Role> search(
823                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
824                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
825                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
826                    throws com.liferay.portal.kernel.exception.SystemException {
827                    return _roleLocalService.search(companyId, keywords, types, params,
828                            start, end, obc);
829            }
830    
831            /**
832            * Returns an ordered range of all the roles that match the name,
833            * description, and types.
834            *
835            * <p>
836            * Useful when paginating results. Returns a maximum of <code>end -
837            * start</code> instances. <code>start</code> and <code>end</code> are not
838            * primary keys, they are indexes in the result set. Thus, <code>0</code>
839            * refers to the first result in the set. Setting both <code>start</code>
840            * and <code>end</code> to {@link
841            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
842            * full result set.
843            * </p>
844            *
845            * @param companyId the primary key of the company
846            * @param name the role's name (optionally <code>null</code>)
847            * @param description the role's description (optionally
848            <code>null</code>)
849            * @param types the role types (optionally <code>null</code>)
850            * @param start the lower bound of the range of the roles to return
851            * @param end the upper bound of the range of the roles to return (not
852            inclusive)
853            * @param obc the comparator to order the roles (optionally
854            <code>null</code>)
855            * @return the ordered range of the matching roles, ordered by
856            <code>obc</code>
857            * @throws SystemException if a system exception occurred
858            * @see com.liferay.portal.service.persistence.RoleFinder
859            */
860            public java.util.List<com.liferay.portal.model.Role> search(
861                    long companyId, java.lang.String name, java.lang.String description,
862                    java.lang.Integer[] types, int start, int end,
863                    com.liferay.portal.kernel.util.OrderByComparator obc)
864                    throws com.liferay.portal.kernel.exception.SystemException {
865                    return _roleLocalService.search(companyId, name, description, types,
866                            start, end, obc);
867            }
868    
869            /**
870            * Returns an ordered range of all the roles that match the name,
871            * description, types, and params.
872            *
873            * <p>
874            * Useful when paginating results. Returns a maximum of <code>end -
875            * start</code> instances. <code>start</code> and <code>end</code> are not
876            * primary keys, they are indexes in the result set. Thus, <code>0</code>
877            * refers to the first result in the set. Setting both <code>start</code>
878            * and <code>end</code> to {@link
879            * com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the
880            * full result set.
881            * </p>
882            *
883            * @param companyId the primary key of the company
884            * @param name the role's name (optionally <code>null</code>)
885            * @param description the role's description (optionally
886            <code>null</code>)
887            * @param types the role types (optionally <code>null</code>)
888            * @param params the finder's parameters. Can specify values for
889            "permissionsResourceId" and "usersRoles" keys. For more
890            information, see {@link
891            com.liferay.portal.service.persistence.RoleFinder}
892            * @param start the lower bound of the range of the roles to return
893            * @param end the upper bound of the range of the roles to return (not
894            inclusive)
895            * @param obc the comparator to order the roles (optionally
896            <code>null</code>)
897            * @return the ordered range of the matching roles, ordered by
898            <code>obc</code>
899            * @throws SystemException if a system exception occurred
900            * @see com.liferay.portal.service.persistence.RoleFinder
901            */
902            public java.util.List<com.liferay.portal.model.Role> search(
903                    long companyId, java.lang.String name, java.lang.String description,
904                    java.lang.Integer[] types,
905                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
906                    int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
907                    throws com.liferay.portal.kernel.exception.SystemException {
908                    return _roleLocalService.search(companyId, name, description, types,
909                            params, start, end, obc);
910            }
911    
912            /**
913            * Returns the number of roles that match the keywords and types.
914            *
915            * @param companyId the primary key of the company
916            * @param keywords the keywords (space separated), which may occur in the
917            role's name or description (optionally <code>null</code>)
918            * @param types the role types (optionally <code>null</code>)
919            * @return the number of matching roles
920            * @throws SystemException if a system exception occurred
921            */
922            public int searchCount(long companyId, java.lang.String keywords,
923                    java.lang.Integer[] types)
924                    throws com.liferay.portal.kernel.exception.SystemException {
925                    return _roleLocalService.searchCount(companyId, keywords, types);
926            }
927    
928            /**
929            * Returns the number of roles that match the keywords, types and params.
930            *
931            * @param companyId the primary key of the company
932            * @param keywords the keywords (space separated), which may occur in the
933            role's name or description (optionally <code>null</code>)
934            * @param types the role types (optionally <code>null</code>)
935            * @param params the finder parameters. For more information, see {@link
936            com.liferay.portal.service.persistence.RoleFinder}
937            * @return the number of matching roles
938            * @throws SystemException if a system exception occurred
939            */
940            public int searchCount(long companyId, java.lang.String keywords,
941                    java.lang.Integer[] types,
942                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
943                    throws com.liferay.portal.kernel.exception.SystemException {
944                    return _roleLocalService.searchCount(companyId, keywords, types, params);
945            }
946    
947            /**
948            * Returns the number of roles that match the name, description, and types.
949            *
950            * @param companyId the primary key of the company
951            * @param name the role's name (optionally <code>null</code>)
952            * @param description the role's description (optionally
953            <code>null</code>)
954            * @param types the role types (optionally <code>null</code>)
955            * @return the number of matching roles
956            * @throws SystemException if a system exception occurred
957            */
958            public int searchCount(long companyId, java.lang.String name,
959                    java.lang.String description, java.lang.Integer[] types)
960                    throws com.liferay.portal.kernel.exception.SystemException {
961                    return _roleLocalService.searchCount(companyId, name, description, types);
962            }
963    
964            /**
965            * Returns the number of roles that match the name, description, types, and
966            * params.
967            *
968            * @param companyId the primary key of the company
969            * @param name the role's name (optionally <code>null</code>)
970            * @param description the role's description (optionally
971            <code>null</code>)
972            * @param types the role types (optionally <code>null</code>)
973            * @param params the finder parameters. Can specify values for
974            "permissionsResourceId" and "usersRoles" keys. For more
975            information, see {@link
976            com.liferay.portal.service.persistence.RoleFinder}
977            * @return the number of matching roles
978            * @throws SystemException if a system exception occurred
979            */
980            public int searchCount(long companyId, java.lang.String name,
981                    java.lang.String description, java.lang.Integer[] types,
982                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
983                    throws com.liferay.portal.kernel.exception.SystemException {
984                    return _roleLocalService.searchCount(companyId, name, description,
985                            types, params);
986            }
987    
988            /**
989            * Sets the roles associated with the user, replacing the user's existing
990            * roles. The user is reindexed after the roles are set.
991            *
992            * @param userId the primary key of the user
993            * @param roleIds the primary keys of the roles
994            * @throws PortalException if a user with the primary could not be found or
995            if any one of the roles with the primary keys could not be found
996            * @throws SystemException if a system exception occurred
997            */
998            public void setUserRoles(long userId, long[] roleIds)
999                    throws com.liferay.portal.kernel.exception.PortalException,
1000                            com.liferay.portal.kernel.exception.SystemException {
1001                    _roleLocalService.setUserRoles(userId, roleIds);
1002            }
1003    
1004            /**
1005            * Removes the matching roles associated with the user. The user is
1006            * reindexed after the roles are removed.
1007            *
1008            * @param userId the primary key of the user
1009            * @param roleIds the primary keys of the roles
1010            * @throws PortalException if a user with the primary key could not be
1011            found or if a role with any one of the primary keys could not be
1012            found
1013            * @throws SystemException if a system exception occurred
1014            */
1015            public void unsetUserRoles(long userId, long[] roleIds)
1016                    throws com.liferay.portal.kernel.exception.PortalException,
1017                            com.liferay.portal.kernel.exception.SystemException {
1018                    _roleLocalService.unsetUserRoles(userId, roleIds);
1019            }
1020    
1021            /**
1022            * Updates the role with the primary key.
1023            *
1024            * @param roleId the primary key of the role
1025            * @param name the role's new name
1026            * @param titleMap the new localized titles (optionally <code>null</code>)
1027            to replace those existing for the role
1028            * @param descriptionMap the new localized descriptions (optionally
1029            <code>null</code>) to replace those existing for the role
1030            * @param subtype the role's new subtype (optionally <code>null</code>)
1031            * @return the role with the primary key
1032            * @throws PortalException if a role with the primary could not be found or
1033            if the role's name was invalid
1034            * @throws SystemException if a system exception occurred
1035            */
1036            public com.liferay.portal.model.Role updateRole(long roleId,
1037                    java.lang.String name,
1038                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
1039                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
1040                    java.lang.String subtype)
1041                    throws com.liferay.portal.kernel.exception.PortalException,
1042                            com.liferay.portal.kernel.exception.SystemException {
1043                    return _roleLocalService.updateRole(roleId, name, titleMap,
1044                            descriptionMap, subtype);
1045            }
1046    
1047            /**
1048             * @deprecated Renamed to {@link #getWrappedService}
1049             */
1050            public RoleLocalService getWrappedRoleLocalService() {
1051                    return _roleLocalService;
1052            }
1053    
1054            /**
1055             * @deprecated Renamed to {@link #setWrappedService}
1056             */
1057            public void setWrappedRoleLocalService(RoleLocalService roleLocalService) {
1058                    _roleLocalService = roleLocalService;
1059            }
1060    
1061            public RoleLocalService getWrappedService() {
1062                    return _roleLocalService;
1063            }
1064    
1065            public void setWrappedService(RoleLocalService roleLocalService) {
1066                    _roleLocalService = roleLocalService;
1067            }
1068    
1069            private RoleLocalService _roleLocalService;
1070    }