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