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