001    /**
002     * Copyright (c) 2000-2012 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.getName(),
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.getName(),
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.getName(),
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.getName(),
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.getName(),
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.getName(),
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.getName(),
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 testCounterIncrement_Rollback(
259                    HttpPrincipal httpPrincipal)
260                    throws com.liferay.portal.kernel.exception.SystemException {
261                    try {
262                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class.getName(),
263                                            "testCounterIncrement_Rollback",
264                                            _testCounterIncrement_RollbackParameterTypes7);
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 testDeleteClassName(HttpPrincipal httpPrincipal)
287                    throws com.liferay.portal.kernel.exception.PortalException,
288                            com.liferay.portal.kernel.exception.SystemException {
289                    try {
290                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class.getName(),
291                                            "testDeleteClassName", _testDeleteClassNameParameterTypes8);
292    
293                            MethodHandler methodHandler = new MethodHandler(methodKey);
294    
295                            try {
296                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
297                            }
298                            catch (Exception e) {
299                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
300                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
301                                    }
302    
303                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
304                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
305                                    }
306    
307                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
308                            }
309                    }
310                    catch (com.liferay.portal.kernel.exception.SystemException se) {
311                            _log.error(se, se);
312    
313                            throw se;
314                    }
315            }
316    
317            public static void testGetUserId(HttpPrincipal httpPrincipal)
318                    throws com.liferay.portal.kernel.exception.SystemException {
319                    try {
320                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class.getName(),
321                                            "testGetUserId", _testGetUserIdParameterTypes9);
322    
323                            MethodHandler methodHandler = new MethodHandler(methodKey);
324    
325                            try {
326                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
327                            }
328                            catch (Exception e) {
329                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
330                            }
331                    }
332                    catch (com.liferay.portal.kernel.exception.SystemException se) {
333                            _log.error(se, se);
334    
335                            throw se;
336                    }
337            }
338    
339            public static boolean testHasClassName(HttpPrincipal httpPrincipal)
340                    throws com.liferay.portal.kernel.exception.SystemException {
341                    try {
342                            MethodKey methodKey = new MethodKey(PortalServiceUtil.class.getName(),
343                                            "testHasClassName", _testHasClassNameParameterTypes10);
344    
345                            MethodHandler methodHandler = new MethodHandler(methodKey);
346    
347                            Object returnObj = null;
348    
349                            try {
350                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
351                            }
352                            catch (Exception e) {
353                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
354                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
355                                    }
356    
357                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
358                            }
359    
360                            return ((Boolean)returnObj).booleanValue();
361                    }
362                    catch (com.liferay.portal.kernel.exception.SystemException se) {
363                            _log.error(se, se);
364    
365                            throw se;
366                    }
367            }
368    
369            private static Log _log = LogFactoryUtil.getLog(PortalServiceHttp.class);
370            private static final Class<?>[] _getAutoDeployDirectoryParameterTypes0 = new Class[] {
371                            
372                    };
373            private static final Class<?>[] _getBuildNumberParameterTypes1 = new Class[] {
374                            
375                    };
376            private static final Class<?>[] _testAddClassName_RollbackParameterTypes2 = new Class[] {
377                            java.lang.String.class
378                    };
379            private static final Class<?>[] _testAddClassName_SuccessParameterTypes3 = new Class[] {
380                            java.lang.String.class
381                    };
382            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortalRollbackParameterTypes4 =
383                    new Class[] { java.lang.String.class };
384            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_PortletRollbackParameterTypes5 =
385                    new Class[] { java.lang.String.class };
386            private static final Class<?>[] _testAddClassNameAndTestTransactionPortletBar_SuccessParameterTypes6 =
387                    new Class[] { java.lang.String.class };
388            private static final Class<?>[] _testCounterIncrement_RollbackParameterTypes7 =
389                    new Class[] {  };
390            private static final Class<?>[] _testDeleteClassNameParameterTypes8 = new Class[] {
391                            
392                    };
393            private static final Class<?>[] _testGetUserIdParameterTypes9 = new Class[] {  };
394            private static final Class<?>[] _testHasClassNameParameterTypes10 = new Class[] {
395                            
396                    };
397    }