1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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   * {@link com.liferay.portal.service.OrgLaborServiceUtil} service utility. The
44   * static methods of this class calls the same methods of the service utility.
45   * However, the signatures are different because it requires an additional
46   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
47   * </p>
48   *
49   * <p>
50   * The benefits of using the HTTP utility is that it is fast and allows for
51   * tunneling without the cost of serializing to text. The drawback is that it
52   * only works with Java.
53   * </p>
54   *
55   * <p>
56   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
57   * configure security.
58   * </p>
59   *
60   * <p>
61   * The HTTP utility is only generated for remote services.
62   * </p>
63   *
64   * @author    Brian Wing Shun Chan
65   * @see       OrgLaborServiceSoap
66   * @see       com.liferay.portal.security.auth.HttpPrincipal
67   * @see       com.liferay.portal.service.OrgLaborServiceUtil
68   * @generated
69   */
70  public class OrgLaborServiceHttp {
71      public static com.liferay.portal.model.OrgLabor addOrgLabor(
72          HttpPrincipal httpPrincipal, long organizationId, int typeId,
73          int sunOpen, int sunClose, int monOpen, int monClose, int tueOpen,
74          int tueClose, int wedOpen, int wedClose, int thuOpen, int thuClose,
75          int friOpen, int friClose, int satOpen, int satClose)
76          throws com.liferay.portal.PortalException,
77              com.liferay.portal.SystemException {
78          try {
79              Object paramObj0 = new LongWrapper(organizationId);
80  
81              Object paramObj1 = new IntegerWrapper(typeId);
82  
83              Object paramObj2 = new IntegerWrapper(sunOpen);
84  
85              Object paramObj3 = new IntegerWrapper(sunClose);
86  
87              Object paramObj4 = new IntegerWrapper(monOpen);
88  
89              Object paramObj5 = new IntegerWrapper(monClose);
90  
91              Object paramObj6 = new IntegerWrapper(tueOpen);
92  
93              Object paramObj7 = new IntegerWrapper(tueClose);
94  
95              Object paramObj8 = new IntegerWrapper(wedOpen);
96  
97              Object paramObj9 = new IntegerWrapper(wedClose);
98  
99              Object paramObj10 = new IntegerWrapper(thuOpen);
100 
101             Object paramObj11 = new IntegerWrapper(thuClose);
102 
103             Object paramObj12 = new IntegerWrapper(friOpen);
104 
105             Object paramObj13 = new IntegerWrapper(friClose);
106 
107             Object paramObj14 = new IntegerWrapper(satOpen);
108 
109             Object paramObj15 = new IntegerWrapper(satClose);
110 
111             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
112                     "addOrgLabor",
113                     new Object[] {
114                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
115                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
116                         paramObj10, paramObj11, paramObj12, paramObj13,
117                         paramObj14, paramObj15
118                     });
119 
120             Object returnObj = null;
121 
122             try {
123                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
124             }
125             catch (Exception e) {
126                 if (e instanceof com.liferay.portal.PortalException) {
127                     throw (com.liferay.portal.PortalException)e;
128                 }
129 
130                 if (e instanceof com.liferay.portal.SystemException) {
131                     throw (com.liferay.portal.SystemException)e;
132                 }
133 
134                 throw new com.liferay.portal.SystemException(e);
135             }
136 
137             return (com.liferay.portal.model.OrgLabor)returnObj;
138         }
139         catch (com.liferay.portal.SystemException se) {
140             _log.error(se, se);
141 
142             throw se;
143         }
144     }
145 
146     public static void deleteOrgLabor(HttpPrincipal httpPrincipal,
147         long orgLaborId)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         try {
151             Object paramObj0 = new LongWrapper(orgLaborId);
152 
153             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
154                     "deleteOrgLabor", new Object[] { paramObj0 });
155 
156             try {
157                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
158             }
159             catch (Exception e) {
160                 if (e instanceof com.liferay.portal.PortalException) {
161                     throw (com.liferay.portal.PortalException)e;
162                 }
163 
164                 if (e instanceof com.liferay.portal.SystemException) {
165                     throw (com.liferay.portal.SystemException)e;
166                 }
167 
168                 throw new com.liferay.portal.SystemException(e);
169             }
170         }
171         catch (com.liferay.portal.SystemException se) {
172             _log.error(se, se);
173 
174             throw se;
175         }
176     }
177 
178     public static com.liferay.portal.model.OrgLabor getOrgLabor(
179         HttpPrincipal httpPrincipal, long orgLaborId)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         try {
183             Object paramObj0 = new LongWrapper(orgLaborId);
184 
185             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
186                     "getOrgLabor", new Object[] { paramObj0 });
187 
188             Object returnObj = null;
189 
190             try {
191                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
192             }
193             catch (Exception e) {
194                 if (e instanceof com.liferay.portal.PortalException) {
195                     throw (com.liferay.portal.PortalException)e;
196                 }
197 
198                 if (e instanceof com.liferay.portal.SystemException) {
199                     throw (com.liferay.portal.SystemException)e;
200                 }
201 
202                 throw new com.liferay.portal.SystemException(e);
203             }
204 
205             return (com.liferay.portal.model.OrgLabor)returnObj;
206         }
207         catch (com.liferay.portal.SystemException se) {
208             _log.error(se, se);
209 
210             throw se;
211         }
212     }
213 
214     public static java.util.List<com.liferay.portal.model.OrgLabor> getOrgLabors(
215         HttpPrincipal httpPrincipal, long organizationId)
216         throws com.liferay.portal.PortalException,
217             com.liferay.portal.SystemException {
218         try {
219             Object paramObj0 = new LongWrapper(organizationId);
220 
221             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
222                     "getOrgLabors", new Object[] { paramObj0 });
223 
224             Object returnObj = null;
225 
226             try {
227                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
228             }
229             catch (Exception e) {
230                 if (e instanceof com.liferay.portal.PortalException) {
231                     throw (com.liferay.portal.PortalException)e;
232                 }
233 
234                 if (e instanceof com.liferay.portal.SystemException) {
235                     throw (com.liferay.portal.SystemException)e;
236                 }
237 
238                 throw new com.liferay.portal.SystemException(e);
239             }
240 
241             return (java.util.List<com.liferay.portal.model.OrgLabor>)returnObj;
242         }
243         catch (com.liferay.portal.SystemException se) {
244             _log.error(se, se);
245 
246             throw se;
247         }
248     }
249 
250     public static com.liferay.portal.model.OrgLabor updateOrgLabor(
251         HttpPrincipal httpPrincipal, long orgLaborId, int typeId, int sunOpen,
252         int sunClose, int monOpen, int monClose, int tueOpen, int tueClose,
253         int wedOpen, int wedClose, int thuOpen, int thuClose, int friOpen,
254         int friClose, int satOpen, int satClose)
255         throws com.liferay.portal.PortalException,
256             com.liferay.portal.SystemException {
257         try {
258             Object paramObj0 = new LongWrapper(orgLaborId);
259 
260             Object paramObj1 = new IntegerWrapper(typeId);
261 
262             Object paramObj2 = new IntegerWrapper(sunOpen);
263 
264             Object paramObj3 = new IntegerWrapper(sunClose);
265 
266             Object paramObj4 = new IntegerWrapper(monOpen);
267 
268             Object paramObj5 = new IntegerWrapper(monClose);
269 
270             Object paramObj6 = new IntegerWrapper(tueOpen);
271 
272             Object paramObj7 = new IntegerWrapper(tueClose);
273 
274             Object paramObj8 = new IntegerWrapper(wedOpen);
275 
276             Object paramObj9 = new IntegerWrapper(wedClose);
277 
278             Object paramObj10 = new IntegerWrapper(thuOpen);
279 
280             Object paramObj11 = new IntegerWrapper(thuClose);
281 
282             Object paramObj12 = new IntegerWrapper(friOpen);
283 
284             Object paramObj13 = new IntegerWrapper(friClose);
285 
286             Object paramObj14 = new IntegerWrapper(satOpen);
287 
288             Object paramObj15 = new IntegerWrapper(satClose);
289 
290             MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
291                     "updateOrgLabor",
292                     new Object[] {
293                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
294                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
295                         paramObj10, paramObj11, paramObj12, paramObj13,
296                         paramObj14, paramObj15
297                     });
298 
299             Object returnObj = null;
300 
301             try {
302                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
303             }
304             catch (Exception e) {
305                 if (e instanceof com.liferay.portal.PortalException) {
306                     throw (com.liferay.portal.PortalException)e;
307                 }
308 
309                 if (e instanceof com.liferay.portal.SystemException) {
310                     throw (com.liferay.portal.SystemException)e;
311                 }
312 
313                 throw new com.liferay.portal.SystemException(e);
314             }
315 
316             return (com.liferay.portal.model.OrgLabor)returnObj;
317         }
318         catch (com.liferay.portal.SystemException se) {
319             _log.error(se, se);
320 
321             throw se;
322         }
323     }
324 
325     private static Log _log = LogFactoryUtil.getLog(OrgLaborServiceHttp.class);
326 }