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