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.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    /**
020     * Provides a wrapper for {@link RoleService}.
021     *
022     * @author Brian Wing Shun Chan
023     * @see RoleService
024     * @generated
025     */
026    @ProviderType
027    public class RoleServiceWrapper implements RoleService,
028            ServiceWrapper<RoleService> {
029            public RoleServiceWrapper(RoleService roleService) {
030                    _roleService = roleService;
031            }
032    
033            /**
034            * Returns <code>true</code> if the user is associated with the named
035            * regular role.
036            *
037            * @param userId the primary key of the user
038            * @param companyId the primary key of the company
039            * @param name the name of the role
040            * @param inherited whether to include the user's inherited roles in the
041            search
042            * @return <code>true</code> if the user is associated with the regular
043            role; <code>false</code> otherwise
044            */
045            @Override
046            public boolean hasUserRole(long userId, long companyId,
047                    java.lang.String name, boolean inherited)
048                    throws com.liferay.portal.kernel.exception.PortalException {
049                    return _roleService.hasUserRole(userId, companyId, name, inherited);
050            }
051    
052            /**
053            * Returns <code>true</code> if the user has any one of the named regular
054            * roles.
055            *
056            * @param userId the primary key of the user
057            * @param companyId the primary key of the company
058            * @param names the names of the roles
059            * @param inherited whether to include the user's inherited roles in the
060            search
061            * @return <code>true</code> if the user has any one of the regular roles;
062            <code>false</code> otherwise
063            */
064            @Override
065            public boolean hasUserRoles(long userId, long companyId,
066                    java.lang.String[] names, boolean inherited)
067                    throws com.liferay.portal.kernel.exception.PortalException {
068                    return _roleService.hasUserRoles(userId, companyId, names, inherited);
069            }
070    
071            /**
072            * Adds a role. The user is reindexed after role is added.
073            *
074            * @param className the name of the class for which the role is created
075            * @param classPK the primary key of the class for which the role is
076            created (optionally <code>0</code>)
077            * @param name the role's name
078            * @param titleMap the role's localized titles (optionally
079            <code>null</code>)
080            * @param descriptionMap the role's localized descriptions (optionally
081            <code>null</code>)
082            * @param type the role's type (optionally <code>0</code>)
083            * @param subtype the role's subtype (optionally <code>null</code>)
084            * @param serviceContext the service context to be applied (optionally
085            <code>null</code>). Can set the expando bridge attributes for the
086            role.
087            * @return the role
088            */
089            @Override
090            public com.liferay.portal.kernel.model.Role addRole(
091                    java.lang.String className, long classPK, java.lang.String name,
092                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
093                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
094                    int type, java.lang.String subtype, ServiceContext serviceContext)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    return _roleService.addRole(className, classPK, name, titleMap,
097                            descriptionMap, type, subtype, serviceContext);
098            }
099    
100            @Override
101            public com.liferay.portal.kernel.model.Role fetchRole(long roleId)
102                    throws com.liferay.portal.kernel.exception.PortalException {
103                    return _roleService.fetchRole(roleId);
104            }
105    
106            /**
107            * Returns the role with the name in the company.
108            *
109            * <p>
110            * The method searches the system roles map first for default roles. If a
111            * role with the name is not found, then the method will query the database.
112            * </p>
113            *
114            * @param companyId the primary key of the company
115            * @param name the role's name
116            * @return the role with the name
117            */
118            @Override
119            public com.liferay.portal.kernel.model.Role getRole(long companyId,
120                    java.lang.String name)
121                    throws com.liferay.portal.kernel.exception.PortalException {
122                    return _roleService.getRole(companyId, name);
123            }
124    
125            /**
126            * Returns the role with the primary key.
127            *
128            * @param roleId the primary key of the role
129            * @return the role with the primary key
130            */
131            @Override
132            public com.liferay.portal.kernel.model.Role getRole(long roleId)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    return _roleService.getRole(roleId);
135            }
136    
137            /**
138            * Updates the role with the primary key.
139            *
140            * @param roleId the primary key of the role
141            * @param name the role's new name
142            * @param titleMap the new localized titles (optionally <code>null</code>)
143            to replace those existing for the role
144            * @param descriptionMap the new localized descriptions (optionally
145            <code>null</code>) to replace those existing for the role
146            * @param subtype the role's new subtype (optionally <code>null</code>)
147            * @param serviceContext the service context to be applied (optionally
148            <code>null</code>). Can set the expando bridge attributes for the
149            role.
150            * @return the role with the primary key
151            */
152            @Override
153            public com.liferay.portal.kernel.model.Role updateRole(long roleId,
154                    java.lang.String name,
155                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
156                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
157                    java.lang.String subtype, ServiceContext serviceContext)
158                    throws com.liferay.portal.kernel.exception.PortalException {
159                    return _roleService.updateRole(roleId, name, titleMap, descriptionMap,
160                            subtype, serviceContext);
161            }
162    
163            @Override
164            public int searchCount(long companyId, java.lang.String keywords,
165                    java.lang.Integer[] types,
166                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) {
167                    return _roleService.searchCount(companyId, keywords, types, params);
168            }
169    
170            /**
171            * Returns the OSGi service identifier.
172            *
173            * @return the OSGi service identifier
174            */
175            @Override
176            public java.lang.String getOSGiServiceIdentifier() {
177                    return _roleService.getOSGiServiceIdentifier();
178            }
179    
180            /**
181            * Returns all the roles associated with the group.
182            *
183            * @param groupId the primary key of the group
184            * @return the roles associated with the group
185            */
186            @Override
187            public java.util.List<com.liferay.portal.kernel.model.Role> getGroupRoles(
188                    long groupId)
189                    throws com.liferay.portal.kernel.exception.PortalException {
190                    return _roleService.getGroupRoles(groupId);
191            }
192    
193            @Override
194            public java.util.List<com.liferay.portal.kernel.model.Role> getRoles(
195                    int type, java.lang.String subtype)
196                    throws com.liferay.portal.kernel.exception.PortalException {
197                    return _roleService.getRoles(type, subtype);
198            }
199    
200            @Override
201            public java.util.List<com.liferay.portal.kernel.model.Role> getRoles(
202                    long companyId, int[] types)
203                    throws com.liferay.portal.kernel.exception.PortalException {
204                    return _roleService.getRoles(companyId, types);
205            }
206    
207            /**
208            * Returns all the user's roles within the user group.
209            *
210            * @param userId the primary key of the user
211            * @param groupId the primary key of the group
212            * @return the user's roles within the user group
213            */
214            @Override
215            public java.util.List<com.liferay.portal.kernel.model.Role> getUserGroupGroupRoles(
216                    long userId, long groupId)
217                    throws com.liferay.portal.kernel.exception.PortalException {
218                    return _roleService.getUserGroupGroupRoles(userId, groupId);
219            }
220    
221            /**
222            * Returns all the user's roles within the user group.
223            *
224            * @param userId the primary key of the user
225            * @param groupId the primary key of the group
226            * @return the user's roles within the user group
227            */
228            @Override
229            public java.util.List<com.liferay.portal.kernel.model.Role> getUserGroupRoles(
230                    long userId, long groupId)
231                    throws com.liferay.portal.kernel.exception.PortalException {
232                    return _roleService.getUserGroupRoles(userId, groupId);
233            }
234    
235            /**
236            * Returns the union of all the user's roles within the groups.
237            *
238            * @param userId the primary key of the user
239            * @param groups the groups (optionally <code>null</code>)
240            * @return the union of all the user's roles within the groups
241            */
242            @Override
243            public java.util.List<com.liferay.portal.kernel.model.Role> getUserRelatedRoles(
244                    long userId,
245                    java.util.List<com.liferay.portal.kernel.model.Group> groups)
246                    throws com.liferay.portal.kernel.exception.PortalException {
247                    return _roleService.getUserRelatedRoles(userId, groups);
248            }
249    
250            /**
251            * Returns all the roles associated with the user.
252            *
253            * @param userId the primary key of the user
254            * @return the roles associated with the user
255            */
256            @Override
257            public java.util.List<com.liferay.portal.kernel.model.Role> getUserRoles(
258                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
259                    return _roleService.getUserRoles(userId);
260            }
261    
262            @Override
263            public java.util.List<com.liferay.portal.kernel.model.Role> search(
264                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
265                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
266                    int start, int end,
267                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Role> obc) {
268                    return _roleService.search(companyId, keywords, types, params, start,
269                            end, obc);
270            }
271    
272            /**
273            * Adds the roles to the user. The user is reindexed after the roles are
274            * added.
275            *
276            * @param userId the primary key of the user
277            * @param roleIds the primary keys of the roles
278            */
279            @Override
280            public void addUserRoles(long userId, long[] roleIds)
281                    throws com.liferay.portal.kernel.exception.PortalException {
282                    _roleService.addUserRoles(userId, roleIds);
283            }
284    
285            /**
286            * Deletes the role with the primary key and its associated permissions.
287            *
288            * @param roleId the primary key of the role
289            */
290            @Override
291            public void deleteRole(long roleId)
292                    throws com.liferay.portal.kernel.exception.PortalException {
293                    _roleService.deleteRole(roleId);
294            }
295    
296            /**
297            * Removes the matching roles associated with the user. The user is
298            * reindexed after the roles are removed.
299            *
300            * @param userId the primary key of the user
301            * @param roleIds the primary keys of the roles
302            */
303            @Override
304            public void unsetUserRoles(long userId, long[] roleIds)
305                    throws com.liferay.portal.kernel.exception.PortalException {
306                    _roleService.unsetUserRoles(userId, roleIds);
307            }
308    
309            @Override
310            public RoleService getWrappedService() {
311                    return _roleService;
312            }
313    
314            @Override
315            public void setWrappedService(RoleService roleService) {
316                    _roleService = roleService;
317            }
318    
319            private RoleService _roleService;
320    }