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.MethodHandler;
020    import com.liferay.portal.kernel.util.MethodKey;
021    import com.liferay.portal.security.auth.HttpPrincipal;
022    import com.liferay.portal.service.OrgLaborServiceUtil;
023    
024    /**
025     * <p>
026     * This class provides a HTTP utility for the
027     * {@link com.liferay.portal.service.OrgLaborServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it requires an additional
030     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
031     * </p>
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author    Brian Wing Shun Chan
049     * @see       OrgLaborServiceSoap
050     * @see       com.liferay.portal.security.auth.HttpPrincipal
051     * @see       com.liferay.portal.service.OrgLaborServiceUtil
052     * @generated
053     */
054    public class OrgLaborServiceHttp {
055            public static com.liferay.portal.model.OrgLabor addOrgLabor(
056                    HttpPrincipal httpPrincipal, long organizationId, int typeId,
057                    int sunOpen, int sunClose, int monOpen, int monClose, int tueOpen,
058                    int tueClose, int wedOpen, int wedClose, int thuOpen, int thuClose,
059                    int friOpen, int friClose, int satOpen, int satClose)
060                    throws com.liferay.portal.kernel.exception.PortalException,
061                            com.liferay.portal.kernel.exception.SystemException {
062                    try {
063                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
064                                            "addOrgLabor", long.class, int.class, int.class, int.class,
065                                            int.class, int.class, int.class, int.class, int.class,
066                                            int.class, int.class, int.class, int.class, int.class,
067                                            int.class, int.class);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey,
070                                            organizationId, typeId, sunOpen, sunClose, monOpen,
071                                            monClose, tueOpen, tueClose, wedOpen, wedClose, thuOpen,
072                                            thuClose, friOpen, friClose, satOpen, satClose);
073    
074                            Object returnObj = null;
075    
076                            try {
077                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
078                            }
079                            catch (Exception e) {
080                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
081                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
082                                    }
083    
084                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
085                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
086                                    }
087    
088                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
089                            }
090    
091                            return (com.liferay.portal.model.OrgLabor)returnObj;
092                    }
093                    catch (com.liferay.portal.kernel.exception.SystemException se) {
094                            _log.error(se, se);
095    
096                            throw se;
097                    }
098            }
099    
100            public static void deleteOrgLabor(HttpPrincipal httpPrincipal,
101                    long orgLaborId)
102                    throws com.liferay.portal.kernel.exception.PortalException,
103                            com.liferay.portal.kernel.exception.SystemException {
104                    try {
105                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
106                                            "deleteOrgLabor", long.class);
107    
108                            MethodHandler methodHandler = new MethodHandler(methodKey,
109                                            orgLaborId);
110    
111                            try {
112                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
113                            }
114                            catch (Exception e) {
115                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
116                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
117                                    }
118    
119                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
120                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
121                                    }
122    
123                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
124                            }
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 com.liferay.portal.model.OrgLabor getOrgLabor(
134                    HttpPrincipal httpPrincipal, long orgLaborId)
135                    throws com.liferay.portal.kernel.exception.PortalException,
136                            com.liferay.portal.kernel.exception.SystemException {
137                    try {
138                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
139                                            "getOrgLabor", long.class);
140    
141                            MethodHandler methodHandler = new MethodHandler(methodKey,
142                                            orgLaborId);
143    
144                            Object returnObj = null;
145    
146                            try {
147                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
148                            }
149                            catch (Exception e) {
150                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
151                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
152                                    }
153    
154                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
155                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
156                                    }
157    
158                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
159                            }
160    
161                            return (com.liferay.portal.model.OrgLabor)returnObj;
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 java.util.List<com.liferay.portal.model.OrgLabor> getOrgLabors(
171                    HttpPrincipal httpPrincipal, long organizationId)
172                    throws com.liferay.portal.kernel.exception.PortalException,
173                            com.liferay.portal.kernel.exception.SystemException {
174                    try {
175                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
176                                            "getOrgLabors", long.class);
177    
178                            MethodHandler methodHandler = new MethodHandler(methodKey,
179                                            organizationId);
180    
181                            Object returnObj = null;
182    
183                            try {
184                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
185                            }
186                            catch (Exception e) {
187                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
188                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
189                                    }
190    
191                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
192                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
193                                    }
194    
195                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
196                            }
197    
198                            return (java.util.List<com.liferay.portal.model.OrgLabor>)returnObj;
199                    }
200                    catch (com.liferay.portal.kernel.exception.SystemException se) {
201                            _log.error(se, se);
202    
203                            throw se;
204                    }
205            }
206    
207            public static com.liferay.portal.model.OrgLabor updateOrgLabor(
208                    HttpPrincipal httpPrincipal, long orgLaborId, int typeId, int sunOpen,
209                    int sunClose, int monOpen, int monClose, int tueOpen, int tueClose,
210                    int wedOpen, int wedClose, int thuOpen, int thuClose, int friOpen,
211                    int friClose, int satOpen, int satClose)
212                    throws com.liferay.portal.kernel.exception.PortalException,
213                            com.liferay.portal.kernel.exception.SystemException {
214                    try {
215                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
216                                            "updateOrgLabor", long.class, int.class, int.class,
217                                            int.class, int.class, int.class, int.class, int.class,
218                                            int.class, int.class, int.class, int.class, int.class,
219                                            int.class, int.class, int.class);
220    
221                            MethodHandler methodHandler = new MethodHandler(methodKey,
222                                            orgLaborId, typeId, sunOpen, sunClose, monOpen, monClose,
223                                            tueOpen, tueClose, wedOpen, wedClose, thuOpen, thuClose,
224                                            friOpen, friClose, satOpen, satClose);
225    
226                            Object returnObj = null;
227    
228                            try {
229                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
230                            }
231                            catch (Exception e) {
232                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
233                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
234                                    }
235    
236                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
237                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
238                                    }
239    
240                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
241                            }
242    
243                            return (com.liferay.portal.model.OrgLabor)returnObj;
244                    }
245                    catch (com.liferay.portal.kernel.exception.SystemException se) {
246                            _log.error(se, se);
247    
248                            throw se;
249                    }
250            }
251    
252            private static Log _log = LogFactoryUtil.getLog(OrgLaborServiceHttp.class);
253    }