001    /**
002     * Copyright (c) 2000-2013 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 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.http.TunnelUtil;
023    
024    import com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil} service utility. The
030     * static methods of this class calls the same methods of the service utility.
031     * However, the signatures are different because it requires an additional
032     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
033     * </p>
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       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil
054     * @generated
055     */
056    public class ShoppingOrderServiceHttp {
057            public static void completeOrder(HttpPrincipal httpPrincipal, long groupId,
058                    java.lang.String number, java.lang.String ppTxnId,
059                    java.lang.String ppPaymentStatus, double ppPaymentGross,
060                    java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    try {
065                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
082                                    }
083    
084                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
085                            }
086                    }
087                    catch (com.liferay.portal.kernel.exception.SystemException se) {
088                            _log.error(se, se);
089    
090                            throw se;
091                    }
092            }
093    
094            public static void deleteOrder(HttpPrincipal httpPrincipal, long groupId,
095                    long orderId)
096                    throws com.liferay.portal.kernel.exception.PortalException,
097                            com.liferay.portal.kernel.exception.SystemException {
098                    try {
099                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
100                                            "deleteOrder", _deleteOrderParameterTypes1);
101    
102                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
103                                            orderId);
104    
105                            try {
106                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
107                            }
108                            catch (Exception e) {
109                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
110                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
111                                    }
112    
113                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
114                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
115                                    }
116    
117                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
118                            }
119                    }
120                    catch (com.liferay.portal.kernel.exception.SystemException se) {
121                            _log.error(se, se);
122    
123                            throw se;
124                    }
125            }
126    
127            public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
128                    HttpPrincipal httpPrincipal, long groupId, long orderId)
129                    throws com.liferay.portal.kernel.exception.PortalException,
130                            com.liferay.portal.kernel.exception.SystemException {
131                    try {
132                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
133                                            "getOrder", _getOrderParameterTypes2);
134    
135                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
136                                            orderId);
137    
138                            Object returnObj = null;
139    
140                            try {
141                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
142                            }
143                            catch (Exception e) {
144                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
145                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
146                                    }
147    
148                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
149                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
150                                    }
151    
152                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
153                            }
154    
155                            return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
156                    }
157                    catch (com.liferay.portal.kernel.exception.SystemException se) {
158                            _log.error(se, se);
159    
160                            throw se;
161                    }
162            }
163    
164            public static void sendEmail(HttpPrincipal httpPrincipal, long groupId,
165                    long orderId, java.lang.String emailType,
166                    com.liferay.portal.service.ServiceContext serviceContext)
167                    throws com.liferay.portal.kernel.exception.PortalException,
168                            com.liferay.portal.kernel.exception.SystemException {
169                    try {
170                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
171                                            "sendEmail", _sendEmailParameterTypes3);
172    
173                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
174                                            orderId, emailType, serviceContext);
175    
176                            try {
177                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
178                            }
179                            catch (Exception e) {
180                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
181                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
182                                    }
183    
184                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
185                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
186                                    }
187    
188                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
189                            }
190                    }
191                    catch (com.liferay.portal.kernel.exception.SystemException se) {
192                            _log.error(se, se);
193    
194                            throw se;
195                    }
196            }
197    
198            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
199                    HttpPrincipal httpPrincipal, long groupId, long orderId,
200                    java.lang.String ppTxnId, java.lang.String ppPaymentStatus,
201                    double ppPaymentGross, java.lang.String ppReceiverEmail,
202                    java.lang.String ppPayerEmail)
203                    throws com.liferay.portal.kernel.exception.PortalException,
204                            com.liferay.portal.kernel.exception.SystemException {
205                    try {
206                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
207                                            "updateOrder", _updateOrderParameterTypes4);
208    
209                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
210                                            orderId, ppTxnId, ppPaymentStatus, ppPaymentGross,
211                                            ppReceiverEmail, ppPayerEmail);
212    
213                            Object returnObj = null;
214    
215                            try {
216                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
217                            }
218                            catch (Exception e) {
219                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
220                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
221                                    }
222    
223                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
224                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
225                                    }
226    
227                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
228                            }
229    
230                            return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
231                    }
232                    catch (com.liferay.portal.kernel.exception.SystemException se) {
233                            _log.error(se, se);
234    
235                            throw se;
236                    }
237            }
238    
239            public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
240                    HttpPrincipal httpPrincipal, long groupId, long orderId,
241                    java.lang.String billingFirstName, java.lang.String billingLastName,
242                    java.lang.String billingEmailAddress, java.lang.String billingCompany,
243                    java.lang.String billingStreet, java.lang.String billingCity,
244                    java.lang.String billingState, java.lang.String billingZip,
245                    java.lang.String billingCountry, java.lang.String billingPhone,
246                    boolean shipToBilling, java.lang.String shippingFirstName,
247                    java.lang.String shippingLastName,
248                    java.lang.String shippingEmailAddress,
249                    java.lang.String shippingCompany, java.lang.String shippingStreet,
250                    java.lang.String shippingCity, java.lang.String shippingState,
251                    java.lang.String shippingZip, java.lang.String shippingCountry,
252                    java.lang.String shippingPhone, java.lang.String ccName,
253                    java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
254                    int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
255                    throws com.liferay.portal.kernel.exception.PortalException,
256                            com.liferay.portal.kernel.exception.SystemException {
257                    try {
258                            MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
259                                            "updateOrder", _updateOrderParameterTypes5);
260    
261                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
262                                            orderId, billingFirstName, billingLastName,
263                                            billingEmailAddress, billingCompany, billingStreet,
264                                            billingCity, billingState, billingZip, billingCountry,
265                                            billingPhone, shipToBilling, shippingFirstName,
266                                            shippingLastName, shippingEmailAddress, shippingCompany,
267                                            shippingStreet, shippingCity, shippingState, shippingZip,
268                                            shippingCountry, shippingPhone, ccName, ccType, ccNumber,
269                                            ccExpMonth, ccExpYear, ccVerNumber, comments);
270    
271                            Object returnObj = null;
272    
273                            try {
274                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
275                            }
276                            catch (Exception e) {
277                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
278                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
279                                    }
280    
281                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
282                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
283                                    }
284    
285                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
286                            }
287    
288                            return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
289                    }
290                    catch (com.liferay.portal.kernel.exception.SystemException se) {
291                            _log.error(se, se);
292    
293                            throw se;
294                    }
295            }
296    
297            private static Log _log = LogFactoryUtil.getLog(ShoppingOrderServiceHttp.class);
298            private static final Class<?>[] _completeOrderParameterTypes0 = new Class[] {
299                            long.class, java.lang.String.class, java.lang.String.class,
300                            java.lang.String.class, double.class, java.lang.String.class,
301                            java.lang.String.class,
302                            com.liferay.portal.service.ServiceContext.class
303                    };
304            private static final Class<?>[] _deleteOrderParameterTypes1 = new Class[] {
305                            long.class, long.class
306                    };
307            private static final Class<?>[] _getOrderParameterTypes2 = new Class[] {
308                            long.class, long.class
309                    };
310            private static final Class<?>[] _sendEmailParameterTypes3 = new Class[] {
311                            long.class, long.class, java.lang.String.class,
312                            com.liferay.portal.service.ServiceContext.class
313                    };
314            private static final Class<?>[] _updateOrderParameterTypes4 = new Class[] {
315                            long.class, long.class, java.lang.String.class,
316                            java.lang.String.class, double.class, java.lang.String.class,
317                            java.lang.String.class
318                    };
319            private static final Class<?>[] _updateOrderParameterTypes5 = new Class[] {
320                            long.class, long.class, java.lang.String.class,
321                            java.lang.String.class, java.lang.String.class,
322                            java.lang.String.class, java.lang.String.class,
323                            java.lang.String.class, java.lang.String.class,
324                            java.lang.String.class, java.lang.String.class,
325                            java.lang.String.class, boolean.class, java.lang.String.class,
326                            java.lang.String.class, java.lang.String.class,
327                            java.lang.String.class, java.lang.String.class,
328                            java.lang.String.class, java.lang.String.class,
329                            java.lang.String.class, java.lang.String.class,
330                            java.lang.String.class, java.lang.String.class,
331                            java.lang.String.class, java.lang.String.class, int.class, int.class,
332                            java.lang.String.class, java.lang.String.class
333                    };
334    }