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     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceServiceUtil} 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       MDRRuleGroupInstanceServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceServiceUtil
054     * @generated
055     */
056    public class MDRRuleGroupInstanceServiceHttp {
057            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance addRuleGroupInstance(
058                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
059                    long classPK, long ruleGroupId, int priority,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    try {
064                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class.getName(),
065                                            "addRuleGroupInstance", _addRuleGroupInstanceParameterTypes0);
066    
067                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
068                                            className, classPK, ruleGroupId, priority, serviceContext);
069    
070                            Object returnObj = null;
071    
072                            try {
073                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074                            }
075                            catch (Exception e) {
076                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
078                                    }
079    
080                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
082                                    }
083    
084                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
085                            }
086    
087                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)returnObj;
088                    }
089                    catch (com.liferay.portal.kernel.exception.SystemException se) {
090                            _log.error(se, se);
091    
092                            throw se;
093                    }
094            }
095    
096            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance addRuleGroupInstance(
097                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
098                    long classPK, long ruleGroupId,
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(MDRRuleGroupInstanceServiceUtil.class.getName(),
104                                            "addRuleGroupInstance", _addRuleGroupInstanceParameterTypes1);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
107                                            className, classPK, ruleGroupId, 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.MDRRuleGroupInstance)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 deleteRuleGroupInstance(HttpPrincipal httpPrincipal,
136                    long ruleGroupInstanceId)
137                    throws com.liferay.portal.kernel.exception.PortalException,
138                            com.liferay.portal.kernel.exception.SystemException {
139                    try {
140                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class.getName(),
141                                            "deleteRuleGroupInstance",
142                                            _deleteRuleGroupInstanceParameterTypes2);
143    
144                            MethodHandler methodHandler = new MethodHandler(methodKey,
145                                            ruleGroupInstanceId);
146    
147                            try {
148                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
149                            }
150                            catch (Exception e) {
151                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
152                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
153                                    }
154    
155                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
156                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
157                                    }
158    
159                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
160                            }
161                    }
162                    catch (com.liferay.portal.kernel.exception.SystemException se) {
163                            _log.error(se, se);
164    
165                            throw se;
166                    }
167            }
168    
169            public static java.util.List<com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance> getRuleGroupInstances(
170                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
171                    int start, int end,
172                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
173                    throws com.liferay.portal.kernel.exception.SystemException {
174                    try {
175                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class.getName(),
176                                            "getRuleGroupInstances",
177                                            _getRuleGroupInstancesParameterTypes3);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey,
180                                            className, classPK, start, end, orderByComparator);
181    
182                            Object returnObj = null;
183    
184                            try {
185                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
186                            }
187                            catch (Exception e) {
188                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
189                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
190                                    }
191    
192                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
193                            }
194    
195                            return (java.util.List<com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance>)returnObj;
196                    }
197                    catch (com.liferay.portal.kernel.exception.SystemException se) {
198                            _log.error(se, se);
199    
200                            throw se;
201                    }
202            }
203    
204            public static int getRuleGroupInstancesCount(HttpPrincipal httpPrincipal,
205                    java.lang.String className, long classPK)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    try {
208                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class.getName(),
209                                            "getRuleGroupInstancesCount",
210                                            _getRuleGroupInstancesCountParameterTypes4);
211    
212                            MethodHandler methodHandler = new MethodHandler(methodKey,
213                                            className, classPK);
214    
215                            Object returnObj = null;
216    
217                            try {
218                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
219                            }
220                            catch (Exception e) {
221                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
222                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
223                                    }
224    
225                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
226                            }
227    
228                            return ((Integer)returnObj).intValue();
229                    }
230                    catch (com.liferay.portal.kernel.exception.SystemException se) {
231                            _log.error(se, se);
232    
233                            throw se;
234                    }
235            }
236    
237            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance updateRuleGroupInstance(
238                    HttpPrincipal httpPrincipal, long ruleGroupInstanceId, int priority)
239                    throws com.liferay.portal.kernel.exception.PortalException,
240                            com.liferay.portal.kernel.exception.SystemException {
241                    try {
242                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class.getName(),
243                                            "updateRuleGroupInstance",
244                                            _updateRuleGroupInstanceParameterTypes5);
245    
246                            MethodHandler methodHandler = new MethodHandler(methodKey,
247                                            ruleGroupInstanceId, priority);
248    
249                            Object returnObj = null;
250    
251                            try {
252                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
253                            }
254                            catch (Exception e) {
255                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
256                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
257                                    }
258    
259                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
260                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
261                                    }
262    
263                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
264                            }
265    
266                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)returnObj;
267                    }
268                    catch (com.liferay.portal.kernel.exception.SystemException se) {
269                            _log.error(se, se);
270    
271                            throw se;
272                    }
273            }
274    
275            private static Log _log = LogFactoryUtil.getLog(MDRRuleGroupInstanceServiceHttp.class);
276            private static final Class<?>[] _addRuleGroupInstanceParameterTypes0 = new Class[] {
277                            long.class, java.lang.String.class, long.class, long.class,
278                            int.class, com.liferay.portal.service.ServiceContext.class
279                    };
280            private static final Class<?>[] _addRuleGroupInstanceParameterTypes1 = new Class[] {
281                            long.class, java.lang.String.class, long.class, long.class,
282                            com.liferay.portal.service.ServiceContext.class
283                    };
284            private static final Class<?>[] _deleteRuleGroupInstanceParameterTypes2 = new Class[] {
285                            long.class
286                    };
287            private static final Class<?>[] _getRuleGroupInstancesParameterTypes3 = new Class[] {
288                            java.lang.String.class, long.class, int.class, int.class,
289                            com.liferay.portal.kernel.util.OrderByComparator.class
290                    };
291            private static final Class<?>[] _getRuleGroupInstancesCountParameterTypes4 = new Class[] {
292                            java.lang.String.class, long.class
293                    };
294            private static final Class<?>[] _updateRuleGroupInstanceParameterTypes5 = new Class[] {
295                            long.class, int.class
296                    };
297    }