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.MDRRuleGroupInstanceServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceServiceUtil} 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 MDRRuleGroupInstanceServiceSoap
052     * @see com.liferay.portal.security.auth.HttpPrincipal
053     * @see com.liferay.portlet.mobiledevicerules.service.MDRRuleGroupInstanceServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class MDRRuleGroupInstanceServiceHttp {
058            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance addRuleGroupInstance(
059                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
060                    long classPK, long ruleGroupId, int priority,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException {
063                    try {
064                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
081                            }
082    
083                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)returnObj;
084                    }
085                    catch (com.liferay.portal.kernel.exception.SystemException se) {
086                            _log.error(se, se);
087    
088                            throw se;
089                    }
090            }
091    
092            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance addRuleGroupInstance(
093                    HttpPrincipal httpPrincipal, long groupId, java.lang.String className,
094                    long classPK, long ruleGroupId,
095                    com.liferay.portal.service.ServiceContext serviceContext)
096                    throws com.liferay.portal.kernel.exception.PortalException {
097                    try {
098                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
099                                            "addRuleGroupInstance", _addRuleGroupInstanceParameterTypes1);
100    
101                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
102                                            className, classPK, ruleGroupId, 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.MDRRuleGroupInstance)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 deleteRuleGroupInstance(HttpPrincipal httpPrincipal,
127                    long ruleGroupInstanceId)
128                    throws com.liferay.portal.kernel.exception.PortalException {
129                    try {
130                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
131                                            "deleteRuleGroupInstance",
132                                            _deleteRuleGroupInstanceParameterTypes2);
133    
134                            MethodHandler methodHandler = new MethodHandler(methodKey,
135                                            ruleGroupInstanceId);
136    
137                            try {
138                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
139                            }
140                            catch (Exception e) {
141                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
142                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
143                                    }
144    
145                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
146                            }
147                    }
148                    catch (com.liferay.portal.kernel.exception.SystemException se) {
149                            _log.error(se, se);
150    
151                            throw se;
152                    }
153            }
154    
155            public static java.util.List<com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance> getRuleGroupInstances(
156                    HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
157                    int start, int end,
158                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance> orderByComparator) {
159                    try {
160                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
161                                            "getRuleGroupInstances",
162                                            _getRuleGroupInstancesParameterTypes3);
163    
164                            MethodHandler methodHandler = new MethodHandler(methodKey,
165                                            className, classPK, start, end, orderByComparator);
166    
167                            Object returnObj = null;
168    
169                            try {
170                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
171                            }
172                            catch (Exception e) {
173                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
174                            }
175    
176                            return (java.util.List<com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance>)returnObj;
177                    }
178                    catch (com.liferay.portal.kernel.exception.SystemException se) {
179                            _log.error(se, se);
180    
181                            throw se;
182                    }
183            }
184    
185            public static int getRuleGroupInstancesCount(HttpPrincipal httpPrincipal,
186                    java.lang.String className, long classPK) {
187                    try {
188                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
189                                            "getRuleGroupInstancesCount",
190                                            _getRuleGroupInstancesCountParameterTypes4);
191    
192                            MethodHandler methodHandler = new MethodHandler(methodKey,
193                                            className, classPK);
194    
195                            Object returnObj = null;
196    
197                            try {
198                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
199                            }
200                            catch (Exception e) {
201                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
202                            }
203    
204                            return ((Integer)returnObj).intValue();
205                    }
206                    catch (com.liferay.portal.kernel.exception.SystemException se) {
207                            _log.error(se, se);
208    
209                            throw se;
210                    }
211            }
212    
213            public static com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance updateRuleGroupInstance(
214                    HttpPrincipal httpPrincipal, long ruleGroupInstanceId, int priority)
215                    throws com.liferay.portal.kernel.exception.PortalException {
216                    try {
217                            MethodKey methodKey = new MethodKey(MDRRuleGroupInstanceServiceUtil.class,
218                                            "updateRuleGroupInstance",
219                                            _updateRuleGroupInstanceParameterTypes5);
220    
221                            MethodHandler methodHandler = new MethodHandler(methodKey,
222                                            ruleGroupInstanceId, priority);
223    
224                            Object returnObj = null;
225    
226                            try {
227                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
228                            }
229                            catch (Exception e) {
230                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
231                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
232                                    }
233    
234                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
235                            }
236    
237                            return (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)returnObj;
238                    }
239                    catch (com.liferay.portal.kernel.exception.SystemException se) {
240                            _log.error(se, se);
241    
242                            throw se;
243                    }
244            }
245    
246            private static Log _log = LogFactoryUtil.getLog(MDRRuleGroupInstanceServiceHttp.class);
247            private static final Class<?>[] _addRuleGroupInstanceParameterTypes0 = new Class[] {
248                            long.class, java.lang.String.class, long.class, long.class,
249                            int.class, com.liferay.portal.service.ServiceContext.class
250                    };
251            private static final Class<?>[] _addRuleGroupInstanceParameterTypes1 = new Class[] {
252                            long.class, java.lang.String.class, long.class, long.class,
253                            com.liferay.portal.service.ServiceContext.class
254                    };
255            private static final Class<?>[] _deleteRuleGroupInstanceParameterTypes2 = new Class[] {
256                            long.class
257                    };
258            private static final Class<?>[] _getRuleGroupInstancesParameterTypes3 = new Class[] {
259                            java.lang.String.class, long.class, int.class, int.class,
260                            com.liferay.portal.kernel.util.OrderByComparator.class
261                    };
262            private static final Class<?>[] _getRuleGroupInstancesCountParameterTypes4 = new Class[] {
263                            java.lang.String.class, long.class
264                    };
265            private static final Class<?>[] _updateRuleGroupInstanceParameterTypes5 = new Class[] {
266                            long.class, int.class
267                    };
268    }