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