001
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
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 }