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.portlet.shopping.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.http.TunnelUtil;
025    
026    import com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link ShoppingOrderServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link HttpPrincipal} parameter.
034     *
035     * <p>
036     * The benefits of using the HTTP utility is that it is fast and allows for
037     * tunneling without the cost of serializing to text. The drawback is that it
038     * only works with Java.
039     * </p>
040     *
041     * <p>
042     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
043     * configure security.
044     * </p>
045     *
046     * <p>
047     * The HTTP utility is only generated for remote services.
048     * </p>
049     *
050     * @author Brian Wing Shun Chan
051     * @see ShoppingOrderServiceSoap
052     * @see HttpPrincipal
053     * @see ShoppingOrderServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class ShoppingOrderServiceHttp {
058            public static void completeOrder(HttpPrincipal httpPrincipal, long groupId,
059                    java.lang.String number, java.lang.String ppTxnId,
060                    java.lang.String ppPaymentStatus, double ppPaymentGross,
061                    java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail,
062                    com.liferay.portal.service.ServiceContext serviceContext)
063                    throws com.liferay.portal.kernel.exception.PortalException {
064                    try {
065                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
066                                            "completeOrder", _completeOrderParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
069                                            number, ppTxnId, ppPaymentStatus, ppPaymentGross,
070                                            ppReceiverEmail, ppPayerEmail, serviceContext);
071    
072                            try {
073                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
074                            }
075                            catch (Exception e) {
076                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
078                                    }
079    
080                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
081                            }
082                    }
083                    catch (com.liferay.portal.kernel.exception.SystemException se) {
084                            _log.error(se, se);
085    
086                            throw se;
087                    }
088            }
089    
090            public static void deleteOrder(HttpPrincipal httpPrincipal, long groupId,
091                    long orderId)
092                    throws com.liferay.portal.kernel.exception.PortalException {
093                    try {
094                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
095                                            "deleteOrder", _deleteOrderParameterTypes1);
096    
097                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
098                                            orderId);
099    
100                            try {
101                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
102                            }
103                            catch (Exception e) {
104                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
105                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
106                                    }
107    
108                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
109                            }
110                    }
111                    catch (com.liferay.portal.kernel.exception.SystemException se) {
112                            _log.error(se, se);
113    
114                            throw se;
115                    }
116            }
117    
118            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
119                    HttpPrincipal httpPrincipal, long groupId, long orderId)
120                    throws com.liferay.portal.kernel.exception.PortalException {
121                    try {
122                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
123                                            "getOrder", _getOrderParameterTypes2);
124    
125                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
126                                            orderId);
127    
128                            Object returnObj = null;
129    
130                            try {
131                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
132                            }
133                            catch (Exception e) {
134                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
135                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
136                                    }
137    
138                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
139                            }
140    
141                            return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
142                    }
143                    catch (com.liferay.portal.kernel.exception.SystemException se) {
144                            _log.error(se, se);
145    
146                            throw se;
147                    }
148            }
149    
150            public static void sendEmail(HttpPrincipal httpPrincipal, long groupId,
151                    long orderId, java.lang.String emailType,
152                    com.liferay.portal.service.ServiceContext serviceContext)
153                    throws com.liferay.portal.kernel.exception.PortalException {
154                    try {
155                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
156                                            "sendEmail", _sendEmailParameterTypes3);
157    
158                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
159                                            orderId, emailType, serviceContext);
160    
161                            try {
162                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
163                            }
164                            catch (Exception e) {
165                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
166                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
167                                    }
168    
169                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
170                            }
171                    }
172                    catch (com.liferay.portal.kernel.exception.SystemException se) {
173                            _log.error(se, se);
174    
175                            throw se;
176                    }
177            }
178    
179            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
180                    HttpPrincipal httpPrincipal, long groupId, long orderId,
181                    java.lang.String ppTxnId, java.lang.String ppPaymentStatus,
182                    double ppPaymentGross, java.lang.String ppReceiverEmail,
183                    java.lang.String ppPayerEmail)
184                    throws com.liferay.portal.kernel.exception.PortalException {
185                    try {
186                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
187                                            "updateOrder", _updateOrderParameterTypes4);
188    
189                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
190                                            orderId, ppTxnId, ppPaymentStatus, ppPaymentGross,
191                                            ppReceiverEmail, ppPayerEmail);
192    
193                            Object returnObj = null;
194    
195                            try {
196                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
197                            }
198                            catch (Exception e) {
199                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
200                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
201                                    }
202    
203                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
204                            }
205    
206                            return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
207                    }
208                    catch (com.liferay.portal.kernel.exception.SystemException se) {
209                            _log.error(se, se);
210    
211                            throw se;
212                    }
213            }
214    
215            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
216                    HttpPrincipal httpPrincipal, long groupId, long orderId,
217                    java.lang.String billingFirstName, java.lang.String billingLastName,
218                    java.lang.String billingEmailAddress, java.lang.String billingCompany,
219                    java.lang.String billingStreet, java.lang.String billingCity,
220                    java.lang.String billingState, java.lang.String billingZip,
221                    java.lang.String billingCountry, java.lang.String billingPhone,
222                    boolean shipToBilling, java.lang.String shippingFirstName,
223                    java.lang.String shippingLastName,
224                    java.lang.String shippingEmailAddress,
225                    java.lang.String shippingCompany, java.lang.String shippingStreet,
226                    java.lang.String shippingCity, java.lang.String shippingState,
227                    java.lang.String shippingZip, java.lang.String shippingCountry,
228                    java.lang.String shippingPhone, java.lang.String ccName,
229                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
230                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
231                    throws com.liferay.portal.kernel.exception.PortalException {
232                    try {
233                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class,
234                                            "updateOrder", _updateOrderParameterTypes5);
235    
236                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
237                                            orderId, billingFirstName, billingLastName,
238                                            billingEmailAddress, billingCompany, billingStreet,
239                                            billingCity, billingState, billingZip, billingCountry,
240                                            billingPhone, shipToBilling, shippingFirstName,
241                                            shippingLastName, shippingEmailAddress, shippingCompany,
242                                            shippingStreet, shippingCity, shippingState, shippingZip,
243                                            shippingCountry, shippingPhone, ccName, ccType, ccNumber,
244                                            ccExpMonth, ccExpYear, ccVerNumber, comments);
245    
246                            Object returnObj = null;
247    
248                            try {
249                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
250                            }
251                            catch (Exception e) {
252                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
253                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
254                                    }
255    
256                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
257                            }
258    
259                            return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
260                    }
261                    catch (com.liferay.portal.kernel.exception.SystemException se) {
262                            _log.error(se, se);
263    
264                            throw se;
265                    }
266            }
267    
268            private static Log _log = LogFactoryUtil.getLog(ShoppingOrderServiceHttp.class);
269            private static final Class<?>[] _completeOrderParameterTypes0 = new Class[] {
270                            long.class, java.lang.String.class, java.lang.String.class,
271                            java.lang.String.class, double.class, java.lang.String.class,
272                            java.lang.String.class,
273                            com.liferay.portal.service.ServiceContext.class
274                    };
275            private static final Class<?>[] _deleteOrderParameterTypes1 = new Class[] {
276                            long.class, long.class
277                    };
278            private static final Class<?>[] _getOrderParameterTypes2 = new Class[] {
279                            long.class, long.class
280                    };
281            private static final Class<?>[] _sendEmailParameterTypes3 = new Class[] {
282                            long.class, long.class, java.lang.String.class,
283                            com.liferay.portal.service.ServiceContext.class
284                    };
285            private static final Class<?>[] _updateOrderParameterTypes4 = new Class[] {
286                            long.class, long.class, java.lang.String.class,
287                            java.lang.String.class, double.class, java.lang.String.class,
288                            java.lang.String.class
289                    };
290            private static final Class<?>[] _updateOrderParameterTypes5 = new Class[] {
291                            long.class, long.class, java.lang.String.class,
292                            java.lang.String.class, java.lang.String.class,
293                            java.lang.String.class, java.lang.String.class,
294                            java.lang.String.class, java.lang.String.class,
295                            java.lang.String.class, java.lang.String.class,
296                            java.lang.String.class, boolean.class, java.lang.String.class,
297                            java.lang.String.class, java.lang.String.class,
298                            java.lang.String.class, java.lang.String.class,
299                            java.lang.String.class, java.lang.String.class,
300                            java.lang.String.class, java.lang.String.class,
301                            java.lang.String.class, java.lang.String.class,
302                            java.lang.String.class, java.lang.String.class, int.class, int.class,
303                            java.lang.String.class, java.lang.String.class
304                    };
305    }