001    /**
002     * Copyright (c) 2000-2010 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.portal.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.IntegerWrapper;
020    import com.liferay.portal.kernel.util.LongWrapper;
021    import com.liferay.portal.kernel.util.MethodWrapper;
022    import com.liferay.portal.security.auth.HttpPrincipal;
023    import com.liferay.portal.service.OrgLaborServiceUtil;
024    
025    /**
026     * <p>
027     * This class provides a HTTP utility for the
028     * {@link com.liferay.portal.service.OrgLaborServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
032     * </p>
033     *
034     * <p>
035     * The benefits of using the HTTP utility is that it is fast and allows for
036     * tunneling without the cost of serializing to text. The drawback is that it
037     * only works with Java.
038     * </p>
039     *
040     * <p>
041     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
042     * configure security.
043     * </p>
044     *
045     * <p>
046     * The HTTP utility is only generated for remote services.
047     * </p>
048     *
049     * @author    Brian Wing Shun Chan
050     * @see       OrgLaborServiceSoap
051     * @see       com.liferay.portal.security.auth.HttpPrincipal
052     * @see       com.liferay.portal.service.OrgLaborServiceUtil
053     * @generated
054     */
055    public class OrgLaborServiceHttp {
056            public static com.liferay.portal.model.OrgLabor addOrgLabor(
057                    HttpPrincipal httpPrincipal, long organizationId, int typeId,
058                    int sunOpen, int sunClose, int monOpen, int monClose, int tueOpen,
059                    int tueClose, int wedOpen, int wedClose, int thuOpen, int thuClose,
060                    int friOpen, int friClose, int satOpen, int satClose)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    try {
064                            Object paramObj0 = new LongWrapper(organizationId);
065    
066                            Object paramObj1 = new IntegerWrapper(typeId);
067    
068                            Object paramObj2 = new IntegerWrapper(sunOpen);
069    
070                            Object paramObj3 = new IntegerWrapper(sunClose);
071    
072                            Object paramObj4 = new IntegerWrapper(monOpen);
073    
074                            Object paramObj5 = new IntegerWrapper(monClose);
075    
076                            Object paramObj6 = new IntegerWrapper(tueOpen);
077    
078                            Object paramObj7 = new IntegerWrapper(tueClose);
079    
080                            Object paramObj8 = new IntegerWrapper(wedOpen);
081    
082                            Object paramObj9 = new IntegerWrapper(wedClose);
083    
084                            Object paramObj10 = new IntegerWrapper(thuOpen);
085    
086                            Object paramObj11 = new IntegerWrapper(thuClose);
087    
088                            Object paramObj12 = new IntegerWrapper(friOpen);
089    
090                            Object paramObj13 = new IntegerWrapper(friClose);
091    
092                            Object paramObj14 = new IntegerWrapper(satOpen);
093    
094                            Object paramObj15 = new IntegerWrapper(satClose);
095    
096                            MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
097                                            "addOrgLabor",
098                                            new Object[] {
099                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
100                                                    paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
101                                                    paramObj10, paramObj11, paramObj12, paramObj13,
102                                                    paramObj14, paramObj15
103                                            });
104    
105                            Object returnObj = null;
106    
107                            try {
108                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
109                            }
110                            catch (Exception e) {
111                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
113                                    }
114    
115                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
116                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
117                                    }
118    
119                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
120                            }
121    
122                            return (com.liferay.portal.model.OrgLabor)returnObj;
123                    }
124                    catch (com.liferay.portal.kernel.exception.SystemException se) {
125                            _log.error(se, se);
126    
127                            throw se;
128                    }
129            }
130    
131            public static void deleteOrgLabor(HttpPrincipal httpPrincipal,
132                    long orgLaborId)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    try {
136                            Object paramObj0 = new LongWrapper(orgLaborId);
137    
138                            MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
139                                            "deleteOrgLabor", new Object[] { paramObj0 });
140    
141                            try {
142                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
143                            }
144                            catch (Exception e) {
145                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
146                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
147                                    }
148    
149                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
150                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
151                                    }
152    
153                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
154                            }
155                    }
156                    catch (com.liferay.portal.kernel.exception.SystemException se) {
157                            _log.error(se, se);
158    
159                            throw se;
160                    }
161            }
162    
163            public static com.liferay.portal.model.OrgLabor getOrgLabor(
164                    HttpPrincipal httpPrincipal, long orgLaborId)
165                    throws com.liferay.portal.kernel.exception.PortalException,
166                            com.liferay.portal.kernel.exception.SystemException {
167                    try {
168                            Object paramObj0 = new LongWrapper(orgLaborId);
169    
170                            MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
171                                            "getOrgLabor", new Object[] { paramObj0 });
172    
173                            Object returnObj = null;
174    
175                            try {
176                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
177                            }
178                            catch (Exception e) {
179                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
180                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
181                                    }
182    
183                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
184                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
185                                    }
186    
187                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
188                            }
189    
190                            return (com.liferay.portal.model.OrgLabor)returnObj;
191                    }
192                    catch (com.liferay.portal.kernel.exception.SystemException se) {
193                            _log.error(se, se);
194    
195                            throw se;
196                    }
197            }
198    
199            public static java.util.List<com.liferay.portal.model.OrgLabor> getOrgLabors(
200                    HttpPrincipal httpPrincipal, long organizationId)
201                    throws com.liferay.portal.kernel.exception.PortalException,
202                            com.liferay.portal.kernel.exception.SystemException {
203                    try {
204                            Object paramObj0 = new LongWrapper(organizationId);
205    
206                            MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
207                                            "getOrgLabors", new Object[] { paramObj0 });
208    
209                            Object returnObj = null;
210    
211                            try {
212                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
213                            }
214                            catch (Exception e) {
215                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
216                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
217                                    }
218    
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 (java.util.List<com.liferay.portal.model.OrgLabor>)returnObj;
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.portal.model.OrgLabor updateOrgLabor(
236                    HttpPrincipal httpPrincipal, long orgLaborId, int typeId, int sunOpen,
237                    int sunClose, int monOpen, int monClose, int tueOpen, int tueClose,
238                    int wedOpen, int wedClose, int thuOpen, int thuClose, int friOpen,
239                    int friClose, int satOpen, int satClose)
240                    throws com.liferay.portal.kernel.exception.PortalException,
241                            com.liferay.portal.kernel.exception.SystemException {
242                    try {
243                            Object paramObj0 = new LongWrapper(orgLaborId);
244    
245                            Object paramObj1 = new IntegerWrapper(typeId);
246    
247                            Object paramObj2 = new IntegerWrapper(sunOpen);
248    
249                            Object paramObj3 = new IntegerWrapper(sunClose);
250    
251                            Object paramObj4 = new IntegerWrapper(monOpen);
252    
253                            Object paramObj5 = new IntegerWrapper(monClose);
254    
255                            Object paramObj6 = new IntegerWrapper(tueOpen);
256    
257                            Object paramObj7 = new IntegerWrapper(tueClose);
258    
259                            Object paramObj8 = new IntegerWrapper(wedOpen);
260    
261                            Object paramObj9 = new IntegerWrapper(wedClose);
262    
263                            Object paramObj10 = new IntegerWrapper(thuOpen);
264    
265                            Object paramObj11 = new IntegerWrapper(thuClose);
266    
267                            Object paramObj12 = new IntegerWrapper(friOpen);
268    
269                            Object paramObj13 = new IntegerWrapper(friClose);
270    
271                            Object paramObj14 = new IntegerWrapper(satOpen);
272    
273                            Object paramObj15 = new IntegerWrapper(satClose);
274    
275                            MethodWrapper methodWrapper = new MethodWrapper(OrgLaborServiceUtil.class.getName(),
276                                            "updateOrgLabor",
277                                            new Object[] {
278                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
279                                                    paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
280                                                    paramObj10, paramObj11, paramObj12, paramObj13,
281                                                    paramObj14, paramObj15
282                                            });
283    
284                            Object returnObj = null;
285    
286                            try {
287                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
288                            }
289                            catch (Exception e) {
290                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
291                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
292                                    }
293    
294                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
295                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
296                                    }
297    
298                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
299                            }
300    
301                            return (com.liferay.portal.model.OrgLabor)returnObj;
302                    }
303                    catch (com.liferay.portal.kernel.exception.SystemException se) {
304                            _log.error(se, se);
305    
306                            throw se;
307                    }
308            }
309    
310            private static Log _log = LogFactoryUtil.getLog(OrgLaborServiceHttp.class);
311    }