1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.IntegerWrapper;
20  import com.liferay.portal.kernel.util.LongWrapper;
21  import com.liferay.portal.kernel.util.MethodWrapper;
22  import com.liferay.portal.security.auth.HttpPrincipal;
23  import com.liferay.portal.service.OrgLaborServiceUtil;
24  
25  /**
26   * <a href="OrgLaborServiceHttp.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * <p>
34   * This class provides a HTTP utility for the
35   * {@link com.liferay.portal.service.OrgLaborServiceUtil} service utility. The
36   * static methods of this class calls the same methods of the service utility.
37   * However, the signatures are different because it requires an additional
38   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
39   * </p>
40   *
41   * <p>
42   * The benefits of using the HTTP utility is that it is fast and allows for
43   * tunneling without the cost of serializing to text. The drawback is that it
44   * only works with Java.
45   * </p>
46   *
47   * <p>
48   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
49   * configure security.
50   * </p>
51   *
52   * <p>
53   * The HTTP utility is only generated for remote services.
54   * </p>
55   *
56   * @author    Brian Wing Shun Chan
57   * @see       OrgLaborServiceSoap
58   * @see       com.liferay.portal.security.auth.HttpPrincipal
59   * @see       com.liferay.portal.service.OrgLaborServiceUtil
60   * @generated
61   */
62  public class OrgLaborServiceHttp {
63      public static com.liferay.portal.model.OrgLabor addOrgLabor(
64          HttpPrincipal httpPrincipal, long organizationId, int typeId,
65          int sunOpen, int sunClose, int monOpen, int monClose, int tueOpen,
66          int tueClose, int wedOpen, int wedClose, int thuOpen, int thuClose,
67          int friOpen, int friClose, int satOpen, int satClose)
68          throws com.liferay.portal.kernel.exception.PortalException,
69              com.liferay.portal.kernel.exception.SystemException {
70          try {
71              Object paramObj0 = new LongWrapper(organizationId);
72  
73              Object paramObj1 = new IntegerWrapper(typeId);
74  
75              Object paramObj2 = new IntegerWrapper(sunOpen);
76  
77              Object paramObj3 = new IntegerWrapper(sunClose);
78  
79              Object paramObj4 = new IntegerWrapper(monOpen);
80  
81              Object paramObj5 = new IntegerWrapper(monClose);
82  
83              Object paramObj6 = new IntegerWrapper(tueOpen);
84  
85              Object paramObj7 = new IntegerWrapper(tueClose);
86  
87              Object paramObj8 = new IntegerWrapper(wedOpen);
88  
89              Object paramObj9 = new IntegerWrapper(wedClose);
90  
91              Object paramObj10 = new IntegerWrapper(thuOpen);
92  
93              Object paramObj11 = new IntegerWrapper(thuClose);
94  
95              Object paramObj12 = new IntegerWrapper(friOpen);
96  
97              Object paramObj13 = new IntegerWrapper(friClose);
98  
99              Object paramObj14 = new IntegerWrapper(satOpen);
100 
101             Object paramObj15 = new IntegerWrapper(satClose);
102 
103             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
104                     "addOrgLabor",
105                     new Object[] {
106                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
107                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
108                         paramObj10, paramObj11, paramObj12, paramObj13,
109                         paramObj14, paramObj15
110                     });
111 
112             Object returnObj = null;
113 
114             try {
115                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
116             }
117             catch (Exception e) {
118                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
119                     throw (com.liferay.portal.kernel.exception.PortalException)e;
120                 }
121 
122                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
123                     throw (com.liferay.portal.kernel.exception.SystemException)e;
124                 }
125 
126                 throw new com.liferay.portal.kernel.exception.SystemException(e);
127             }
128 
129             return (com.liferay.portal.model.OrgLabor)returnObj;
130         }
131         catch (com.liferay.portal.kernel.exception.SystemException se) {
132             _log.error(se, se);
133 
134             throw se;
135         }
136     }
137 
138     public static void deleteOrgLabor(HttpPrincipal httpPrincipal,
139         long orgLaborId)
140         throws com.liferay.portal.kernel.exception.PortalException,
141             com.liferay.portal.kernel.exception.SystemException {
142         try {
143             Object paramObj0 = new LongWrapper(orgLaborId);
144 
145             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
146                     "deleteOrgLabor", new Object[] { paramObj0 });
147 
148             try {
149                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
150             }
151             catch (Exception e) {
152                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
153                     throw (com.liferay.portal.kernel.exception.PortalException)e;
154                 }
155 
156                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
157                     throw (com.liferay.portal.kernel.exception.SystemException)e;
158                 }
159 
160                 throw new com.liferay.portal.kernel.exception.SystemException(e);
161             }
162         }
163         catch (com.liferay.portal.kernel.exception.SystemException se) {
164             _log.error(se, se);
165 
166             throw se;
167         }
168     }
169 
170     public static com.liferay.portal.model.OrgLabor getOrgLabor(
171         HttpPrincipal httpPrincipal, long orgLaborId)
172         throws com.liferay.portal.kernel.exception.PortalException,
173             com.liferay.portal.kernel.exception.SystemException {
174         try {
175             Object paramObj0 = new LongWrapper(orgLaborId);
176 
177             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
178                     "getOrgLabor", new Object[] { paramObj0 });
179 
180             Object returnObj = null;
181 
182             try {
183                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
184             }
185             catch (Exception e) {
186                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
187                     throw (com.liferay.portal.kernel.exception.PortalException)e;
188                 }
189 
190                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
191                     throw (com.liferay.portal.kernel.exception.SystemException)e;
192                 }
193 
194                 throw new com.liferay.portal.kernel.exception.SystemException(e);
195             }
196 
197             return (com.liferay.portal.model.OrgLabor)returnObj;
198         }
199         catch (com.liferay.portal.kernel.exception.SystemException se) {
200             _log.error(se, se);
201 
202             throw se;
203         }
204     }
205 
206     public static java.util.List<com.liferay.portal.model.OrgLabor> getOrgLabors(
207         HttpPrincipal httpPrincipal, long organizationId)
208         throws com.liferay.portal.kernel.exception.PortalException,
209             com.liferay.portal.kernel.exception.SystemException {
210         try {
211             Object paramObj0 = new LongWrapper(organizationId);
212 
213             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
214                     "getOrgLabors", new Object[] { paramObj0 });
215 
216             Object returnObj = null;
217 
218             try {
219                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
220             }
221             catch (Exception e) {
222                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
223                     throw (com.liferay.portal.kernel.exception.PortalException)e;
224                 }
225 
226                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
227                     throw (com.liferay.portal.kernel.exception.SystemException)e;
228                 }
229 
230                 throw new com.liferay.portal.kernel.exception.SystemException(e);
231             }
232 
233             return (java.util.List<com.liferay.portal.model.OrgLabor>)returnObj;
234         }
235         catch (com.liferay.portal.kernel.exception.SystemException se) {
236             _log.error(se, se);
237 
238             throw se;
239         }
240     }
241 
242     public static com.liferay.portal.model.OrgLabor updateOrgLabor(
243         HttpPrincipal httpPrincipal, long orgLaborId, int typeId, int sunOpen,
244         int sunClose, int monOpen, int monClose, int tueOpen, int tueClose,
245         int wedOpen, int wedClose, int thuOpen, int thuClose, int friOpen,
246         int friClose, int satOpen, int satClose)
247         throws com.liferay.portal.kernel.exception.PortalException,
248             com.liferay.portal.kernel.exception.SystemException {
249         try {
250             Object paramObj0 = new LongWrapper(orgLaborId);
251 
252             Object paramObj1 = new IntegerWrapper(typeId);
253 
254             Object paramObj2 = new IntegerWrapper(sunOpen);
255 
256             Object paramObj3 = new IntegerWrapper(sunClose);
257 
258             Object paramObj4 = new IntegerWrapper(monOpen);
259 
260             Object paramObj5 = new IntegerWrapper(monClose);
261 
262             Object paramObj6 = new IntegerWrapper(tueOpen);
263 
264             Object paramObj7 = new IntegerWrapper(tueClose);
265 
266             Object paramObj8 = new IntegerWrapper(wedOpen);
267 
268             Object paramObj9 = new IntegerWrapper(wedClose);
269 
270             Object paramObj10 = new IntegerWrapper(thuOpen);
271 
272             Object paramObj11 = new IntegerWrapper(thuClose);
273 
274             Object paramObj12 = new IntegerWrapper(friOpen);
275 
276             Object paramObj13 = new IntegerWrapper(friClose);
277 
278             Object paramObj14 = new IntegerWrapper(satOpen);
279 
280             Object paramObj15 = new IntegerWrapper(satClose);
281 
282             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
283                     "updateOrgLabor",
284                     new Object[] {
285                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
286                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
287                         paramObj10, paramObj11, paramObj12, paramObj13,
288                         paramObj14, paramObj15
289                     });
290 
291             Object returnObj = null;
292 
293             try {
294                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
295             }
296             catch (Exception e) {
297                 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
298                     throw (com.liferay.portal.kernel.exception.PortalException)e;
299                 }
300 
301                 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
302                     throw (com.liferay.portal.kernel.exception.SystemException)e;
303                 }
304 
305                 throw new com.liferay.portal.kernel.exception.SystemException(e);
306             }
307 
308             return (com.liferay.portal.model.OrgLabor)returnObj;
309         }
310         catch (com.liferay.portal.kernel.exception.SystemException se) {
311             _log.error(se, se);
312 
313             throw se;
314         }
315     }
316 
317     private static Log _log = LogFactoryUtil.getLog(OrgLaborServiceHttp.class);
318 }