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.MDRRuleGroupServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupServiceUtil} 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       MDRRuleGroupServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupServiceUtil
054     * @generated
055     */
056    public class MDRRuleGroupServiceHttp {
057            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup addRuleGroup(
058                    HttpPrincipal httpPrincipal, long groupId,
059                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
060                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    try {
065                            MethodKey methodKey = new MethodKey(MDRRuleGroupServiceUtil.class.getName(),
066                                            "addRuleGroup", _addRuleGroupParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
069                                            nameMap, descriptionMap, serviceContext);
070    
071                            Object returnObj = null;
072    
073                            try {
074                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
075                            }
076                            catch (Exception e) {
077                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
078                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
079                                    }
080    
081                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
082                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
083                                    }
084    
085                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
086                            }
087    
088                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup)returnObj;
089                    }
090                    catch (com.liferay.portal.kernel.exception.SystemException se) {
091                            _log.error(se, se);
092    
093                            throw se;
094                    }
095            }
096    
097            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup copyRuleGroup(
098                    HttpPrincipal httpPrincipal, long ruleGroupId, long groupId,
099                    com.liferay.portal.service.ServiceContext serviceContext)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    try {
103                            MethodKey methodKey = new MethodKey(MDRRuleGroupServiceUtil.class.getName(),
104                                            "copyRuleGroup", _copyRuleGroupParameterTypes1);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey,
107                                            ruleGroupId, groupId, serviceContext);
108    
109                            Object returnObj = null;
110    
111                            try {
112                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
113                            }
114                            catch (Exception e) {
115                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
116                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
117                                    }
118    
119                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
120                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
121                                    }
122    
123                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
124                            }
125    
126                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup)returnObj;
127                    }
128                    catch (com.liferay.portal.kernel.exception.SystemException se) {
129                            _log.error(se, se);
130    
131                            throw se;
132                    }
133            }
134    
135            public static void deleteRuleGroup(HttpPrincipal httpPrincipal,
136                    long ruleGroupId)
137                    throws com.liferay.portal.kernel.exception.PortalException,
138                            com.liferay.portal.kernel.exception.SystemException {
139                    try {
140                            MethodKey methodKey = new MethodKey(MDRRuleGroupServiceUtil.class.getName(),
141                                            "deleteRuleGroup", _deleteRuleGroupParameterTypes2);
142    
143                            MethodHandler methodHandler = new MethodHandler(methodKey,
144                                            ruleGroupId);
145    
146                            try {
147                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
148                            }
149                            catch (Exception e) {
150                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
151                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
152                                    }
153    
154                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
155                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
156                                    }
157    
158                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
159                            }
160                    }
161                    catch (com.liferay.portal.kernel.exception.SystemException se) {
162                            _log.error(se, se);
163    
164                            throw se;
165                    }
166            }
167    
168            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup fetchRuleGroup(
169                    HttpPrincipal httpPrincipal, long ruleGroupId)
170                    throws com.liferay.portal.kernel.exception.PortalException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    try {
173                            MethodKey methodKey = new MethodKey(MDRRuleGroupServiceUtil.class.getName(),
174                                            "fetchRuleGroup", _fetchRuleGroupParameterTypes3);
175    
176                            MethodHandler methodHandler = new MethodHandler(methodKey,
177                                            ruleGroupId);
178    
179                            Object returnObj = null;
180    
181                            try {
182                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
183                            }
184                            catch (Exception e) {
185                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
186                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
187                                    }
188    
189                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
190                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
191                                    }
192    
193                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
194                            }
195    
196                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup)returnObj;
197                    }
198                    catch (com.liferay.portal.kernel.exception.SystemException se) {
199                            _log.error(se, se);
200    
201                            throw se;
202                    }
203            }
204    
205            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup getRuleGroup(
206                    HttpPrincipal httpPrincipal, long ruleGroupId)
207                    throws com.liferay.portal.kernel.exception.PortalException,
208                            com.liferay.portal.kernel.exception.SystemException {
209                    try {
210                            MethodKey methodKey = new MethodKey(MDRRuleGroupServiceUtil.class.getName(),
211                                            "getRuleGroup", _getRuleGroupParameterTypes4);
212    
213                            MethodHandler methodHandler = new MethodHandler(methodKey,
214                                            ruleGroupId);
215    
216                            Object returnObj = null;
217    
218                            try {
219                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
220                            }
221                            catch (Exception e) {
222                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
223                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
224                                    }
225    
226                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
227                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
228                                    }
229    
230                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
231                            }
232    
233                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup)returnObj;
234                    }
235                    catch (com.liferay.portal.kernel.exception.SystemException se) {
236                            _log.error(se, se);
237    
238                            throw se;
239                    }
240            }
241    
242            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup updateRuleGroup(
243                    HttpPrincipal httpPrincipal, long ruleGroupId,
244                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
245                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
246                    com.liferay.portal.service.ServiceContext serviceContext)
247                    throws com.liferay.portal.kernel.exception.PortalException,
248                            com.liferay.portal.kernel.exception.SystemException {
249                    try {
250                            MethodKey methodKey = new MethodKey(MDRRuleGroupServiceUtil.class.getName(),
251                                            "updateRuleGroup", _updateRuleGroupParameterTypes5);
252    
253                            MethodHandler methodHandler = new MethodHandler(methodKey,
254                                            ruleGroupId, nameMap, descriptionMap, serviceContext);
255    
256                            Object returnObj = null;
257    
258                            try {
259                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
260                            }
261                            catch (Exception e) {
262                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
263                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
264                                    }
265    
266                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
267                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
268                                    }
269    
270                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
271                            }
272    
273                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup)returnObj;
274                    }
275                    catch (com.liferay.portal.kernel.exception.SystemException se) {
276                            _log.error(se, se);
277    
278                            throw se;
279                    }
280            }
281    
282            private static Log _log = LogFactoryUtil.getLog(MDRRuleGroupServiceHttp.class);
283            private static final Class<?>[] _addRuleGroupParameterTypes0 = new Class[] {
284                            long.class, java.util.Map.class, java.util.Map.class,
285                            com.liferay.portal.service.ServiceContext.class
286                    };
287            private static final Class<?>[] _copyRuleGroupParameterTypes1 = new Class[] {
288                            long.class, long.class,
289                            com.liferay.portal.service.ServiceContext.class
290                    };
291            private static final Class<?>[] _deleteRuleGroupParameterTypes2 = new Class[] {
292                            long.class
293                    };
294            private static final Class<?>[] _fetchRuleGroupParameterTypes3 = new Class[] {
295                            long.class
296                    };
297            private static final Class<?>[] _getRuleGroupParameterTypes4 = new Class[] {
298                            long.class
299                    };
300            private static final Class<?>[] _updateRuleGroupParameterTypes5 = new Class[] {
301                            long.class, java.util.Map.class, java.util.Map.class,
302                            com.liferay.portal.service.ServiceContext.class
303                    };
304    }