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    /**
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.model.Role addRole(java.lang.String className,
053                    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.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.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.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.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.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.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.model.Role> getRoles(int type,
156                    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.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.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.model.Role> getUserRelatedRoles(
198                    long userId, java.util.List<com.liferay.portal.model.Group> groups)
199                    throws com.liferay.portal.kernel.exception.PortalException {
200                    return _roleService.getUserRelatedRoles(userId, groups);
201            }
202    
203            /**
204            * Returns all the roles associated with the user.
205            *
206            * @param userId the primary key of the user
207            * @return the roles associated with the user
208            */
209            @Override
210            public java.util.List<com.liferay.portal.model.Role> getUserRoles(
211                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
212                    return _roleService.getUserRoles(userId);
213            }
214    
215            /**
216            * Returns <code>true</code> if the user is associated with the named
217            * regular role.
218            *
219            * @param userId the primary key of the user
220            * @param companyId the primary key of the company
221            * @param name the name of the role
222            * @param inherited whether to include the user's inherited roles in the
223            search
224            * @return <code>true</code> if the user is associated with the regular
225            role; <code>false</code> otherwise
226            */
227            @Override
228            public boolean hasUserRole(long userId, long companyId,
229                    java.lang.String name, boolean inherited)
230                    throws com.liferay.portal.kernel.exception.PortalException {
231                    return _roleService.hasUserRole(userId, companyId, name, inherited);
232            }
233    
234            /**
235            * Returns <code>true</code> if the user has any one of the named regular
236            * roles.
237            *
238            * @param userId the primary key of the user
239            * @param companyId the primary key of the company
240            * @param names the names of the roles
241            * @param inherited whether to include the user's inherited roles in the
242            search
243            * @return <code>true</code> if the user has any one of the regular roles;
244            <code>false</code> otherwise
245            */
246            @Override
247            public boolean hasUserRoles(long userId, long companyId,
248                    java.lang.String[] names, boolean inherited)
249                    throws com.liferay.portal.kernel.exception.PortalException {
250                    return _roleService.hasUserRoles(userId, companyId, names, inherited);
251            }
252    
253            @Override
254            public java.util.List<com.liferay.portal.model.Role> search(
255                    long companyId, java.lang.String keywords, java.lang.Integer[] types,
256                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
257                    int start, int end,
258                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Role> obc) {
259                    return _roleService.search(companyId, keywords, types, params, start,
260                            end, obc);
261            }
262    
263            @Override
264            public int searchCount(long companyId, java.lang.String keywords,
265                    java.lang.Integer[] types,
266                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params) {
267                    return _roleService.searchCount(companyId, keywords, types, params);
268            }
269    
270            /**
271            * Removes the matching roles associated with the user. The user is
272            * reindexed after the roles are removed.
273            *
274            * @param userId the primary key of the user
275            * @param roleIds the primary keys of the roles
276            */
277            @Override
278            public void unsetUserRoles(long userId, long[] roleIds)
279                    throws com.liferay.portal.kernel.exception.PortalException {
280                    _roleService.unsetUserRoles(userId, roleIds);
281            }
282    
283            /**
284            * Updates the role with the primary key.
285            *
286            * @param roleId the primary key of the role
287            * @param name the role's new name
288            * @param titleMap the new localized titles (optionally <code>null</code>)
289            to replace those existing for the role
290            * @param descriptionMap the new localized descriptions (optionally
291            <code>null</code>) to replace those existing for the role
292            * @param subtype the role's new subtype (optionally <code>null</code>)
293            * @param serviceContext the service context to be applied (optionally
294            <code>null</code>). Can set the expando bridge attributes for the
295            role.
296            * @return the role with the primary key
297            */
298            @Override
299            public com.liferay.portal.model.Role updateRole(long roleId,
300                    java.lang.String name,
301                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
302                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
303                    java.lang.String subtype,
304                    com.liferay.portal.service.ServiceContext serviceContext)
305                    throws com.liferay.portal.kernel.exception.PortalException {
306                    return _roleService.updateRole(roleId, name, titleMap, descriptionMap,
307                            subtype, serviceContext);
308            }
309    
310            @Override
311            public RoleService getWrappedService() {
312                    return _roleService;
313            }
314    
315            @Override
316            public void setWrappedService(RoleService roleService) {
317                    _roleService = roleService;
318            }
319    
320            private RoleService _roleService;
321    }