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.MDRActionServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.mobiledevicerules.service.MDRActionServiceUtil} 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       MDRActionServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.mobiledevicerules.service.MDRActionServiceUtil
054     * @generated
055     */
056    public class MDRActionServiceHttp {
057            public static com.liferay.portlet.mobiledevicerules.model.MDRAction addAction(
058                    HttpPrincipal httpPrincipal, long ruleGroupInstanceId,
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(MDRActionServiceUtil.class.getName(),
067                                            "addAction", _addActionParameterTypes0);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey,
070                                            ruleGroupInstanceId, nameMap, descriptionMap, type,
071                                            typeSettings, 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.MDRAction)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.MDRAction addAction(
100                    HttpPrincipal httpPrincipal, long ruleGroupInstanceId,
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 typeSettingsProperties,
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(MDRActionServiceUtil.class.getName(),
110                                            "addAction", _addActionParameterTypes1);
111    
112                            MethodHandler methodHandler = new MethodHandler(methodKey,
113                                            ruleGroupInstanceId, nameMap, descriptionMap, type,
114                                            typeSettingsProperties, 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.MDRAction)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 deleteAction(HttpPrincipal httpPrincipal, long actionId)
143                    throws com.liferay.portal.kernel.exception.PortalException,
144                            com.liferay.portal.kernel.exception.SystemException {
145                    try {
146                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class.getName(),
147                                            "deleteAction", _deleteActionParameterTypes2);
148    
149                            MethodHandler methodHandler = new MethodHandler(methodKey, actionId);
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.MDRAction fetchAction(
174                    HttpPrincipal httpPrincipal, long actionId)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    try {
178                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class.getName(),
179                                            "fetchAction", _fetchActionParameterTypes3);
180    
181                            MethodHandler methodHandler = new MethodHandler(methodKey, actionId);
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.MDRAction)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.MDRAction getAction(
210                    HttpPrincipal httpPrincipal, long actionId)
211                    throws com.liferay.portal.kernel.exception.PortalException,
212                            com.liferay.portal.kernel.exception.SystemException {
213                    try {
214                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class.getName(),
215                                            "getAction", _getActionParameterTypes4);
216    
217                            MethodHandler methodHandler = new MethodHandler(methodKey, actionId);
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.MDRAction)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.MDRAction updateAction(
246                    HttpPrincipal httpPrincipal, long actionId,
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(MDRActionServiceUtil.class.getName(),
255                                            "updateAction", _updateActionParameterTypes5);
256    
257                            MethodHandler methodHandler = new MethodHandler(methodKey,
258                                            actionId, nameMap, descriptionMap, type, typeSettings,
259                                            serviceContext);
260    
261                            Object returnObj = null;
262    
263                            try {
264                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
265                            }
266                            catch (Exception e) {
267                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
268                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
269                                    }
270    
271                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
272                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
273                                    }
274    
275                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
276                            }
277    
278                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
279                    }
280                    catch (com.liferay.portal.kernel.exception.SystemException se) {
281                            _log.error(se, se);
282    
283                            throw se;
284                    }
285            }
286    
287            public static com.liferay.portlet.mobiledevicerules.model.MDRAction updateAction(
288                    HttpPrincipal httpPrincipal, long actionId,
289                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
290                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
291                    java.lang.String type,
292                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties,
293                    com.liferay.portal.service.ServiceContext serviceContext)
294                    throws com.liferay.portal.kernel.exception.PortalException,
295                            com.liferay.portal.kernel.exception.SystemException {
296                    try {
297                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class.getName(),
298                                            "updateAction", _updateActionParameterTypes6);
299    
300                            MethodHandler methodHandler = new MethodHandler(methodKey,
301                                            actionId, nameMap, descriptionMap, type,
302                                            typeSettingsProperties, serviceContext);
303    
304                            Object returnObj = null;
305    
306                            try {
307                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
308                            }
309                            catch (Exception e) {
310                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
311                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
312                                    }
313    
314                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
315                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
316                                    }
317    
318                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
319                            }
320    
321                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
322                    }
323                    catch (com.liferay.portal.kernel.exception.SystemException se) {
324                            _log.error(se, se);
325    
326                            throw se;
327                    }
328            }
329    
330            private static Log _log = LogFactoryUtil.getLog(MDRActionServiceHttp.class);
331            private static final Class<?>[] _addActionParameterTypes0 = new Class[] {
332                            long.class, java.util.Map.class, java.util.Map.class,
333                            java.lang.String.class, java.lang.String.class,
334                            com.liferay.portal.service.ServiceContext.class
335                    };
336            private static final Class<?>[] _addActionParameterTypes1 = new Class[] {
337                            long.class, java.util.Map.class, java.util.Map.class,
338                            java.lang.String.class,
339                            com.liferay.portal.kernel.util.UnicodeProperties.class,
340                            com.liferay.portal.service.ServiceContext.class
341                    };
342            private static final Class<?>[] _deleteActionParameterTypes2 = new Class[] {
343                            long.class
344                    };
345            private static final Class<?>[] _fetchActionParameterTypes3 = new Class[] {
346                            long.class
347                    };
348            private static final Class<?>[] _getActionParameterTypes4 = new Class[] {
349                            long.class
350                    };
351            private static final Class<?>[] _updateActionParameterTypes5 = new Class[] {
352                            long.class, java.util.Map.class, java.util.Map.class,
353                            java.lang.String.class, java.lang.String.class,
354                            com.liferay.portal.service.ServiceContext.class
355                    };
356            private static final Class<?>[] _updateActionParameterTypes6 = new Class[] {
357                            long.class, java.util.Map.class, java.util.Map.class,
358                            java.lang.String.class,
359                            com.liferay.portal.kernel.util.UnicodeProperties.class,
360                            com.liferay.portal.service.ServiceContext.class
361                    };
362    }