001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.http;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.PortalServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link PortalServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link HttpPrincipal} parameter.
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 HttpPrincipal
051     * @see PortalServiceUtil
052     * @generated
053     */
054    @ProviderType
055    public class PortalServiceHttp {
056            public static java.lang.String getAutoDeployDirectory(
057                    HttpPrincipal httpPrincipal) {
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
072                            }
073    
074                            return (java.lang.String)returnObj;
075                    }
076                    catch (com.liferay.portal.kernel.exception.SystemException se) {
077                            _log.error(se, se);
078    
079                            throw se;
080                    }
081            }
082    
083            public static int getBuildNumber(HttpPrincipal httpPrincipal) {
084                    try {
085                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
086                                            "getBuildNumber", _getBuildNumberParameterTypes1);
087    
088                            MethodHandler methodHandler = new MethodHandler(methodKey);
089    
090                            Object returnObj = null;
091    
092                            try {
093                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
094                            }
095                            catch (Exception e) {
096                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
097                            }
098    
099                            return ((Integer)returnObj).intValue();
100                    }
101                    catch (com.liferay.portal.kernel.exception.SystemException se) {
102                            _log.error(se, se);
103    
104                            throw se;
105                    }
106            }
107    
108            public static java.lang.String getVersion(HttpPrincipal httpPrincipal) {
109                    try {
110                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
111                                            "getVersion", _getVersionParameterTypes2);
112    
113                            MethodHandler methodHandler = new MethodHandler(methodKey);
114    
115                            Object returnObj = null;
116    
117                            try {
118                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
119                            }
120                            catch (Exception e) {
121                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
122                            }
123    
124                            return (java.lang.String)returnObj;
125                    }
126                    catch (com.liferay.portal.kernel.exception.SystemException se) {
127                            _log.error(se, se);
128    
129                            throw se;
130                    }
131            }
132    
133            public static void testAddClassName_Rollback(HttpPrincipal httpPrincipal,
134                    java.lang.String classNameValue) {
135                    try {
136                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
137                                            "testAddClassName_Rollback",
138                                            _testAddClassName_RollbackParameterTypes3);
139    
140                            MethodHandler methodHandler = new MethodHandler(methodKey,
141                                            classNameValue);
142    
143                            try {
144                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
145                            }
146                            catch (Exception e) {
147                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
148                            }
149                    }
150                    catch (com.liferay.portal.kernel.exception.SystemException se) {
151                            _log.error(se, se);
152    
153                            throw se;
154                    }
155            }
156    
157            public static void testAddClassName_Success(HttpPrincipal httpPrincipal,
158                    java.lang.String classNameValue) {
159                    try {
160                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
161                                            "testAddClassName_Success",
162                                            _testAddClassName_SuccessParameterTypes4);
163    
164                            MethodHandler methodHandler = new MethodHandler(methodKey,
165                                            classNameValue);
166    
167                            try {
168                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
169                            }
170                            catch (Exception e) {
171                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
172                            }
173                    }
174                    catch (com.liferay.portal.kernel.exception.SystemException se) {
175                            _log.error(se, se);
176    
177                            throw se;
178                    }
179            }
180    
181            public static void testAddClassNameAndTestTransactionPortletBar_PortalRollback(
182                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText) {
183                    try {
184                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
185                                            "testAddClassNameAndTestTransactionPortletBar_PortalRollback",
186                                            _testAddClassNameAndTestTransactionPortletBar_PortalRollbackParameterTypes5);
187    
188                            MethodHandler methodHandler = new MethodHandler(methodKey,
189                                            transactionPortletBarText);
190    
191                            try {
192                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
193                            }
194                            catch (Exception e) {
195                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
196                            }
197                    }
198                    catch (com.liferay.portal.kernel.exception.SystemException se) {
199                            _log.error(se, se);
200    
201                            throw se;
202                    }
203            }
204    
205            public static void testAddClassNameAndTestTransactionPortletBar_PortletRollback(
206                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText) {
207                    try {
208                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
209                                            "testAddClassNameAndTestTransactionPortletBar_PortletRollback",
210                                            _testAddClassNameAndTestTransactionPortletBar_PortletRollbackParameterTypes6);
211    
212                            MethodHandler methodHandler = new MethodHandler(methodKey,
213                                            transactionPortletBarText);
214    
215                            try {
216                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
217                            }
218                            catch (Exception e) {
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                    try {
232                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
233                                            "testAddClassNameAndTestTransactionPortletBar_Success",
234                                            _testAddClassNameAndTestTransactionPortletBar_SuccessParameterTypes7);
235    
236                            MethodHandler methodHandler = new MethodHandler(methodKey,
237                                            transactionPortletBarText);
238    
239                            try {
240                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
241                            }
242                            catch (Exception e) {
243                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
244                            }
245                    }
246                    catch (com.liferay.portal.kernel.exception.SystemException se) {
247                            _log.error(se, se);
248    
249                            throw se;
250                    }
251            }
252    
253            public static void testAutoSyncHibernateSessionStateOnTxCreation(
254                    HttpPrincipal httpPrincipal) {
255                    try {
256                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
257                                            "testAutoSyncHibernateSessionStateOnTxCreation",
258                                            _testAutoSyncHibernateSessionStateOnTxCreationParameterTypes8);
259    
260                            MethodHandler methodHandler = new MethodHandler(methodKey);
261    
262                            try {
263                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
264                            }
265                            catch (Exception e) {
266                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
267                            }
268                    }
269                    catch (com.liferay.portal.kernel.exception.SystemException se) {
270                            _log.error(se, se);
271    
272                            throw se;
273                    }
274            }
275    
276            public static void testDeleteClassName(HttpPrincipal httpPrincipal)
277                    throws com.liferay.portal.kernel.exception.PortalException {
278                    try {
279                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
280                                            "testDeleteClassName", _testDeleteClassNameParameterTypes9);
281    
282                            MethodHandler methodHandler = new MethodHandler(methodKey);
283    
284                            try {
285                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
286                            }
287                            catch (Exception e) {
288                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
289                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
290                                    }
291    
292                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
293                            }
294                    }
295                    catch (com.liferay.portal.kernel.exception.SystemException se) {
296                            _log.error(se, se);
297    
298                            throw se;
299                    }
300            }
301    
302            public static int testGetBuildNumber(HttpPrincipal httpPrincipal) {
303                    try {
304                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
305                                            "testGetBuildNumber", _testGetBuildNumberParameterTypes10);
306    
307                            MethodHandler methodHandler = new MethodHandler(methodKey);
308    
309                            Object returnObj = null;
310    
311                            try {
312                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
313                            }
314                            catch (Exception e) {
315                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
316                            }
317    
318                            return ((Integer)returnObj).intValue();
319                    }
320                    catch (com.liferay.portal.kernel.exception.SystemException se) {
321                            _log.error(se, se);
322    
323                            throw se;
324                    }
325            }
326    
327            public static void testGetUserId(HttpPrincipal httpPrincipal) {
328                    try {
329                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
330                                            "testGetUserId", _testGetUserIdParameterTypes11);
331    
332                            MethodHandler methodHandler = new MethodHandler(methodKey);
333    
334                            try {
335                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
336                            }
337                            catch (Exception e) {
338                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
339                            }
340                    }
341                    catch (com.liferay.portal.kernel.exception.SystemException se) {
342                            _log.error(se, se);
343    
344                            throw se;
345                    }
346            }
347    
348            public static boolean testHasClassName(HttpPrincipal httpPrincipal) {
349                    try {
350                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
351                                            "testHasClassName", _testHasClassNameParameterTypes12);
352    
353                            MethodHandler methodHandler = new MethodHandler(methodKey);
354    
355                            Object returnObj = null;
356    
357                            try {
358                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
359                            }
360                            catch (Exception e) {
361                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
362                            }
363    
364                            return ((Boolean)returnObj).booleanValue();
365                    }
366                    catch (com.liferay.portal.kernel.exception.SystemException se) {
367                            _log.error(se, se);
368    
369                            throw se;
370                    }
371            }
372    
373            private static Log _log = LogFactoryUtil.getLog(PortalServiceHttp.class);
374            private static final Class<?>[] _getAutoDeployDirectoryParameterTypes0 = new Class[] {
375                            
376                    };
377            private static final Class<?>[] _getBuildNumberParameterTypes1 = new Class[] {
378                            
379                    };
380            private static final Class<?>[] _getVersionParameterTypes2 = new Class[] {  };
381            private static final Class<?>[] _testAddClassName_RollbackParameterTypes3 = new Class[] {
382                            java.lang.String.class
383                    };
384            private static final Class<?>[] _testAddClassName_SuccessParameterTypes4 = new Class[] {
385                            java.lang.String.class
386                    };
387            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortalRollbackParameterTypes5 =
388                    new Class[] { java.lang.String.class };
389            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortletRollbackParameterTypes6 =
390                    new Class[] { java.lang.String.class };
391            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_SuccessParameterTypes7 =
392                    new Class[] { java.lang.String.class };
393            private static final Class<?>[] _testAutoSyncHibernateSessionStateOnTxCreationParameterTypes8 =
394                    new Class[] {  };
395            private static final Class<?>[] _testDeleteClassNameParameterTypes9 = new Class[] {
396                            
397                    };
398            private static final Class<?>[] _testGetBuildNumberParameterTypes10 = new Class[] {
399                            
400                    };
401            private static final Class<?>[] _testGetUserIdParameterTypes11 = new Class[] {
402                            
403                    };
404            private static final Class<?>[] _testHasClassNameParameterTypes12 = new Class[] {
405                            
406                    };
407    }