001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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", _addOrgLaborParameterTypes0);
065    
066                            MethodHandler methodHandler = new MethodHandler(methodKey,
067                                            organizationId, typeId, sunOpen, sunClose, monOpen,
068                                            monClose, tueOpen, tueClose, wedOpen, wedClose, thuOpen,
069                                            thuClose, friOpen, friClose, satOpen, satClose);
070    
071                            Object returnObj = null;
072    
073                            try {
074                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
075                            }
076                            catch (Exception e) {
077                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
078                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
079                                    }
080    
081                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
082                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
083                                    }
084    
085                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
086                            }
087    
088                            return (com.liferay.portal.model.OrgLabor)returnObj;
089                    }
090                    catch (com.liferay.portal.kernel.exception.SystemException se) {
091                            _log.error(se, se);
092    
093                            throw se;
094                    }
095            }
096    
097            public static void deleteOrgLabor(HttpPrincipal httpPrincipal,
098                    long orgLaborId)
099                    throws com.liferay.portal.kernel.exception.PortalException,
100                            com.liferay.portal.kernel.exception.SystemException {
101                    try {
102                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
103                                            "deleteOrgLabor", _deleteOrgLaborParameterTypes1);
104    
105                            MethodHandler methodHandler = new MethodHandler(methodKey,
106                                            orgLaborId);
107    
108                            try {
109                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
110                            }
111                            catch (Exception e) {
112                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
113                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
114                                    }
115    
116                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
117                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
118                                    }
119    
120                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
121                            }
122                    }
123                    catch (com.liferay.portal.kernel.exception.SystemException se) {
124                            _log.error(se, se);
125    
126                            throw se;
127                    }
128            }
129    
130            public static com.liferay.portal.model.OrgLabor getOrgLabor(
131                    HttpPrincipal httpPrincipal, long orgLaborId)
132                    throws com.liferay.portal.kernel.exception.PortalException,
133                            com.liferay.portal.kernel.exception.SystemException {
134                    try {
135                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
136                                            "getOrgLabor", _getOrgLaborParameterTypes2);
137    
138                            MethodHandler methodHandler = new MethodHandler(methodKey,
139                                            orgLaborId);
140    
141                            Object returnObj = null;
142    
143                            try {
144                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
145                            }
146                            catch (Exception e) {
147                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
148                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
149                                    }
150    
151                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
152                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
153                                    }
154    
155                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
156                            }
157    
158                            return (com.liferay.portal.model.OrgLabor)returnObj;
159                    }
160                    catch (com.liferay.portal.kernel.exception.SystemException se) {
161                            _log.error(se, se);
162    
163                            throw se;
164                    }
165            }
166    
167            public static java.util.List<com.liferay.portal.model.OrgLabor> getOrgLabors(
168                    HttpPrincipal httpPrincipal, long organizationId)
169                    throws com.liferay.portal.kernel.exception.PortalException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    try {
172                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
173                                            "getOrgLabors", _getOrgLaborsParameterTypes3);
174    
175                            MethodHandler methodHandler = new MethodHandler(methodKey,
176                                            organizationId);
177    
178                            Object returnObj = null;
179    
180                            try {
181                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
182                            }
183                            catch (Exception e) {
184                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
185                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
186                                    }
187    
188                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
189                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
190                                    }
191    
192                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
193                            }
194    
195                            return (java.util.List<com.liferay.portal.model.OrgLabor>)returnObj;
196                    }
197                    catch (com.liferay.portal.kernel.exception.SystemException se) {
198                            _log.error(se, se);
199    
200                            throw se;
201                    }
202            }
203    
204            public static com.liferay.portal.model.OrgLabor updateOrgLabor(
205                    HttpPrincipal httpPrincipal, long orgLaborId, int typeId, int sunOpen,
206                    int sunClose, int monOpen, int monClose, int tueOpen, int tueClose,
207                    int wedOpen, int wedClose, int thuOpen, int thuClose, int friOpen,
208                    int friClose, int satOpen, int satClose)
209                    throws com.liferay.portal.kernel.exception.PortalException,
210                            com.liferay.portal.kernel.exception.SystemException {
211                    try {
212                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class.getName(),
213                                            "updateOrgLabor", _updateOrgLaborParameterTypes4);
214    
215                            MethodHandler methodHandler = new MethodHandler(methodKey,
216                                            orgLaborId, typeId, sunOpen, sunClose, monOpen, monClose,
217                                            tueOpen, tueClose, wedOpen, wedClose, thuOpen, thuClose,
218                                            friOpen, friClose, satOpen, satClose);
219    
220                            Object returnObj = null;
221    
222                            try {
223                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
224                            }
225                            catch (Exception e) {
226                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
227                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
228                                    }
229    
230                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
231                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
232                                    }
233    
234                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
235                            }
236    
237                            return (com.liferay.portal.model.OrgLabor)returnObj;
238                    }
239                    catch (com.liferay.portal.kernel.exception.SystemException se) {
240                            _log.error(se, se);
241    
242                            throw se;
243                    }
244            }
245    
246            private static Log _log = LogFactoryUtil.getLog(OrgLaborServiceHttp.class);
247            private static final Class<?>[] _addOrgLaborParameterTypes0 = new Class[] {
248                            long.class, int.class, int.class, int.class, int.class, int.class,
249                            int.class, int.class, int.class, int.class, int.class, int.class,
250                            int.class, int.class, int.class, int.class
251                    };
252            private static final Class<?>[] _deleteOrgLaborParameterTypes1 = new Class[] {
253                            long.class
254                    };
255            private static final Class<?>[] _getOrgLaborParameterTypes2 = new Class[] {
256                            long.class
257                    };
258            private static final Class<?>[] _getOrgLaborsParameterTypes3 = new Class[] {
259                            long.class
260                    };
261            private static final Class<?>[] _updateOrgLaborParameterTypes4 = new Class[] {
262                            long.class, int.class, int.class, int.class, int.class, int.class,
263                            int.class, int.class, int.class, int.class, int.class, int.class,
264                            int.class, int.class, int.class, int.class
265                    };
266    }