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.portlet.mobiledevicerules.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.http.TunnelUtil;
023    
024    import com.liferay.portlet.mobiledevicerules.service.MDRRuleServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleServiceUtil} 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 com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author    Edward C. Han
051     * @see       MDRRuleServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.mobiledevicerules.service.MDRRuleServiceUtil
054     * @generated
055     */
056    public class MDRRuleServiceHttp {
057            public static com.liferay.portlet.mobiledevicerules.model.MDRRule addRule(
058                    HttpPrincipal httpPrincipal, long ruleGroupId,
059                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
060                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
061                    java.lang.String type, java.lang.String typeSettings,
062                    com.liferay.portal.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    try {
066                            MethodKey methodKey = new MethodKey(MDRRuleServiceUtil.class.getName(),
067                                            "addRule", _addRuleParameterTypes0);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey,
070                                            ruleGroupId, nameMap, descriptionMap, type, typeSettings,
071                                            serviceContext);
072    
073                            Object returnObj = null;
074    
075                            try {
076                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
077                            }
078                            catch (Exception e) {
079                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
080                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
081                                    }
082    
083                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
084                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
085                                    }
086    
087                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
088                            }
089    
090                            return (com.liferay.portlet.mobiledevicerules.model.MDRRule)returnObj;
091                    }
092                    catch (com.liferay.portal.kernel.exception.SystemException se) {
093                            _log.error(se, se);
094    
095                            throw se;
096                    }
097            }
098    
099            public static com.liferay.portlet.mobiledevicerules.model.MDRRule addRule(
100                    HttpPrincipal httpPrincipal, long ruleGroupId,
101                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
102                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
103                    java.lang.String type,
104                    com.liferay.portal.kernel.util.UnicodeProperties typeSettings,
105                    com.liferay.portal.service.ServiceContext serviceContext)
106                    throws com.liferay.portal.kernel.exception.PortalException,
107                            com.liferay.portal.kernel.exception.SystemException {
108                    try {
109                            MethodKey methodKey = new MethodKey(MDRRuleServiceUtil.class.getName(),
110                                            "addRule", _addRuleParameterTypes1);
111    
112                            MethodHandler methodHandler = new MethodHandler(methodKey,
113                                            ruleGroupId, nameMap, descriptionMap, type, typeSettings,
114                                            serviceContext);
115    
116                            Object returnObj = null;
117    
118                            try {
119                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
120                            }
121                            catch (Exception e) {
122                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
123                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
124                                    }
125    
126                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
127                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
128                                    }
129    
130                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
131                            }
132    
133                            return (com.liferay.portlet.mobiledevicerules.model.MDRRule)returnObj;
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 deleteRule(HttpPrincipal httpPrincipal, long ruleId)
143                    throws com.liferay.portal.kernel.exception.PortalException,
144                            com.liferay.portal.kernel.exception.SystemException {
145                    try {
146                            MethodKey methodKey = new MethodKey(MDRRuleServiceUtil.class.getName(),
147                                            "deleteRule", _deleteRuleParameterTypes2);
148    
149                            MethodHandler methodHandler = new MethodHandler(methodKey, ruleId);
150    
151                            try {
152                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
153                            }
154                            catch (Exception e) {
155                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
156                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
157                                    }
158    
159                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
160                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
161                                    }
162    
163                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
164                            }
165                    }
166                    catch (com.liferay.portal.kernel.exception.SystemException se) {
167                            _log.error(se, se);
168    
169                            throw se;
170                    }
171            }
172    
173            public static com.liferay.portlet.mobiledevicerules.model.MDRRule fetchRule(
174                    HttpPrincipal httpPrincipal, long ruleId)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    try {
178                            MethodKey methodKey = new MethodKey(MDRRuleServiceUtil.class.getName(),
179                                            "fetchRule", _fetchRuleParameterTypes3);
180    
181                            MethodHandler methodHandler = new MethodHandler(methodKey, ruleId);
182    
183                            Object returnObj = null;
184    
185                            try {
186                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
187                            }
188                            catch (Exception e) {
189                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
190                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
191                                    }
192    
193                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
194                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
195                                    }
196    
197                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
198                            }
199    
200                            return (com.liferay.portlet.mobiledevicerules.model.MDRRule)returnObj;
201                    }
202                    catch (com.liferay.portal.kernel.exception.SystemException se) {
203                            _log.error(se, se);
204    
205                            throw se;
206                    }
207            }
208    
209            public static com.liferay.portlet.mobiledevicerules.model.MDRRule getRule(
210                    HttpPrincipal httpPrincipal, long ruleId)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    try {
214                            MethodKey methodKey = new MethodKey(MDRRuleServiceUtil.class.getName(),
215                                            "getRule", _getRuleParameterTypes4);
216    
217                            MethodHandler methodHandler = new MethodHandler(methodKey, ruleId);
218    
219                            Object returnObj = null;
220    
221                            try {
222                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
223                            }
224                            catch (Exception e) {
225                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
226                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
227                                    }
228    
229                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
230                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
231                                    }
232    
233                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
234                            }
235    
236                            return (com.liferay.portlet.mobiledevicerules.model.MDRRule)returnObj;
237                    }
238                    catch (com.liferay.portal.kernel.exception.SystemException se) {
239                            _log.error(se, se);
240    
241                            throw se;
242                    }
243            }
244    
245            public static com.liferay.portlet.mobiledevicerules.model.MDRRule updateRule(
246                    HttpPrincipal httpPrincipal, long ruleId,
247                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
248                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
249                    java.lang.String type, java.lang.String typeSettings,
250                    com.liferay.portal.service.ServiceContext serviceContext)
251                    throws com.liferay.portal.kernel.exception.PortalException,
252                            com.liferay.portal.kernel.exception.SystemException {
253                    try {
254                            MethodKey methodKey = new MethodKey(MDRRuleServiceUtil.class.getName(),
255                                            "updateRule", _updateRuleParameterTypes5);
256    
257                            MethodHandler methodHandler = new MethodHandler(methodKey, ruleId,
258                                            nameMap, descriptionMap, type, typeSettings, serviceContext);
259    
260                            Object returnObj = null;
261    
262                            try {
263                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
264                            }
265                            catch (Exception e) {
266                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
267                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
268                                    }
269    
270                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
271                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
272                                    }
273    
274                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
275                            }
276    
277                            return (com.liferay.portlet.mobiledevicerules.model.MDRRule)returnObj;
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 com.liferay.portlet.mobiledevicerules.model.MDRRule updateRule(
287                    HttpPrincipal httpPrincipal, long ruleId,
288                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
289                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
290                    java.lang.String type,
291                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties,
292                    com.liferay.portal.service.ServiceContext serviceContext)
293                    throws com.liferay.portal.kernel.exception.PortalException,
294                            com.liferay.portal.kernel.exception.SystemException {
295                    try {
296                            MethodKey methodKey = new MethodKey(MDRRuleServiceUtil.class.getName(),
297                                            "updateRule", _updateRuleParameterTypes6);
298    
299                            MethodHandler methodHandler = new MethodHandler(methodKey, ruleId,
300                                            nameMap, descriptionMap, type, typeSettingsProperties,
301                                            serviceContext);
302    
303                            Object returnObj = null;
304    
305                            try {
306                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
307                            }
308                            catch (Exception e) {
309                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
310                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
311                                    }
312    
313                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
314                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
315                                    }
316    
317                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
318                            }
319    
320                            return (com.liferay.portlet.mobiledevicerules.model.MDRRule)returnObj;
321                    }
322                    catch (com.liferay.portal.kernel.exception.SystemException se) {
323                            _log.error(se, se);
324    
325                            throw se;
326                    }
327            }
328    
329            private static Log _log = LogFactoryUtil.getLog(MDRRuleServiceHttp.class);
330            private static final Class<?>[] _addRuleParameterTypes0 = new Class[] {
331                            long.class, java.util.Map.class, java.util.Map.class,
332                            java.lang.String.class, java.lang.String.class,
333                            com.liferay.portal.service.ServiceContext.class
334                    };
335            private static final Class<?>[] _addRuleParameterTypes1 = new Class[] {
336                            long.class, java.util.Map.class, java.util.Map.class,
337                            java.lang.String.class,
338                            com.liferay.portal.kernel.util.UnicodeProperties.class,
339                            com.liferay.portal.service.ServiceContext.class
340                    };
341            private static final Class<?>[] _deleteRuleParameterTypes2 = new Class[] {
342                            long.class
343                    };
344            private static final Class<?>[] _fetchRuleParameterTypes3 = new Class[] {
345                            long.class
346                    };
347            private static final Class<?>[] _getRuleParameterTypes4 = new Class[] {
348                            long.class
349                    };
350            private static final Class<?>[] _updateRuleParameterTypes5 = new Class[] {
351                            long.class, java.util.Map.class, java.util.Map.class,
352                            java.lang.String.class, java.lang.String.class,
353                            com.liferay.portal.service.ServiceContext.class
354                    };
355            private static final Class<?>[] _updateRuleParameterTypes6 = new Class[] {
356                            long.class, java.util.Map.class, java.util.Map.class,
357                            java.lang.String.class,
358                            com.liferay.portal.kernel.util.UnicodeProperties.class,
359                            com.liferay.portal.service.ServiceContext.class
360                    };
361    }