1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  import com.liferay.portal.kernel.util.IntegerWrapper;
28  import com.liferay.portal.kernel.util.LongWrapper;
29  import com.liferay.portal.kernel.util.MethodWrapper;
30  import com.liferay.portal.security.auth.HttpPrincipal;
31  import com.liferay.portal.service.OrgLaborServiceUtil;
32  
33  /**
34   * <a href="OrgLaborServiceHttp.java.html"><b><i>View Source</i></b></a>
35   *
36   * <p>
37   * ServiceBuilder generated this class. Modifications in this class will be
38   * overwritten the next time is generated.
39   * </p>
40   *
41   * <p>
42   * This class provides a HTTP utility for the
43   * <code>com.liferay.portal.service.OrgLaborServiceUtil</code> service
44   * utility. The static methods of this class calls the same methods of the
45   * service utility. However, the signatures are different because it requires an
46   * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
47   * parameter.
48   * </p>
49   *
50   * <p>
51   * The benefits of using the HTTP utility is that it is fast and allows for
52   * tunneling without the cost of serializing to text. The drawback is that it
53   * only works with Java.
54   * </p>
55   *
56   * <p>
57   * Set the property <code>tunnel.servlet.hosts.allowed</code> in
58   * portal.properties to configure security.
59   * </p>
60   *
61   * <p>
62   * The HTTP utility is only generated for remote services.
63   * </p>
64   *
65   * @author Brian Wing Shun Chan
66   *
67   * @see com.liferay.portal.security.auth.HttpPrincipal
68   * @see com.liferay.portal.service.OrgLaborServiceUtil
69   * @see com.liferay.portal.service.http.OrgLaborServiceSoap
70   *
71   */
72  public class OrgLaborServiceHttp {
73      public static com.liferay.portal.model.OrgLabor addOrgLabor(
74          HttpPrincipal httpPrincipal, long organizationId, int typeId,
75          int sunOpen, int sunClose, int monOpen, int monClose, int tueOpen,
76          int tueClose, int wedOpen, int wedClose, int thuOpen, int thuClose,
77          int friOpen, int friClose, int satOpen, int satClose)
78          throws com.liferay.portal.PortalException,
79              com.liferay.portal.SystemException {
80          try {
81              Object paramObj0 = new LongWrapper(organizationId);
82  
83              Object paramObj1 = new IntegerWrapper(typeId);
84  
85              Object paramObj2 = new IntegerWrapper(sunOpen);
86  
87              Object paramObj3 = new IntegerWrapper(sunClose);
88  
89              Object paramObj4 = new IntegerWrapper(monOpen);
90  
91              Object paramObj5 = new IntegerWrapper(monClose);
92  
93              Object paramObj6 = new IntegerWrapper(tueOpen);
94  
95              Object paramObj7 = new IntegerWrapper(tueClose);
96  
97              Object paramObj8 = new IntegerWrapper(wedOpen);
98  
99              Object paramObj9 = new IntegerWrapper(wedClose);
100 
101             Object paramObj10 = new IntegerWrapper(thuOpen);
102 
103             Object paramObj11 = new IntegerWrapper(thuClose);
104 
105             Object paramObj12 = new IntegerWrapper(friOpen);
106 
107             Object paramObj13 = new IntegerWrapper(friClose);
108 
109             Object paramObj14 = new IntegerWrapper(satOpen);
110 
111             Object paramObj15 = new IntegerWrapper(satClose);
112 
113             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
114                     "addOrgLabor",
115                     new Object[] {
116                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
117                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
118                         paramObj10, paramObj11, paramObj12, paramObj13,
119                         paramObj14, paramObj15
120                     });
121 
122             Object returnObj = null;
123 
124             try {
125                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
126             }
127             catch (Exception e) {
128                 if (e instanceof com.liferay.portal.PortalException) {
129                     throw (com.liferay.portal.PortalException)e;
130                 }
131 
132                 if (e instanceof com.liferay.portal.SystemException) {
133                     throw (com.liferay.portal.SystemException)e;
134                 }
135 
136                 throw new com.liferay.portal.SystemException(e);
137             }
138 
139             return (com.liferay.portal.model.OrgLabor)returnObj;
140         }
141         catch (com.liferay.portal.SystemException se) {
142             _log.error(se, se);
143 
144             throw se;
145         }
146     }
147 
148     public static void deleteOrgLabor(HttpPrincipal httpPrincipal,
149         long orgLaborId)
150         throws com.liferay.portal.PortalException,
151             com.liferay.portal.SystemException {
152         try {
153             Object paramObj0 = new LongWrapper(orgLaborId);
154 
155             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
156                     "deleteOrgLabor", new Object[] { paramObj0 });
157 
158             try {
159                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
160             }
161             catch (Exception e) {
162                 if (e instanceof com.liferay.portal.PortalException) {
163                     throw (com.liferay.portal.PortalException)e;
164                 }
165 
166                 if (e instanceof com.liferay.portal.SystemException) {
167                     throw (com.liferay.portal.SystemException)e;
168                 }
169 
170                 throw new com.liferay.portal.SystemException(e);
171             }
172         }
173         catch (com.liferay.portal.SystemException se) {
174             _log.error(se, se);
175 
176             throw se;
177         }
178     }
179 
180     public static com.liferay.portal.model.OrgLabor getOrgLabor(
181         HttpPrincipal httpPrincipal, long orgLaborId)
182         throws com.liferay.portal.PortalException,
183             com.liferay.portal.SystemException {
184         try {
185             Object paramObj0 = new LongWrapper(orgLaborId);
186 
187             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
188                     "getOrgLabor", new Object[] { paramObj0 });
189 
190             Object returnObj = null;
191 
192             try {
193                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
194             }
195             catch (Exception e) {
196                 if (e instanceof com.liferay.portal.PortalException) {
197                     throw (com.liferay.portal.PortalException)e;
198                 }
199 
200                 if (e instanceof com.liferay.portal.SystemException) {
201                     throw (com.liferay.portal.SystemException)e;
202                 }
203 
204                 throw new com.liferay.portal.SystemException(e);
205             }
206 
207             return (com.liferay.portal.model.OrgLabor)returnObj;
208         }
209         catch (com.liferay.portal.SystemException se) {
210             _log.error(se, se);
211 
212             throw se;
213         }
214     }
215 
216     public static java.util.List<com.liferay.portal.model.OrgLabor> getOrgLabors(
217         HttpPrincipal httpPrincipal, long organizationId)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         try {
221             Object paramObj0 = new LongWrapper(organizationId);
222 
223             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
224                     "getOrgLabors", new Object[] { paramObj0 });
225 
226             Object returnObj = null;
227 
228             try {
229                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
230             }
231             catch (Exception e) {
232                 if (e instanceof com.liferay.portal.PortalException) {
233                     throw (com.liferay.portal.PortalException)e;
234                 }
235 
236                 if (e instanceof com.liferay.portal.SystemException) {
237                     throw (com.liferay.portal.SystemException)e;
238                 }
239 
240                 throw new com.liferay.portal.SystemException(e);
241             }
242 
243             return (java.util.List<com.liferay.portal.model.OrgLabor>)returnObj;
244         }
245         catch (com.liferay.portal.SystemException se) {
246             _log.error(se, se);
247 
248             throw se;
249         }
250     }
251 
252     public static com.liferay.portal.model.OrgLabor updateOrgLabor(
253         HttpPrincipal httpPrincipal, long orgLaborId, int typeId, int sunOpen,
254         int sunClose, int monOpen, int monClose, int tueOpen, int tueClose,
255         int wedOpen, int wedClose, int thuOpen, int thuClose, int friOpen,
256         int friClose, int satOpen, int satClose)
257         throws com.liferay.portal.PortalException,
258             com.liferay.portal.SystemException {
259         try {
260             Object paramObj0 = new LongWrapper(orgLaborId);
261 
262             Object paramObj1 = new IntegerWrapper(typeId);
263 
264             Object paramObj2 = new IntegerWrapper(sunOpen);
265 
266             Object paramObj3 = new IntegerWrapper(sunClose);
267 
268             Object paramObj4 = new IntegerWrapper(monOpen);
269 
270             Object paramObj5 = new IntegerWrapper(monClose);
271 
272             Object paramObj6 = new IntegerWrapper(tueOpen);
273 
274             Object paramObj7 = new IntegerWrapper(tueClose);
275 
276             Object paramObj8 = new IntegerWrapper(wedOpen);
277 
278             Object paramObj9 = new IntegerWrapper(wedClose);
279 
280             Object paramObj10 = new IntegerWrapper(thuOpen);
281 
282             Object paramObj11 = new IntegerWrapper(thuClose);
283 
284             Object paramObj12 = new IntegerWrapper(friOpen);
285 
286             Object paramObj13 = new IntegerWrapper(friClose);
287 
288             Object paramObj14 = new IntegerWrapper(satOpen);
289 
290             Object paramObj15 = new IntegerWrapper(satClose);
291 
292             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
293                     "updateOrgLabor",
294                     new Object[] {
295                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
296                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
297                         paramObj10, paramObj11, paramObj12, paramObj13,
298                         paramObj14, paramObj15
299                     });
300 
301             Object returnObj = null;
302 
303             try {
304                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
305             }
306             catch (Exception e) {
307                 if (e instanceof com.liferay.portal.PortalException) {
308                     throw (com.liferay.portal.PortalException)e;
309                 }
310 
311                 if (e instanceof com.liferay.portal.SystemException) {
312                     throw (com.liferay.portal.SystemException)e;
313                 }
314 
315                 throw new com.liferay.portal.SystemException(e);
316             }
317 
318             return (com.liferay.portal.model.OrgLabor)returnObj;
319         }
320         catch (com.liferay.portal.SystemException se) {
321             _log.error(se, se);
322 
323             throw se;
324         }
325     }
326 
327     private static Log _log = LogFactoryUtil.getLog(OrgLaborServiceHttp.class);
328 }