001    /**
002     * Copyright (c) 2000-2013 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.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.ResourceBlockServiceUtil;
023    
024    /**
025     * Provides the HTTP utility for the
026     * {@link com.liferay.portal.service.ResourceBlockServiceUtil} 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 ResourceBlockServiceSoap
048     * @see com.liferay.portal.security.auth.HttpPrincipal
049     * @see com.liferay.portal.service.ResourceBlockServiceUtil
050     * @generated
051     */
052    public class ResourceBlockServiceHttp {
053            public static void addCompanyScopePermission(HttpPrincipal httpPrincipal,
054                    long scopeGroupId, long companyId, java.lang.String name, long roleId,
055                    java.lang.String actionId)
056                    throws com.liferay.portal.kernel.exception.PortalException,
057                            com.liferay.portal.kernel.exception.SystemException {
058                    try {
059                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
060                                            "addCompanyScopePermission",
061                                            _addCompanyScopePermissionParameterTypes0);
062    
063                            MethodHandler methodHandler = new MethodHandler(methodKey,
064                                            scopeGroupId, companyId, name, roleId, actionId);
065    
066                            try {
067                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
068                            }
069                            catch (Exception e) {
070                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
072                                    }
073    
074                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
076                                    }
077    
078                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
079                            }
080                    }
081                    catch (com.liferay.portal.kernel.exception.SystemException se) {
082                            _log.error(se, se);
083    
084                            throw se;
085                    }
086            }
087    
088            public static void addGroupScopePermission(HttpPrincipal httpPrincipal,
089                    long scopeGroupId, long companyId, long groupId, java.lang.String name,
090                    long roleId, java.lang.String actionId)
091                    throws com.liferay.portal.kernel.exception.PortalException,
092                            com.liferay.portal.kernel.exception.SystemException {
093                    try {
094                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
095                                            "addGroupScopePermission",
096                                            _addGroupScopePermissionParameterTypes1);
097    
098                            MethodHandler methodHandler = new MethodHandler(methodKey,
099                                            scopeGroupId, companyId, groupId, name, roleId, actionId);
100    
101                            try {
102                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
103                            }
104                            catch (Exception e) {
105                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
106                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
107                                    }
108    
109                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
110                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
111                                    }
112    
113                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
114                            }
115                    }
116                    catch (com.liferay.portal.kernel.exception.SystemException se) {
117                            _log.error(se, se);
118    
119                            throw se;
120                    }
121            }
122    
123            public static void addIndividualScopePermission(
124                    HttpPrincipal httpPrincipal, long companyId, long groupId,
125                    java.lang.String name, long primKey, long roleId,
126                    java.lang.String actionId)
127                    throws com.liferay.portal.kernel.exception.PortalException,
128                            com.liferay.portal.kernel.exception.SystemException {
129                    try {
130                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
131                                            "addIndividualScopePermission",
132                                            _addIndividualScopePermissionParameterTypes2);
133    
134                            MethodHandler methodHandler = new MethodHandler(methodKey,
135                                            companyId, groupId, name, primKey, roleId, actionId);
136    
137                            try {
138                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
139                            }
140                            catch (Exception e) {
141                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
142                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
143                                    }
144    
145                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
146                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
147                                    }
148    
149                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
150                            }
151                    }
152                    catch (com.liferay.portal.kernel.exception.SystemException se) {
153                            _log.error(se, se);
154    
155                            throw se;
156                    }
157            }
158    
159            public static void removeAllGroupScopePermissions(
160                    HttpPrincipal httpPrincipal, long scopeGroupId, long companyId,
161                    java.lang.String name, long roleId, java.lang.String actionId)
162                    throws com.liferay.portal.kernel.exception.PortalException,
163                            com.liferay.portal.kernel.exception.SystemException {
164                    try {
165                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
166                                            "removeAllGroupScopePermissions",
167                                            _removeAllGroupScopePermissionsParameterTypes3);
168    
169                            MethodHandler methodHandler = new MethodHandler(methodKey,
170                                            scopeGroupId, companyId, name, roleId, actionId);
171    
172                            try {
173                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
174                            }
175                            catch (Exception e) {
176                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
177                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
178                                    }
179    
180                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
181                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
182                                    }
183    
184                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
185                            }
186                    }
187                    catch (com.liferay.portal.kernel.exception.SystemException se) {
188                            _log.error(se, se);
189    
190                            throw se;
191                    }
192            }
193    
194            public static void removeCompanyScopePermission(
195                    HttpPrincipal httpPrincipal, long scopeGroupId, long companyId,
196                    java.lang.String name, long roleId, java.lang.String actionId)
197                    throws com.liferay.portal.kernel.exception.PortalException,
198                            com.liferay.portal.kernel.exception.SystemException {
199                    try {
200                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
201                                            "removeCompanyScopePermission",
202                                            _removeCompanyScopePermissionParameterTypes4);
203    
204                            MethodHandler methodHandler = new MethodHandler(methodKey,
205                                            scopeGroupId, companyId, name, roleId, actionId);
206    
207                            try {
208                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
209                            }
210                            catch (Exception e) {
211                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
212                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
213                                    }
214    
215                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
216                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
217                                    }
218    
219                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
220                            }
221                    }
222                    catch (com.liferay.portal.kernel.exception.SystemException se) {
223                            _log.error(se, se);
224    
225                            throw se;
226                    }
227            }
228    
229            public static void removeGroupScopePermission(HttpPrincipal httpPrincipal,
230                    long scopeGroupId, long companyId, long groupId, java.lang.String name,
231                    long roleId, java.lang.String actionId)
232                    throws com.liferay.portal.kernel.exception.PortalException,
233                            com.liferay.portal.kernel.exception.SystemException {
234                    try {
235                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
236                                            "removeGroupScopePermission",
237                                            _removeGroupScopePermissionParameterTypes5);
238    
239                            MethodHandler methodHandler = new MethodHandler(methodKey,
240                                            scopeGroupId, companyId, groupId, name, roleId, actionId);
241    
242                            try {
243                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
244                            }
245                            catch (Exception e) {
246                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
247                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
248                                    }
249    
250                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
251                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
252                                    }
253    
254                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
255                            }
256                    }
257                    catch (com.liferay.portal.kernel.exception.SystemException se) {
258                            _log.error(se, se);
259    
260                            throw se;
261                    }
262            }
263    
264            public static void removeIndividualScopePermission(
265                    HttpPrincipal httpPrincipal, long companyId, long groupId,
266                    java.lang.String name, long primKey, long roleId,
267                    java.lang.String actionId)
268                    throws com.liferay.portal.kernel.exception.PortalException,
269                            com.liferay.portal.kernel.exception.SystemException {
270                    try {
271                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
272                                            "removeIndividualScopePermission",
273                                            _removeIndividualScopePermissionParameterTypes6);
274    
275                            MethodHandler methodHandler = new MethodHandler(methodKey,
276                                            companyId, groupId, name, primKey, roleId, actionId);
277    
278                            try {
279                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
280                            }
281                            catch (Exception e) {
282                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
283                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
284                                    }
285    
286                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
287                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
288                                    }
289    
290                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
291                            }
292                    }
293                    catch (com.liferay.portal.kernel.exception.SystemException se) {
294                            _log.error(se, se);
295    
296                            throw se;
297                    }
298            }
299    
300            public static void setCompanyScopePermissions(HttpPrincipal httpPrincipal,
301                    long scopeGroupId, long companyId, java.lang.String name, long roleId,
302                    java.util.List<java.lang.String> actionIds)
303                    throws com.liferay.portal.kernel.exception.PortalException,
304                            com.liferay.portal.kernel.exception.SystemException {
305                    try {
306                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
307                                            "setCompanyScopePermissions",
308                                            _setCompanyScopePermissionsParameterTypes7);
309    
310                            MethodHandler methodHandler = new MethodHandler(methodKey,
311                                            scopeGroupId, companyId, name, roleId, actionIds);
312    
313                            try {
314                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
315                            }
316                            catch (Exception e) {
317                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
318                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
319                                    }
320    
321                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
322                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
323                                    }
324    
325                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
326                            }
327                    }
328                    catch (com.liferay.portal.kernel.exception.SystemException se) {
329                            _log.error(se, se);
330    
331                            throw se;
332                    }
333            }
334    
335            public static void setGroupScopePermissions(HttpPrincipal httpPrincipal,
336                    long scopeGroupId, long companyId, long groupId, java.lang.String name,
337                    long roleId, java.util.List<java.lang.String> actionIds)
338                    throws com.liferay.portal.kernel.exception.PortalException,
339                            com.liferay.portal.kernel.exception.SystemException {
340                    try {
341                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
342                                            "setGroupScopePermissions",
343                                            _setGroupScopePermissionsParameterTypes8);
344    
345                            MethodHandler methodHandler = new MethodHandler(methodKey,
346                                            scopeGroupId, companyId, groupId, name, roleId, actionIds);
347    
348                            try {
349                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
350                            }
351                            catch (Exception e) {
352                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
353                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
354                                    }
355    
356                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
357                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
358                                    }
359    
360                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
361                            }
362                    }
363                    catch (com.liferay.portal.kernel.exception.SystemException se) {
364                            _log.error(se, se);
365    
366                            throw se;
367                    }
368            }
369    
370            public static void setIndividualScopePermissions(
371                    HttpPrincipal httpPrincipal, long companyId, long groupId,
372                    java.lang.String name, long primKey, long roleId,
373                    java.util.List<java.lang.String> actionIds)
374                    throws com.liferay.portal.kernel.exception.PortalException,
375                            com.liferay.portal.kernel.exception.SystemException {
376                    try {
377                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
378                                            "setIndividualScopePermissions",
379                                            _setIndividualScopePermissionsParameterTypes9);
380    
381                            MethodHandler methodHandler = new MethodHandler(methodKey,
382                                            companyId, groupId, name, primKey, roleId, actionIds);
383    
384                            try {
385                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
386                            }
387                            catch (Exception e) {
388                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
389                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
390                                    }
391    
392                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
393                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
394                                    }
395    
396                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
397                            }
398                    }
399                    catch (com.liferay.portal.kernel.exception.SystemException se) {
400                            _log.error(se, se);
401    
402                            throw se;
403                    }
404            }
405    
406            public static void setIndividualScopePermissions(
407                    HttpPrincipal httpPrincipal, long companyId, long groupId,
408                    java.lang.String name, long primKey,
409                    java.util.Map<java.lang.Long, java.lang.String[]> roleIdsToActionIds)
410                    throws com.liferay.portal.kernel.exception.PortalException,
411                            com.liferay.portal.kernel.exception.SystemException {
412                    try {
413                            MethodKey methodKey = new MethodKey(ResourceBlockServiceUtil.class,
414                                            "setIndividualScopePermissions",
415                                            _setIndividualScopePermissionsParameterTypes10);
416    
417                            MethodHandler methodHandler = new MethodHandler(methodKey,
418                                            companyId, groupId, name, primKey, roleIdsToActionIds);
419    
420                            try {
421                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
422                            }
423                            catch (Exception e) {
424                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
425                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
426                                    }
427    
428                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
429                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
430                                    }
431    
432                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
433                            }
434                    }
435                    catch (com.liferay.portal.kernel.exception.SystemException se) {
436                            _log.error(se, se);
437    
438                            throw se;
439                    }
440            }
441    
442            private static Log _log = LogFactoryUtil.getLog(ResourceBlockServiceHttp.class);
443            private static final Class<?>[] _addCompanyScopePermissionParameterTypes0 = new Class[] {
444                            long.class, long.class, java.lang.String.class, long.class,
445                            java.lang.String.class
446                    };
447            private static final Class<?>[] _addGroupScopePermissionParameterTypes1 = new Class[] {
448                            long.class, long.class, long.class, java.lang.String.class,
449                            long.class, java.lang.String.class
450                    };
451            private static final Class<?>[] _addIndividualScopePermissionParameterTypes2 =
452                    new Class[] {
453                            long.class, long.class, java.lang.String.class, long.class,
454                            long.class, java.lang.String.class
455                    };
456            private static final Class<?>[] _removeAllGroupScopePermissionsParameterTypes3 =
457                    new Class[] {
458                            long.class, long.class, java.lang.String.class, long.class,
459                            java.lang.String.class
460                    };
461            private static final Class<?>[] _removeCompanyScopePermissionParameterTypes4 =
462                    new Class[] {
463                            long.class, long.class, java.lang.String.class, long.class,
464                            java.lang.String.class
465                    };
466            private static final Class<?>[] _removeGroupScopePermissionParameterTypes5 = new Class[] {
467                            long.class, long.class, long.class, java.lang.String.class,
468                            long.class, java.lang.String.class
469                    };
470            private static final Class<?>[] _removeIndividualScopePermissionParameterTypes6 =
471                    new Class[] {
472                            long.class, long.class, java.lang.String.class, long.class,
473                            long.class, java.lang.String.class
474                    };
475            private static final Class<?>[] _setCompanyScopePermissionsParameterTypes7 = new Class[] {
476                            long.class, long.class, java.lang.String.class, long.class,
477                            java.util.List.class
478                    };
479            private static final Class<?>[] _setGroupScopePermissionsParameterTypes8 = new Class[] {
480                            long.class, long.class, long.class, java.lang.String.class,
481                            long.class, java.util.List.class
482                    };
483            private static final Class<?>[] _setIndividualScopePermissionsParameterTypes9 =
484                    new Class[] {
485                            long.class, long.class, java.lang.String.class, long.class,
486                            long.class, java.util.List.class
487                    };
488            private static final Class<?>[] _setIndividualScopePermissionsParameterTypes10 =
489                    new Class[] {
490                            long.class, long.class, java.lang.String.class, long.class,
491                            java.util.Map.class
492                    };
493    }