001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.mobiledevicerules.service.MDRActionServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link MDRActionServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link HttpPrincipal} parameter.
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 HttpPrincipal
053     * @see MDRActionServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class MDRActionServiceHttp {
058            public static com.liferay.portlet.mobiledevicerules.model.MDRAction addAction(
059                    HttpPrincipal httpPrincipal, long ruleGroupInstanceId,
060                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
061                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
062                    java.lang.String type, java.lang.String typeSettings,
063                    com.liferay.portal.service.ServiceContext serviceContext)
064                    throws com.liferay.portal.kernel.exception.PortalException {
065                    try {
066                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class,
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
084                            }
085    
086                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
087                    }
088                    catch (com.liferay.portal.kernel.exception.SystemException se) {
089                            _log.error(se, se);
090    
091                            throw se;
092                    }
093            }
094    
095            public static com.liferay.portlet.mobiledevicerules.model.MDRAction addAction(
096                    HttpPrincipal httpPrincipal, long ruleGroupInstanceId,
097                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
098                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
099                    java.lang.String type,
100                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties,
101                    com.liferay.portal.service.ServiceContext serviceContext)
102                    throws com.liferay.portal.kernel.exception.PortalException {
103                    try {
104                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class,
105                                            "addAction", _addActionParameterTypes1);
106    
107                            MethodHandler methodHandler = new MethodHandler(methodKey,
108                                            ruleGroupInstanceId, nameMap, descriptionMap, type,
109                                            typeSettingsProperties, serviceContext);
110    
111                            Object returnObj = null;
112    
113                            try {
114                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
115                            }
116                            catch (Exception e) {
117                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
118                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
119                                    }
120    
121                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
122                            }
123    
124                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
125                    }
126                    catch (com.liferay.portal.kernel.exception.SystemException se) {
127                            _log.error(se, se);
128    
129                            throw se;
130                    }
131            }
132    
133            public static void deleteAction(HttpPrincipal httpPrincipal, long actionId)
134                    throws com.liferay.portal.kernel.exception.PortalException {
135                    try {
136                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class,
137                                            "deleteAction", _deleteActionParameterTypes2);
138    
139                            MethodHandler methodHandler = new MethodHandler(methodKey, actionId);
140    
141                            try {
142                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
143                            }
144                            catch (Exception e) {
145                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
146                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
147                                    }
148    
149                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
150                            }
151                    }
152                    catch (com.liferay.portal.kernel.exception.SystemException se) {
153                            _log.error(se, se);
154    
155                            throw se;
156                    }
157            }
158    
159            public static com.liferay.portlet.mobiledevicerules.model.MDRAction fetchAction(
160                    HttpPrincipal httpPrincipal, long actionId)
161                    throws com.liferay.portal.kernel.exception.PortalException {
162                    try {
163                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class,
164                                            "fetchAction", _fetchActionParameterTypes3);
165    
166                            MethodHandler methodHandler = new MethodHandler(methodKey, actionId);
167    
168                            Object returnObj = null;
169    
170                            try {
171                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
172                            }
173                            catch (Exception e) {
174                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
175                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
176                                    }
177    
178                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
179                            }
180    
181                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
182                    }
183                    catch (com.liferay.portal.kernel.exception.SystemException se) {
184                            _log.error(se, se);
185    
186                            throw se;
187                    }
188            }
189    
190            public static com.liferay.portlet.mobiledevicerules.model.MDRAction getAction(
191                    HttpPrincipal httpPrincipal, long actionId)
192                    throws com.liferay.portal.kernel.exception.PortalException {
193                    try {
194                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class,
195                                            "getAction", _getActionParameterTypes4);
196    
197                            MethodHandler methodHandler = new MethodHandler(methodKey, actionId);
198    
199                            Object returnObj = null;
200    
201                            try {
202                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
203                            }
204                            catch (Exception e) {
205                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
206                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
207                                    }
208    
209                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
210                            }
211    
212                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
213                    }
214                    catch (com.liferay.portal.kernel.exception.SystemException se) {
215                            _log.error(se, se);
216    
217                            throw se;
218                    }
219            }
220    
221            public static com.liferay.portlet.mobiledevicerules.model.MDRAction updateAction(
222                    HttpPrincipal httpPrincipal, long actionId,
223                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
224                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
225                    java.lang.String type, java.lang.String typeSettings,
226                    com.liferay.portal.service.ServiceContext serviceContext)
227                    throws com.liferay.portal.kernel.exception.PortalException {
228                    try {
229                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class,
230                                            "updateAction", _updateActionParameterTypes5);
231    
232                            MethodHandler methodHandler = new MethodHandler(methodKey,
233                                            actionId, nameMap, descriptionMap, type, typeSettings,
234                                            serviceContext);
235    
236                            Object returnObj = null;
237    
238                            try {
239                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
240                            }
241                            catch (Exception e) {
242                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
243                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
244                                    }
245    
246                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
247                            }
248    
249                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
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 com.liferay.portlet.mobiledevicerules.model.MDRAction updateAction(
259                    HttpPrincipal httpPrincipal, long actionId,
260                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
261                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
262                    java.lang.String type,
263                    com.liferay.portal.kernel.util.UnicodeProperties typeSettingsProperties,
264                    com.liferay.portal.service.ServiceContext serviceContext)
265                    throws com.liferay.portal.kernel.exception.PortalException {
266                    try {
267                            MethodKey methodKey = new MethodKey(MDRActionServiceUtil.class,
268                                            "updateAction", _updateActionParameterTypes6);
269    
270                            MethodHandler methodHandler = new MethodHandler(methodKey,
271                                            actionId, nameMap, descriptionMap, type,
272                                            typeSettingsProperties, serviceContext);
273    
274                            Object returnObj = null;
275    
276                            try {
277                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
278                            }
279                            catch (Exception e) {
280                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
281                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
282                                    }
283    
284                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
285                            }
286    
287                            return (com.liferay.portlet.mobiledevicerules.model.MDRAction)returnObj;
288                    }
289                    catch (com.liferay.portal.kernel.exception.SystemException se) {
290                            _log.error(se, se);
291    
292                            throw se;
293                    }
294            }
295    
296            private static Log _log = LogFactoryUtil.getLog(MDRActionServiceHttp.class);
297            private static final Class<?>[] _addActionParameterTypes0 = new Class[] {
298                            long.class, java.util.Map.class, java.util.Map.class,
299                            java.lang.String.class, java.lang.String.class,
300                            com.liferay.portal.service.ServiceContext.class
301                    };
302            private static final Class<?>[] _addActionParameterTypes1 = new Class[] {
303                            long.class, java.util.Map.class, java.util.Map.class,
304                            java.lang.String.class,
305                            com.liferay.portal.kernel.util.UnicodeProperties.class,
306                            com.liferay.portal.service.ServiceContext.class
307                    };
308            private static final Class<?>[] _deleteActionParameterTypes2 = new Class[] {
309                            long.class
310                    };
311            private static final Class<?>[] _fetchActionParameterTypes3 = new Class[] {
312                            long.class
313                    };
314            private static final Class<?>[] _getActionParameterTypes4 = new Class[] {
315                            long.class
316                    };
317            private static final Class<?>[] _updateActionParameterTypes5 = new Class[] {
318                            long.class, java.util.Map.class, java.util.Map.class,
319                            java.lang.String.class, java.lang.String.class,
320                            com.liferay.portal.service.ServiceContext.class
321                    };
322            private static final Class<?>[] _updateActionParameterTypes6 = new Class[] {
323                            long.class, java.util.Map.class, java.util.Map.class,
324                            java.lang.String.class,
325                            com.liferay.portal.kernel.util.UnicodeProperties.class,
326                            com.liferay.portal.service.ServiceContext.class
327                    };
328    }