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.PortalServiceUtil;
023    
024    /**
025     * <p>
026     * This class provides a HTTP utility for the
027     * {@link com.liferay.portal.service.PortalServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it requires an additional
030     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
031     * </p>
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author    Brian Wing Shun Chan
049     * @see       PortalServiceSoap
050     * @see       com.liferay.portal.security.auth.HttpPrincipal
051     * @see       com.liferay.portal.service.PortalServiceUtil
052     * @generated
053     */
054    public class PortalServiceHttp {
055            public static java.lang.String getAutoDeployDirectory(
056                    HttpPrincipal httpPrincipal)
057                    throws com.liferay.portal.kernel.exception.SystemException {
058                    try {
059                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
060                                            "getAutoDeployDirectory",
061                                            _getAutoDeployDirectoryParameterTypes0);
062    
063                            MethodHandler methodHandler = new MethodHandler(methodKey);
064    
065                            Object returnObj = null;
066    
067                            try {
068                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
069                            }
070                            catch (Exception e) {
071                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
072                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
073                                    }
074    
075                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
076                            }
077    
078                            return (java.lang.String)returnObj;
079                    }
080                    catch (com.liferay.portal.kernel.exception.SystemException se) {
081                            _log.error(se, se);
082    
083                            throw se;
084                    }
085            }
086    
087            public static int getBuildNumber(HttpPrincipal httpPrincipal)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    try {
090                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
091                                            "getBuildNumber", _getBuildNumberParameterTypes1);
092    
093                            MethodHandler methodHandler = new MethodHandler(methodKey);
094    
095                            Object returnObj = null;
096    
097                            try {
098                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
099                            }
100                            catch (Exception e) {
101                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
102                            }
103    
104                            return ((Integer)returnObj).intValue();
105                    }
106                    catch (com.liferay.portal.kernel.exception.SystemException se) {
107                            _log.error(se, se);
108    
109                            throw se;
110                    }
111            }
112    
113            public static void testAddClassName_Rollback(HttpPrincipal httpPrincipal,
114                    java.lang.String classNameValue)
115                    throws com.liferay.portal.kernel.exception.SystemException {
116                    try {
117                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
118                                            "testAddClassName_Rollback",
119                                            _testAddClassName_RollbackParameterTypes2);
120    
121                            MethodHandler methodHandler = new MethodHandler(methodKey,
122                                            classNameValue);
123    
124                            try {
125                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
126                            }
127                            catch (Exception e) {
128                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
129                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
130                                    }
131    
132                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
133                            }
134                    }
135                    catch (com.liferay.portal.kernel.exception.SystemException se) {
136                            _log.error(se, se);
137    
138                            throw se;
139                    }
140            }
141    
142            public static void testAddClassName_Success(HttpPrincipal httpPrincipal,
143                    java.lang.String classNameValue)
144                    throws com.liferay.portal.kernel.exception.SystemException {
145                    try {
146                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
147                                            "testAddClassName_Success",
148                                            _testAddClassName_SuccessParameterTypes3);
149    
150                            MethodHandler methodHandler = new MethodHandler(methodKey,
151                                            classNameValue);
152    
153                            try {
154                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
155                            }
156                            catch (Exception e) {
157                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
158                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
159                                    }
160    
161                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
162                            }
163                    }
164                    catch (com.liferay.portal.kernel.exception.SystemException se) {
165                            _log.error(se, se);
166    
167                            throw se;
168                    }
169            }
170    
171            public static void testAddClassNameAndTestTransactionPortletBar_PortalRollback(
172                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText)
173                    throws com.liferay.portal.kernel.exception.SystemException {
174                    try {
175                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
176                                            "testAddClassNameAndTestTransactionPortletBar_PortalRollback",
177                                            _testAddClassNameAndTestTransactionPortletBar_PortalRollbackParameterTypes4);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey,
180                                            transactionPortletBarText);
181    
182                            try {
183                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
184                            }
185                            catch (Exception e) {
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 void testAddClassNameAndTestTransactionPortletBar_PortletRollback(
201                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    try {
204                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
205                                            "testAddClassNameAndTestTransactionPortletBar_PortletRollback",
206                                            _testAddClassNameAndTestTransactionPortletBar_PortletRollbackParameterTypes5);
207    
208                            MethodHandler methodHandler = new MethodHandler(methodKey,
209                                            transactionPortletBarText);
210    
211                            try {
212                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
213                            }
214                            catch (Exception e) {
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 testAddClassNameAndTestTransactionPortletBar_Success(
230                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText)
231                    throws com.liferay.portal.kernel.exception.SystemException {
232                    try {
233                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
234                                            "testAddClassNameAndTestTransactionPortletBar_Success",
235                                            _testAddClassNameAndTestTransactionPortletBar_SuccessParameterTypes6);
236    
237                            MethodHandler methodHandler = new MethodHandler(methodKey,
238                                            transactionPortletBarText);
239    
240                            try {
241                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
242                            }
243                            catch (Exception e) {
244                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
245                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
246                                    }
247    
248                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
249                            }
250                    }
251                    catch (com.liferay.portal.kernel.exception.SystemException se) {
252                            _log.error(se, se);
253    
254                            throw se;
255                    }
256            }
257    
258            public static void testAutoSyncHibernateSessionStateOnTxCreation(
259                    HttpPrincipal httpPrincipal)
260                    throws com.liferay.portal.kernel.exception.SystemException {
261                    try {
262                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
263                                            "testAutoSyncHibernateSessionStateOnTxCreation",
264                                            _testAutoSyncHibernateSessionStateOnTxCreationParameterTypes7);
265    
266                            MethodHandler methodHandler = new MethodHandler(methodKey);
267    
268                            try {
269                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
270                            }
271                            catch (Exception e) {
272                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
273                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
274                                    }
275    
276                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
277                            }
278                    }
279                    catch (com.liferay.portal.kernel.exception.SystemException se) {
280                            _log.error(se, se);
281    
282                            throw se;
283                    }
284            }
285    
286            public static void testCounterIncrement_Rollback(
287                    HttpPrincipal httpPrincipal)
288                    throws com.liferay.portal.kernel.exception.SystemException {
289                    try {
290                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
291                                            "testCounterIncrement_Rollback",
292                                            _testCounterIncrement_RollbackParameterTypes8);
293    
294                            MethodHandler methodHandler = new MethodHandler(methodKey);
295    
296                            try {
297                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
298                            }
299                            catch (Exception e) {
300                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
301                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
302                                    }
303    
304                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
305                            }
306                    }
307                    catch (com.liferay.portal.kernel.exception.SystemException se) {
308                            _log.error(se, se);
309    
310                            throw se;
311                    }
312            }
313    
314            public static void testDeleteClassName(HttpPrincipal httpPrincipal)
315                    throws com.liferay.portal.kernel.exception.PortalException,
316                            com.liferay.portal.kernel.exception.SystemException {
317                    try {
318                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
319                                            "testDeleteClassName", _testDeleteClassNameParameterTypes9);
320    
321                            MethodHandler methodHandler = new MethodHandler(methodKey);
322    
323                            try {
324                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
325                            }
326                            catch (Exception e) {
327                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
328                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
329                                    }
330    
331                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
332                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
333                                    }
334    
335                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
336                            }
337                    }
338                    catch (com.liferay.portal.kernel.exception.SystemException se) {
339                            _log.error(se, se);
340    
341                            throw se;
342                    }
343            }
344    
345            public static int testGetBuildNumber(HttpPrincipal httpPrincipal)
346                    throws com.liferay.portal.kernel.exception.SystemException {
347                    try {
348                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
349                                            "testGetBuildNumber", _testGetBuildNumberParameterTypes10);
350    
351                            MethodHandler methodHandler = new MethodHandler(methodKey);
352    
353                            Object returnObj = null;
354    
355                            try {
356                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
357                            }
358                            catch (Exception e) {
359                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
360                            }
361    
362                            return ((Integer)returnObj).intValue();
363                    }
364                    catch (com.liferay.portal.kernel.exception.SystemException se) {
365                            _log.error(se, se);
366    
367                            throw se;
368                    }
369            }
370    
371            public static void testGetUserId(HttpPrincipal httpPrincipal)
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    try {
374                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
375                                            "testGetUserId", _testGetUserIdParameterTypes11);
376    
377                            MethodHandler methodHandler = new MethodHandler(methodKey);
378    
379                            try {
380                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
381                            }
382                            catch (Exception e) {
383                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
384                            }
385                    }
386                    catch (com.liferay.portal.kernel.exception.SystemException se) {
387                            _log.error(se, se);
388    
389                            throw se;
390                    }
391            }
392    
393            public static boolean testHasClassName(HttpPrincipal httpPrincipal)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    try {
396                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
397                                            "testHasClassName", _testHasClassNameParameterTypes12);
398    
399                            MethodHandler methodHandler = new MethodHandler(methodKey);
400    
401                            Object returnObj = null;
402    
403                            try {
404                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
405                            }
406                            catch (Exception e) {
407                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
408                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
409                                    }
410    
411                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
412                            }
413    
414                            return ((Boolean)returnObj).booleanValue();
415                    }
416                    catch (com.liferay.portal.kernel.exception.SystemException se) {
417                            _log.error(se, se);
418    
419                            throw se;
420                    }
421            }
422    
423            private static Log _log = LogFactoryUtil.getLog(PortalServiceHttp.class);
424            private static final Class<?>[] _getAutoDeployDirectoryParameterTypes0 = new Class[] {
425                            
426                    };
427            private static final Class<?>[] _getBuildNumberParameterTypes1 = new Class[] {
428                            
429                    };
430            private static final Class<?>[] _testAddClassName_RollbackParameterTypes2 = new Class[] {
431                            java.lang.String.class
432                    };
433            private static final Class<?>[] _testAddClassName_SuccessParameterTypes3 = new Class[] {
434                            java.lang.String.class
435                    };
436            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortalRollbackParameterTypes4 =
437                    new Class[] { java.lang.String.class };
438            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortletRollbackParameterTypes5 =
439                    new Class[] { java.lang.String.class };
440            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_SuccessParameterTypes6 =
441                    new Class[] { java.lang.String.class };
442            private static final Class<?>[] _testAutoSyncHibernateSessionStateOnTxCreationParameterTypes7 =
443                    new Class[] {  };
444            private static final Class<?>[] _testCounterIncrement_RollbackParameterTypes8 =
445                    new Class[] {  };
446            private static final Class<?>[] _testDeleteClassNameParameterTypes9 = new Class[] {
447                            
448                    };
449            private static final Class<?>[] _testGetBuildNumberParameterTypes10 = new Class[] {
450                            
451                    };
452            private static final Class<?>[] _testGetUserIdParameterTypes11 = new Class[] {
453                            
454                    };
455            private static final Class<?>[] _testHasClassNameParameterTypes12 = new Class[] {
456                            
457                    };
458    }