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