001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.OrgLaborServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link 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 HttpPrincipal} parameter.
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 HttpPrincipal
051     * @see OrgLaborServiceUtil
052     * @generated
053     */
054    @ProviderType
055    public class OrgLaborServiceHttp {
056            public static com.liferay.portal.model.OrgLabor addOrgLabor(
057                    HttpPrincipal httpPrincipal, long organizationId, long 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                    try {
063                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class,
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
082                            }
083    
084                            return (com.liferay.portal.model.OrgLabor)returnObj;
085                    }
086                    catch (com.liferay.portal.kernel.exception.SystemException se) {
087                            _log.error(se, se);
088    
089                            throw se;
090                    }
091            }
092    
093            public static void deleteOrgLabor(HttpPrincipal httpPrincipal,
094                    long orgLaborId)
095                    throws com.liferay.portal.kernel.exception.PortalException {
096                    try {
097                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class,
098                                            "deleteOrgLabor", _deleteOrgLaborParameterTypes1);
099    
100                            MethodHandler methodHandler = new MethodHandler(methodKey,
101                                            orgLaborId);
102    
103                            try {
104                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
105                            }
106                            catch (Exception e) {
107                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
109                                    }
110    
111                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
112                            }
113                    }
114                    catch (com.liferay.portal.kernel.exception.SystemException se) {
115                            _log.error(se, se);
116    
117                            throw se;
118                    }
119            }
120    
121            public static com.liferay.portal.model.OrgLabor getOrgLabor(
122                    HttpPrincipal httpPrincipal, long orgLaborId)
123                    throws com.liferay.portal.kernel.exception.PortalException {
124                    try {
125                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class,
126                                            "getOrgLabor", _getOrgLaborParameterTypes2);
127    
128                            MethodHandler methodHandler = new MethodHandler(methodKey,
129                                            orgLaborId);
130    
131                            Object returnObj = null;
132    
133                            try {
134                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
135                            }
136                            catch (Exception e) {
137                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
138                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
139                                    }
140    
141                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
142                            }
143    
144                            return (com.liferay.portal.model.OrgLabor)returnObj;
145                    }
146                    catch (com.liferay.portal.kernel.exception.SystemException se) {
147                            _log.error(se, se);
148    
149                            throw se;
150                    }
151            }
152    
153            public static java.util.List<com.liferay.portal.model.OrgLabor> getOrgLabors(
154                    HttpPrincipal httpPrincipal, long organizationId)
155                    throws com.liferay.portal.kernel.exception.PortalException {
156                    try {
157                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class,
158                                            "getOrgLabors", _getOrgLaborsParameterTypes3);
159    
160                            MethodHandler methodHandler = new MethodHandler(methodKey,
161                                            organizationId);
162    
163                            Object returnObj = null;
164    
165                            try {
166                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
167                            }
168                            catch (Exception e) {
169                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
170                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
171                                    }
172    
173                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
174                            }
175    
176                            return (java.util.List<com.liferay.portal.model.OrgLabor>)returnObj;
177                    }
178                    catch (com.liferay.portal.kernel.exception.SystemException se) {
179                            _log.error(se, se);
180    
181                            throw se;
182                    }
183            }
184    
185            public static com.liferay.portal.model.OrgLabor updateOrgLabor(
186                    HttpPrincipal httpPrincipal, long orgLaborId, long typeId, int sunOpen,
187                    int sunClose, int monOpen, int monClose, int tueOpen, int tueClose,
188                    int wedOpen, int wedClose, int thuOpen, int thuClose, int friOpen,
189                    int friClose, int satOpen, int satClose)
190                    throws com.liferay.portal.kernel.exception.PortalException {
191                    try {
192                            MethodKey methodKey = new MethodKey(OrgLaborServiceUtil.class,
193                                            "updateOrgLabor", _updateOrgLaborParameterTypes4);
194    
195                            MethodHandler methodHandler = new MethodHandler(methodKey,
196                                            orgLaborId, typeId, sunOpen, sunClose, monOpen, monClose,
197                                            tueOpen, tueClose, wedOpen, wedClose, thuOpen, thuClose,
198                                            friOpen, friClose, satOpen, satClose);
199    
200                            Object returnObj = null;
201    
202                            try {
203                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
204                            }
205                            catch (Exception e) {
206                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
207                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
208                                    }
209    
210                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
211                            }
212    
213                            return (com.liferay.portal.model.OrgLabor)returnObj;
214                    }
215                    catch (com.liferay.portal.kernel.exception.SystemException se) {
216                            _log.error(se, se);
217    
218                            throw se;
219                    }
220            }
221    
222            private static Log _log = LogFactoryUtil.getLog(OrgLaborServiceHttp.class);
223            private static final Class<?>[] _addOrgLaborParameterTypes0 = new Class[] {
224                            long.class, long.class, int.class, int.class, int.class, int.class,
225                            int.class, int.class, int.class, int.class, int.class, int.class,
226                            int.class, int.class, int.class, int.class
227                    };
228            private static final Class<?>[] _deleteOrgLaborParameterTypes1 = new Class[] {
229                            long.class
230                    };
231            private static final Class<?>[] _getOrgLaborParameterTypes2 = new Class[] {
232                            long.class
233                    };
234            private static final Class<?>[] _getOrgLaborsParameterTypes3 = new Class[] {
235                            long.class
236                    };
237            private static final Class<?>[] _updateOrgLaborParameterTypes4 = new Class[] {
238                            long.class, long.class, int.class, int.class, int.class, int.class,
239                            int.class, int.class, int.class, int.class, int.class, int.class,
240                            int.class, int.class, int.class, int.class
241                    };
242    }