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