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.MDRRuleGroupInstanceServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author Edward C. Han
049     * @see MDRRuleGroupInstanceServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceServiceUtil
052     * @generated
053     */
054    public class MDRRuleGroupInstanceServiceHttp {
055            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance addRuleGroupInstance(
056                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
057                    long classPK, long ruleGroupId, int priority,
058                    com.liferay.portal.service.ServiceContext serviceContext)
059                    throws com.liferay.portal.kernel.exception.PortalException,
060                            com.liferay.portal.kernel.exception.SystemException {
061                    try {
062                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
063                                            "addRuleGroupInstance", _addRuleGroupInstanceParameterTypes0);
064    
065                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
066                                            className, classPK, ruleGroupId, priority, serviceContext);
067    
068                            Object returnObj = null;
069    
070                            try {
071                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
072                            }
073                            catch (Exception e) {
074                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
075                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
076                                    }
077    
078                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
079                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
080                                    }
081    
082                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
083                            }
084    
085                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)returnObj;
086                    }
087                    catch (com.liferay.portal.kernel.exception.SystemException se) {
088                            _log.error(se, se);
089    
090                            throw se;
091                    }
092            }
093    
094            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance addRuleGroupInstance(
095                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
096                    long classPK, long ruleGroupId,
097                    com.liferay.portal.service.ServiceContext serviceContext)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    try {
101                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
102                                            "addRuleGroupInstance", _addRuleGroupInstanceParameterTypes1);
103    
104                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
105                                            className, classPK, ruleGroupId, serviceContext);
106    
107                            Object returnObj = null;
108    
109                            try {
110                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
111                            }
112                            catch (Exception e) {
113                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
114                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
115                                    }
116    
117                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
118                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
119                                    }
120    
121                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
122                            }
123    
124                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)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 deleteRuleGroupInstance(HttpPrincipal httpPrincipal,
134                    long ruleGroupInstanceId)
135                    throws com.liferay.portal.kernel.exception.PortalException,
136                            com.liferay.portal.kernel.exception.SystemException {
137                    try {
138                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
139                                            "deleteRuleGroupInstance",
140                                            _deleteRuleGroupInstanceParameterTypes2);
141    
142                            MethodHandler methodHandler = new MethodHandler(methodKey,
143                                            ruleGroupInstanceId);
144    
145                            try {
146                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
147                            }
148                            catch (Exception e) {
149                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
150                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
151                                    }
152    
153                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
154                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
155                                    }
156    
157                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
158                            }
159                    }
160                    catch (com.liferay.portal.kernel.exception.SystemException se) {
161                            _log.error(se, se);
162    
163                            throw se;
164                    }
165            }
166    
167            public static java.util.List<com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance> getRuleGroupInstances(
168                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
169                    int start, int end,
170                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
171                    throws com.liferay.portal.kernel.exception.SystemException {
172                    try {
173                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
174                                            "getRuleGroupInstances",
175                                            _getRuleGroupInstancesParameterTypes3);
176    
177                            MethodHandler methodHandler = new MethodHandler(methodKey,
178                                            className, classPK, start, end, orderByComparator);
179    
180                            Object returnObj = null;
181    
182                            try {
183                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
184                            }
185                            catch (Exception e) {
186                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
187                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
188                                    }
189    
190                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
191                            }
192    
193                            return (java.util.List<com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance>)returnObj;
194                    }
195                    catch (com.liferay.portal.kernel.exception.SystemException se) {
196                            _log.error(se, se);
197    
198                            throw se;
199                    }
200            }
201    
202            public static int getRuleGroupInstancesCount(HttpPrincipal httpPrincipal,
203                    java.lang.String className, long classPK)
204                    throws com.liferay.portal.kernel.exception.SystemException {
205                    try {
206                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
207                                            "getRuleGroupInstancesCount",
208                                            _getRuleGroupInstancesCountParameterTypes4);
209    
210                            MethodHandler methodHandler = new MethodHandler(methodKey,
211                                            className, classPK);
212    
213                            Object returnObj = null;
214    
215                            try {
216                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
217                            }
218                            catch (Exception e) {
219                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
220                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
221                                    }
222    
223                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
224                            }
225    
226                            return ((Integer)returnObj).intValue();
227                    }
228                    catch (com.liferay.portal.kernel.exception.SystemException se) {
229                            _log.error(se, se);
230    
231                            throw se;
232                    }
233            }
234    
235            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance updateRuleGroupInstance(
236                    HttpPrincipal httpPrincipal, long ruleGroupInstanceId, int priority)
237                    throws com.liferay.portal.kernel.exception.PortalException,
238                            com.liferay.portal.kernel.exception.SystemException {
239                    try {
240                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
241                                            "updateRuleGroupInstance",
242                                            _updateRuleGroupInstanceParameterTypes5);
243    
244                            MethodHandler methodHandler = new MethodHandler(methodKey,
245                                            ruleGroupInstanceId, priority);
246    
247                            Object returnObj = null;
248    
249                            try {
250                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
251                            }
252                            catch (Exception e) {
253                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
254                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
255                                    }
256    
257                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
258                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
259                                    }
260    
261                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
262                            }
263    
264                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)returnObj;
265                    }
266                    catch (com.liferay.portal.kernel.exception.SystemException se) {
267                            _log.error(se, se);
268    
269                            throw se;
270                    }
271            }
272    
273            private static Log _log = LogFactoryUtil.getLog(MDRRuleGroupInstanceServiceHttp.class);
274            private static final Class<?>[] _addRuleGroupInstanceParameterTypes0 = new Class[] {
275                            long.class, java.lang.String.class, long.class, long.class,
276                            int.class, com.liferay.portal.service.ServiceContext.class
277                    };
278            private static final Class<?>[] _addRuleGroupInstanceParameterTypes1 = new Class[] {
279                            long.class, java.lang.String.class, long.class, long.class,
280                            com.liferay.portal.service.ServiceContext.class
281                    };
282            private static final Class<?>[] _deleteRuleGroupInstanceParameterTypes2 = new Class[] {
283                            long.class
284                    };
285            private static final Class<?>[] _getRuleGroupInstancesParameterTypes3 = new Class[] {
286                            java.lang.String.class, long.class, int.class, int.class,
287                            com.liferay.portal.kernel.util.OrderByComparator.class
288                    };
289            private static final Class<?>[] _getRuleGroupInstancesCountParameterTypes4 = new Class[] {
290                            java.lang.String.class, long.class
291                    };
292            private static final Class<?>[] _updateRuleGroupInstanceParameterTypes5 = new Class[] {
293                            long.class, int.class
294                    };
295    }