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 com.liferay.portal.service.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 com.liferay.portal.security.auth.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 com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portal.service.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 void testAddClassName_Rollback(HttpPrincipal httpPrincipal,
109                    java.lang.String classNameValue) {
110                    try {
111                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
112                                            "testAddClassName_Rollback",
113                                            _testAddClassName_RollbackParameterTypes2);
114    
115                            MethodHandler methodHandler = new MethodHandler(methodKey,
116                                            classNameValue);
117    
118                            try {
119                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
120                            }
121                            catch (Exception e) {
122                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
123                            }
124                    }
125                    catch (com.liferay.portal.kernel.exception.SystemException se) {
126                            _log.error(se, se);
127    
128                            throw se;
129                    }
130            }
131    
132            public static void testAddClassName_Success(HttpPrincipal httpPrincipal,
133                    java.lang.String classNameValue) {
134                    try {
135                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
136                                            "testAddClassName_Success",
137                                            _testAddClassName_SuccessParameterTypes3);
138    
139                            MethodHandler methodHandler = new MethodHandler(methodKey,
140                                            classNameValue);
141    
142                            try {
143                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
144                            }
145                            catch (Exception e) {
146                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
147                            }
148                    }
149                    catch (com.liferay.portal.kernel.exception.SystemException se) {
150                            _log.error(se, se);
151    
152                            throw se;
153                    }
154            }
155    
156            public static void testAddClassNameAndTestTransactionPortletBar_PortalRollback(
157                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText) {
158                    try {
159                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
160                                            "testAddClassNameAndTestTransactionPortletBar_PortalRollback",
161                                            _testAddClassNameAndTestTransactionPortletBar_PortalRollbackParameterTypes4);
162    
163                            MethodHandler methodHandler = new MethodHandler(methodKey,
164                                            transactionPortletBarText);
165    
166                            try {
167                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
168                            }
169                            catch (Exception e) {
170                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
171                            }
172                    }
173                    catch (com.liferay.portal.kernel.exception.SystemException se) {
174                            _log.error(se, se);
175    
176                            throw se;
177                    }
178            }
179    
180            public static void testAddClassNameAndTestTransactionPortletBar_PortletRollback(
181                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText) {
182                    try {
183                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
184                                            "testAddClassNameAndTestTransactionPortletBar_PortletRollback",
185                                            _testAddClassNameAndTestTransactionPortletBar_PortletRollbackParameterTypes5);
186    
187                            MethodHandler methodHandler = new MethodHandler(methodKey,
188                                            transactionPortletBarText);
189    
190                            try {
191                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
192                            }
193                            catch (Exception e) {
194                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
195                            }
196                    }
197                    catch (com.liferay.portal.kernel.exception.SystemException se) {
198                            _log.error(se, se);
199    
200                            throw se;
201                    }
202            }
203    
204            public static void testAddClassNameAndTestTransactionPortletBar_Success(
205                    HttpPrincipal httpPrincipal, java.lang.String transactionPortletBarText) {
206                    try {
207                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
208                                            "testAddClassNameAndTestTransactionPortletBar_Success",
209                                            _testAddClassNameAndTestTransactionPortletBar_SuccessParameterTypes6);
210    
211                            MethodHandler methodHandler = new MethodHandler(methodKey,
212                                            transactionPortletBarText);
213    
214                            try {
215                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
216                            }
217                            catch (Exception e) {
218                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
219                            }
220                    }
221                    catch (com.liferay.portal.kernel.exception.SystemException se) {
222                            _log.error(se, se);
223    
224                            throw se;
225                    }
226            }
227    
228            public static void testAutoSyncHibernateSessionStateOnTxCreation(
229                    HttpPrincipal httpPrincipal) {
230                    try {
231                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
232                                            "testAutoSyncHibernateSessionStateOnTxCreation",
233                                            _testAutoSyncHibernateSessionStateOnTxCreationParameterTypes7);
234    
235                            MethodHandler methodHandler = new MethodHandler(methodKey);
236    
237                            try {
238                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
239                            }
240                            catch (Exception e) {
241                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
242                            }
243                    }
244                    catch (com.liferay.portal.kernel.exception.SystemException se) {
245                            _log.error(se, se);
246    
247                            throw se;
248                    }
249            }
250    
251            public static void testDeleteClassName(HttpPrincipal httpPrincipal)
252                    throws com.liferay.portal.kernel.exception.PortalException {
253                    try {
254                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
255                                            "testDeleteClassName", _testDeleteClassNameParameterTypes8);
256    
257                            MethodHandler methodHandler = new MethodHandler(methodKey);
258    
259                            try {
260                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
261                            }
262                            catch (Exception e) {
263                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
264                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
265                                    }
266    
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 int testGetBuildNumber(HttpPrincipal httpPrincipal) {
278                    try {
279                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
280                                            "testGetBuildNumber", _testGetBuildNumberParameterTypes9);
281    
282                            MethodHandler methodHandler = new MethodHandler(methodKey);
283    
284                            Object returnObj = null;
285    
286                            try {
287                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
288                            }
289                            catch (Exception e) {
290                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
291                            }
292    
293                            return ((Integer)returnObj).intValue();
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 void testGetUserId(HttpPrincipal httpPrincipal) {
303                    try {
304                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
305                                            "testGetUserId", _testGetUserIdParameterTypes10);
306    
307                            MethodHandler methodHandler = new MethodHandler(methodKey);
308    
309                            try {
310                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
311                            }
312                            catch (Exception e) {
313                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
314                            }
315                    }
316                    catch (com.liferay.portal.kernel.exception.SystemException se) {
317                            _log.error(se, se);
318    
319                            throw se;
320                    }
321            }
322    
323            public static boolean testHasClassName(HttpPrincipal httpPrincipal) {
324                    try {
325                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class,
326                                            "testHasClassName", _testHasClassNameParameterTypes11);
327    
328                            MethodHandler methodHandler = new MethodHandler(methodKey);
329    
330                            Object returnObj = null;
331    
332                            try {
333                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
334                            }
335                            catch (Exception e) {
336                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
337                            }
338    
339                            return ((Boolean)returnObj).booleanValue();
340                    }
341                    catch (com.liferay.portal.kernel.exception.SystemException se) {
342                            _log.error(se, se);
343    
344                            throw se;
345                    }
346            }
347    
348            private static Log _log = LogFactoryUtil.getLog(PortalServiceHttp.class);
349            private static final Class<?>[] _getAutoDeployDirectoryParameterTypes0 = new Class[] {
350                            
351                    };
352            private static final Class<?>[] _getBuildNumberParameterTypes1 = new Class[] {
353                            
354                    };
355            private static final Class<?>[] _testAddClassName_RollbackParameterTypes2 = new Class[] {
356                            java.lang.String.class
357                    };
358            private static final Class<?>[] _testAddClassName_SuccessParameterTypes3 = new Class[] {
359                            java.lang.String.class
360                    };
361            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortalRollbackParameterTypes4 =
362                    new Class[] { java.lang.String.class };
363            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortletRollbackParameterTypes5 =
364                    new Class[] { java.lang.String.class };
365            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_SuccessParameterTypes6 =
366                    new Class[] { java.lang.String.class };
367            private static final Class<?>[] _testAutoSyncHibernateSessionStateOnTxCreationParameterTypes7 =
368                    new Class[] {  };
369            private static final Class<?>[] _testDeleteClassNameParameterTypes8 = new Class[] {
370                            
371                    };
372            private static final Class<?>[] _testGetBuildNumberParameterTypes9 = new Class[] {
373                            
374                    };
375            private static final Class<?>[] _testGetUserIdParameterTypes10 = new Class[] {
376                            
377                    };
378            private static final Class<?>[] _testHasClassNameParameterTypes11 = new Class[] {
379                            
380                    };
381    }