001    /**
002     * Copyright (c) 2000-2013 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.http;
016    
017    import com.liferay.portal.kernel.log.Log;
018    import com.liferay.portal.kernel.log.LogFactoryUtil;
019    import com.liferay.portal.kernel.util.MethodHandler;
020    import com.liferay.portal.kernel.util.MethodKey;
021    import com.liferay.portal.security.auth.HttpPrincipal;
022    import com.liferay.portal.service.RoleServiceUtil;
023    
024    /**
025     * Provides the HTTP utility for the
026     * {@link com.liferay.portal.service.RoleServiceUtil} service utility. The
027     * static methods of this class calls the same methods of the service utility.
028     * However, the signatures are different because it requires an additional
029     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
030     *
031     * <p>
032     * The benefits of using the HTTP utility is that it is fast and allows for
033     * tunneling without the cost of serializing to text. The drawback is that it
034     * only works with Java.
035     * </p>
036     *
037     * <p>
038     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
039     * configure security.
040     * </p>
041     *
042     * <p>
043     * The HTTP utility is only generated for remote services.
044     * </p>
045     *
046     * @author Brian Wing Shun Chan
047     * @see RoleServiceSoap
048     * @see com.liferay.portal.security.auth.HttpPrincipal
049     * @see com.liferay.portal.service.RoleServiceUtil
050     * @generated
051     */
052    public class RoleServiceHttp {
053            public static com.liferay.portal.model.Role addRole(
054                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
055                    java.lang.String name,
056                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
057                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
058                    int type, java.lang.String subtype,
059                    com.liferay.portal.service.ServiceContext serviceContext)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    try {
063                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
064                                            "addRole", _addRoleParameterTypes0);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey,
067                                            className, classPK, name, titleMap, descriptionMap, type,
068                                            subtype, serviceContext);
069    
070                            Object returnObj = null;
071    
072                            try {
073                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074                            }
075                            catch (Exception e) {
076                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
078                                    }
079    
080                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
082                                    }
083    
084                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
085                            }
086    
087                            return (com.liferay.portal.model.Role)returnObj;
088                    }
089                    catch (com.liferay.portal.kernel.exception.SystemException se) {
090                            _log.error(se, se);
091    
092                            throw se;
093                    }
094            }
095    
096            public static com.liferay.portal.model.Role addRole(
097                    HttpPrincipal httpPrincipal, java.lang.String name,
098                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
099                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
100                    int type)
101                    throws com.liferay.portal.kernel.exception.PortalException,
102                            com.liferay.portal.kernel.exception.SystemException {
103                    try {
104                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
105                                            "addRole", _addRoleParameterTypes1);
106    
107                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
108                                            titleMap, descriptionMap, type);
109    
110                            Object returnObj = null;
111    
112                            try {
113                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
114                            }
115                            catch (Exception e) {
116                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
117                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
118                                    }
119    
120                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
121                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
122                                    }
123    
124                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
125                            }
126    
127                            return (com.liferay.portal.model.Role)returnObj;
128                    }
129                    catch (com.liferay.portal.kernel.exception.SystemException se) {
130                            _log.error(se, se);
131    
132                            throw se;
133                    }
134            }
135    
136            public static void addUserRoles(HttpPrincipal httpPrincipal, long userId,
137                    long[] roleIds)
138                    throws com.liferay.portal.kernel.exception.PortalException,
139                            com.liferay.portal.kernel.exception.SystemException {
140                    try {
141                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
142                                            "addUserRoles", _addUserRolesParameterTypes2);
143    
144                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
145                                            roleIds);
146    
147                            try {
148                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
149                            }
150                            catch (Exception e) {
151                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
152                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
153                                    }
154    
155                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
156                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
157                                    }
158    
159                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
160                            }
161                    }
162                    catch (com.liferay.portal.kernel.exception.SystemException se) {
163                            _log.error(se, se);
164    
165                            throw se;
166                    }
167            }
168    
169            public static void deleteRole(HttpPrincipal httpPrincipal, long roleId)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    try {
173                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
174                                            "deleteRole", _deleteRoleParameterTypes3);
175    
176                            MethodHandler methodHandler = new MethodHandler(methodKey, roleId);
177    
178                            try {
179                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
180                            }
181                            catch (Exception e) {
182                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
183                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
184                                    }
185    
186                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
187                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
188                                    }
189    
190                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
191                            }
192                    }
193                    catch (com.liferay.portal.kernel.exception.SystemException se) {
194                            _log.error(se, se);
195    
196                            throw se;
197                    }
198            }
199    
200            public static java.util.List<com.liferay.portal.model.Role> getGroupRoles(
201                    HttpPrincipal httpPrincipal, long groupId)
202                    throws com.liferay.portal.kernel.exception.PortalException,
203                            com.liferay.portal.kernel.exception.SystemException {
204                    try {
205                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
206                                            "getGroupRoles", _getGroupRolesParameterTypes4);
207    
208                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId);
209    
210                            Object returnObj = null;
211    
212                            try {
213                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
214                            }
215                            catch (Exception e) {
216                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
217                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
218                                    }
219    
220                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
221                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
222                                    }
223    
224                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
225                            }
226    
227                            return (java.util.List<com.liferay.portal.model.Role>)returnObj;
228                    }
229                    catch (com.liferay.portal.kernel.exception.SystemException se) {
230                            _log.error(se, se);
231    
232                            throw se;
233                    }
234            }
235    
236            public static java.util.List<com.liferay.portal.model.Role> getGroupRolesAndTeamRoles(
237                    HttpPrincipal httpPrincipal, long companyId, java.lang.String keywords,
238                    java.util.List<java.lang.String> excludedNames, int[] types,
239                    long excludedTeamRoleId, long teamGroupId, int start, int end)
240                    throws com.liferay.portal.kernel.exception.SystemException {
241                    try {
242                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
243                                            "getGroupRolesAndTeamRoles",
244                                            _getGroupRolesAndTeamRolesParameterTypes5);
245    
246                            MethodHandler methodHandler = new MethodHandler(methodKey,
247                                            companyId, keywords, excludedNames, types,
248                                            excludedTeamRoleId, teamGroupId, start, end);
249    
250                            Object returnObj = null;
251    
252                            try {
253                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
254                            }
255                            catch (Exception e) {
256                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
257                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
258                                    }
259    
260                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
261                            }
262    
263                            return (java.util.List<com.liferay.portal.model.Role>)returnObj;
264                    }
265                    catch (com.liferay.portal.kernel.exception.SystemException se) {
266                            _log.error(se, se);
267    
268                            throw se;
269                    }
270            }
271    
272            public static int getGroupRolesAndTeamRolesCount(
273                    HttpPrincipal httpPrincipal, long companyId, java.lang.String keywords,
274                    java.util.List<java.lang.String> excludedNames, int[] types,
275                    long excludedTeamRoleId, long teamGroupId)
276                    throws com.liferay.portal.kernel.exception.SystemException {
277                    try {
278                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
279                                            "getGroupRolesAndTeamRolesCount",
280                                            _getGroupRolesAndTeamRolesCountParameterTypes6);
281    
282                            MethodHandler methodHandler = new MethodHandler(methodKey,
283                                            companyId, keywords, excludedNames, types,
284                                            excludedTeamRoleId, teamGroupId);
285    
286                            Object returnObj = null;
287    
288                            try {
289                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
290                            }
291                            catch (Exception e) {
292                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
293                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
294                                    }
295    
296                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
297                            }
298    
299                            return ((Integer)returnObj).intValue();
300                    }
301                    catch (com.liferay.portal.kernel.exception.SystemException se) {
302                            _log.error(se, se);
303    
304                            throw se;
305                    }
306            }
307    
308            public static com.liferay.portal.model.Role getRole(
309                    HttpPrincipal httpPrincipal, long roleId)
310                    throws com.liferay.portal.kernel.exception.PortalException,
311                            com.liferay.portal.kernel.exception.SystemException {
312                    try {
313                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
314                                            "getRole", _getRoleParameterTypes7);
315    
316                            MethodHandler methodHandler = new MethodHandler(methodKey, roleId);
317    
318                            Object returnObj = null;
319    
320                            try {
321                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
322                            }
323                            catch (Exception e) {
324                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
325                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
326                                    }
327    
328                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
329                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
330                                    }
331    
332                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
333                            }
334    
335                            return (com.liferay.portal.model.Role)returnObj;
336                    }
337                    catch (com.liferay.portal.kernel.exception.SystemException se) {
338                            _log.error(se, se);
339    
340                            throw se;
341                    }
342            }
343    
344            public static com.liferay.portal.model.Role getRole(
345                    HttpPrincipal httpPrincipal, long companyId, java.lang.String name)
346                    throws com.liferay.portal.kernel.exception.PortalException,
347                            com.liferay.portal.kernel.exception.SystemException {
348                    try {
349                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
350                                            "getRole", _getRoleParameterTypes8);
351    
352                            MethodHandler methodHandler = new MethodHandler(methodKey,
353                                            companyId, name);
354    
355                            Object returnObj = null;
356    
357                            try {
358                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
359                            }
360                            catch (Exception e) {
361                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
362                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
363                                    }
364    
365                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
366                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
367                                    }
368    
369                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
370                            }
371    
372                            return (com.liferay.portal.model.Role)returnObj;
373                    }
374                    catch (com.liferay.portal.kernel.exception.SystemException se) {
375                            _log.error(se, se);
376    
377                            throw se;
378                    }
379            }
380    
381            public static java.util.List<com.liferay.portal.model.Role> getUserGroupGroupRoles(
382                    HttpPrincipal httpPrincipal, long userId, long groupId)
383                    throws com.liferay.portal.kernel.exception.PortalException,
384                            com.liferay.portal.kernel.exception.SystemException {
385                    try {
386                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
387                                            "getUserGroupGroupRoles",
388                                            _getUserGroupGroupRolesParameterTypes9);
389    
390                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
391                                            groupId);
392    
393                            Object returnObj = null;
394    
395                            try {
396                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
397                            }
398                            catch (Exception e) {
399                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
400                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
401                                    }
402    
403                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
404                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
405                                    }
406    
407                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
408                            }
409    
410                            return (java.util.List<com.liferay.portal.model.Role>)returnObj;
411                    }
412                    catch (com.liferay.portal.kernel.exception.SystemException se) {
413                            _log.error(se, se);
414    
415                            throw se;
416                    }
417            }
418    
419            public static java.util.List<com.liferay.portal.model.Role> getUserGroupRoles(
420                    HttpPrincipal httpPrincipal, long userId, long groupId)
421                    throws com.liferay.portal.kernel.exception.PortalException,
422                            com.liferay.portal.kernel.exception.SystemException {
423                    try {
424                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
425                                            "getUserGroupRoles", _getUserGroupRolesParameterTypes10);
426    
427                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
428                                            groupId);
429    
430                            Object returnObj = null;
431    
432                            try {
433                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
434                            }
435                            catch (Exception e) {
436                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
437                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
438                                    }
439    
440                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
441                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
442                                    }
443    
444                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
445                            }
446    
447                            return (java.util.List<com.liferay.portal.model.Role>)returnObj;
448                    }
449                    catch (com.liferay.portal.kernel.exception.SystemException se) {
450                            _log.error(se, se);
451    
452                            throw se;
453                    }
454            }
455    
456            public static java.util.List<com.liferay.portal.model.Role> getUserRelatedRoles(
457                    HttpPrincipal httpPrincipal, long userId,
458                    java.util.List<com.liferay.portal.model.Group> groups)
459                    throws com.liferay.portal.kernel.exception.PortalException,
460                            com.liferay.portal.kernel.exception.SystemException {
461                    try {
462                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
463                                            "getUserRelatedRoles", _getUserRelatedRolesParameterTypes11);
464    
465                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
466                                            groups);
467    
468                            Object returnObj = null;
469    
470                            try {
471                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
472                            }
473                            catch (Exception e) {
474                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
475                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
476                                    }
477    
478                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
479                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
480                                    }
481    
482                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
483                            }
484    
485                            return (java.util.List<com.liferay.portal.model.Role>)returnObj;
486                    }
487                    catch (com.liferay.portal.kernel.exception.SystemException se) {
488                            _log.error(se, se);
489    
490                            throw se;
491                    }
492            }
493    
494            public static java.util.List<com.liferay.portal.model.Role> getUserRoles(
495                    HttpPrincipal httpPrincipal, long userId)
496                    throws com.liferay.portal.kernel.exception.PortalException,
497                            com.liferay.portal.kernel.exception.SystemException {
498                    try {
499                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
500                                            "getUserRoles", _getUserRolesParameterTypes12);
501    
502                            MethodHandler methodHandler = new MethodHandler(methodKey, userId);
503    
504                            Object returnObj = null;
505    
506                            try {
507                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
508                            }
509                            catch (Exception e) {
510                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
511                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
512                                    }
513    
514                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
515                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
516                                    }
517    
518                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
519                            }
520    
521                            return (java.util.List<com.liferay.portal.model.Role>)returnObj;
522                    }
523                    catch (com.liferay.portal.kernel.exception.SystemException se) {
524                            _log.error(se, se);
525    
526                            throw se;
527                    }
528            }
529    
530            public static boolean hasUserRole(HttpPrincipal httpPrincipal, long userId,
531                    long companyId, java.lang.String name, boolean inherited)
532                    throws com.liferay.portal.kernel.exception.PortalException,
533                            com.liferay.portal.kernel.exception.SystemException {
534                    try {
535                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
536                                            "hasUserRole", _hasUserRoleParameterTypes13);
537    
538                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
539                                            companyId, name, inherited);
540    
541                            Object returnObj = null;
542    
543                            try {
544                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
545                            }
546                            catch (Exception e) {
547                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
548                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
549                                    }
550    
551                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
552                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
553                                    }
554    
555                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
556                            }
557    
558                            return ((Boolean)returnObj).booleanValue();
559                    }
560                    catch (com.liferay.portal.kernel.exception.SystemException se) {
561                            _log.error(se, se);
562    
563                            throw se;
564                    }
565            }
566    
567            public static boolean hasUserRoles(HttpPrincipal httpPrincipal,
568                    long userId, long companyId, java.lang.String[] names, boolean inherited)
569                    throws com.liferay.portal.kernel.exception.PortalException,
570                            com.liferay.portal.kernel.exception.SystemException {
571                    try {
572                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
573                                            "hasUserRoles", _hasUserRolesParameterTypes14);
574    
575                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
576                                            companyId, names, inherited);
577    
578                            Object returnObj = null;
579    
580                            try {
581                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
582                            }
583                            catch (Exception e) {
584                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
585                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
586                                    }
587    
588                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
589                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
590                                    }
591    
592                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
593                            }
594    
595                            return ((Boolean)returnObj).booleanValue();
596                    }
597                    catch (com.liferay.portal.kernel.exception.SystemException se) {
598                            _log.error(se, se);
599    
600                            throw se;
601                    }
602            }
603    
604            public static java.util.List<com.liferay.portal.model.Role> search(
605                    HttpPrincipal httpPrincipal, long companyId, java.lang.String keywords,
606                    java.lang.Integer[] types,
607                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params,
608                    int start, int end,
609                    com.liferay.portal.kernel.util.OrderByComparator obc)
610                    throws com.liferay.portal.kernel.exception.SystemException {
611                    try {
612                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
613                                            "search", _searchParameterTypes15);
614    
615                            MethodHandler methodHandler = new MethodHandler(methodKey,
616                                            companyId, keywords, types, params, start, end, obc);
617    
618                            Object returnObj = null;
619    
620                            try {
621                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
622                            }
623                            catch (Exception e) {
624                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
625                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
626                                    }
627    
628                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
629                            }
630    
631                            return (java.util.List<com.liferay.portal.model.Role>)returnObj;
632                    }
633                    catch (com.liferay.portal.kernel.exception.SystemException se) {
634                            _log.error(se, se);
635    
636                            throw se;
637                    }
638            }
639    
640            public static int searchCount(HttpPrincipal httpPrincipal, long companyId,
641                    java.lang.String keywords, java.lang.Integer[] types,
642                    java.util.LinkedHashMap<java.lang.String, java.lang.Object> params)
643                    throws com.liferay.portal.kernel.exception.SystemException {
644                    try {
645                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
646                                            "searchCount", _searchCountParameterTypes16);
647    
648                            MethodHandler methodHandler = new MethodHandler(methodKey,
649                                            companyId, keywords, types, params);
650    
651                            Object returnObj = null;
652    
653                            try {
654                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
655                            }
656                            catch (Exception e) {
657                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
658                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
659                                    }
660    
661                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
662                            }
663    
664                            return ((Integer)returnObj).intValue();
665                    }
666                    catch (com.liferay.portal.kernel.exception.SystemException se) {
667                            _log.error(se, se);
668    
669                            throw se;
670                    }
671            }
672    
673            public static void unsetUserRoles(HttpPrincipal httpPrincipal, long userId,
674                    long[] roleIds)
675                    throws com.liferay.portal.kernel.exception.PortalException,
676                            com.liferay.portal.kernel.exception.SystemException {
677                    try {
678                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
679                                            "unsetUserRoles", _unsetUserRolesParameterTypes17);
680    
681                            MethodHandler methodHandler = new MethodHandler(methodKey, userId,
682                                            roleIds);
683    
684                            try {
685                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
686                            }
687                            catch (Exception e) {
688                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
689                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
690                                    }
691    
692                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
693                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
694                                    }
695    
696                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
697                            }
698                    }
699                    catch (com.liferay.portal.kernel.exception.SystemException se) {
700                            _log.error(se, se);
701    
702                            throw se;
703                    }
704            }
705    
706            public static com.liferay.portal.model.Role updateRole(
707                    HttpPrincipal httpPrincipal, long roleId, java.lang.String name,
708                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
709                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
710                    java.lang.String subtype,
711                    com.liferay.portal.service.ServiceContext serviceContext)
712                    throws com.liferay.portal.kernel.exception.PortalException,
713                            com.liferay.portal.kernel.exception.SystemException {
714                    try {
715                            MethodKey methodKey = new MethodKey(RoleServiceUtil.class,
716                                            "updateRole", _updateRoleParameterTypes18);
717    
718                            MethodHandler methodHandler = new MethodHandler(methodKey, roleId,
719                                            name, titleMap, descriptionMap, subtype, serviceContext);
720    
721                            Object returnObj = null;
722    
723                            try {
724                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
725                            }
726                            catch (Exception e) {
727                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
728                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
729                                    }
730    
731                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
732                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
733                                    }
734    
735                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
736                            }
737    
738                            return (com.liferay.portal.model.Role)returnObj;
739                    }
740                    catch (com.liferay.portal.kernel.exception.SystemException se) {
741                            _log.error(se, se);
742    
743                            throw se;
744                    }
745            }
746    
747            private static Log _log = LogFactoryUtil.getLog(RoleServiceHttp.class);
748            private static final Class<?>[] _addRoleParameterTypes0 = new Class[] {
749                            java.lang.String.class, long.class, java.lang.String.class,
750                            java.util.Map.class, java.util.Map.class, int.class,
751                            java.lang.String.class,
752                            com.liferay.portal.service.ServiceContext.class
753                    };
754            private static final Class<?>[] _addRoleParameterTypes1 = new Class[] {
755                            java.lang.String.class, java.util.Map.class, java.util.Map.class,
756                            int.class
757                    };
758            private static final Class<?>[] _addUserRolesParameterTypes2 = new Class[] {
759                            long.class, long[].class
760                    };
761            private static final Class<?>[] _deleteRoleParameterTypes3 = new Class[] {
762                            long.class
763                    };
764            private static final Class<?>[] _getGroupRolesParameterTypes4 = new Class[] {
765                            long.class
766                    };
767            private static final Class<?>[] _getGroupRolesAndTeamRolesParameterTypes5 = new Class[] {
768                            long.class, java.lang.String.class, java.util.List.class,
769                            int[].class, long.class, long.class, int.class, int.class
770                    };
771            private static final Class<?>[] _getGroupRolesAndTeamRolesCountParameterTypes6 =
772                    new Class[] {
773                            long.class, java.lang.String.class, java.util.List.class,
774                            int[].class, long.class, long.class
775                    };
776            private static final Class<?>[] _getRoleParameterTypes7 = new Class[] {
777                            long.class
778                    };
779            private static final Class<?>[] _getRoleParameterTypes8 = new Class[] {
780                            long.class, java.lang.String.class
781                    };
782            private static final Class<?>[] _getUserGroupGroupRolesParameterTypes9 = new Class[] {
783                            long.class, long.class
784                    };
785            private static final Class<?>[] _getUserGroupRolesParameterTypes10 = new Class[] {
786                            long.class, long.class
787                    };
788            private static final Class<?>[] _getUserRelatedRolesParameterTypes11 = new Class[] {
789                            long.class, java.util.List.class
790                    };
791            private static final Class<?>[] _getUserRolesParameterTypes12 = new Class[] {
792                            long.class
793                    };
794            private static final Class<?>[] _hasUserRoleParameterTypes13 = new Class[] {
795                            long.class, long.class, java.lang.String.class, boolean.class
796                    };
797            private static final Class<?>[] _hasUserRolesParameterTypes14 = new Class[] {
798                            long.class, long.class, java.lang.String[].class, boolean.class
799                    };
800            private static final Class<?>[] _searchParameterTypes15 = new Class[] {
801                            long.class, java.lang.String.class, java.lang.Integer[].class,
802                            java.util.LinkedHashMap.class, int.class, int.class,
803                            com.liferay.portal.kernel.util.OrderByComparator.class
804                    };
805            private static final Class<?>[] _searchCountParameterTypes16 = new Class[] {
806                            long.class, java.lang.String.class, java.lang.Integer[].class,
807                            java.util.LinkedHashMap.class
808                    };
809            private static final Class<?>[] _unsetUserRolesParameterTypes17 = new Class[] {
810                            long.class, long[].class
811                    };
812            private static final Class<?>[] _updateRoleParameterTypes18 = new Class[] {
813                            long.class, java.lang.String.class, java.util.Map.class,
814                            java.util.Map.class, java.lang.String.class,
815                            com.liferay.portal.service.ServiceContext.class
816                    };
817    }