1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.shopping.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.MethodHandler;
20  import com.liferay.portal.kernel.util.MethodKey;
21  import com.liferay.portal.security.auth.HttpPrincipal;
22  import com.liferay.portal.service.http.TunnelUtil;
23  
24  import com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil;
25  
26  /**
27   * <a href="ShoppingOrderServiceHttp.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides a HTTP utility for the
36   * {@link com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil} service utility. The
37   * static methods of this class calls the same methods of the service utility.
38   * However, the signatures are different because it requires an additional
39   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
40   * </p>
41   *
42   * <p>
43   * The benefits of using the HTTP utility is that it is fast and allows for
44   * tunneling without the cost of serializing to text. The drawback is that it
45   * only works with Java.
46   * </p>
47   *
48   * <p>
49   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
50   * configure security.
51   * </p>
52   *
53   * <p>
54   * The HTTP utility is only generated for remote services.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       ShoppingOrderServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.shopping.service.ShoppingOrderServiceUtil
61   * @generated
62   */
63  public class ShoppingOrderServiceHttp {
64      public static void completeOrder(HttpPrincipal httpPrincipal, long groupId,
65          java.lang.String number, java.lang.String ppTxnId,
66          java.lang.String ppPaymentStatus, double ppPaymentGross,
67          java.lang.String ppReceiverEmail, java.lang.String ppPayerEmail)
68          throws com.liferay.portal.PortalException,
69              com.liferay.portal.SystemException {
70          try {
71              MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
72                      "completeOrder", _completeOrderParameterTypes0);
73  
74              MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
75                      number, ppTxnId, ppPaymentStatus, ppPaymentGross,
76                      ppReceiverEmail, ppPayerEmail);
77  
78              try {
79                  TunnelUtil.invoke(httpPrincipal, methodHandler);
80              }
81              catch (Exception e) {
82                  if (e instanceof com.liferay.portal.PortalException) {
83                      throw (com.liferay.portal.PortalException)e;
84                  }
85  
86                  if (e instanceof com.liferay.portal.SystemException) {
87                      throw (com.liferay.portal.SystemException)e;
88                  }
89  
90                  throw new com.liferay.portal.SystemException(e);
91              }
92          }
93          catch (com.liferay.portal.SystemException se) {
94              _log.error(se, se);
95  
96              throw se;
97          }
98      }
99  
100     public static void deleteOrder(HttpPrincipal httpPrincipal, long groupId,
101         long orderId)
102         throws com.liferay.portal.PortalException,
103             com.liferay.portal.SystemException {
104         try {
105             MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
106                     "deleteOrder", _deleteOrderParameterTypes1);
107 
108             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
109                     orderId);
110 
111             try {
112                 TunnelUtil.invoke(httpPrincipal, methodHandler);
113             }
114             catch (Exception e) {
115                 if (e instanceof com.liferay.portal.PortalException) {
116                     throw (com.liferay.portal.PortalException)e;
117                 }
118 
119                 if (e instanceof com.liferay.portal.SystemException) {
120                     throw (com.liferay.portal.SystemException)e;
121                 }
122 
123                 throw new com.liferay.portal.SystemException(e);
124             }
125         }
126         catch (com.liferay.portal.SystemException se) {
127             _log.error(se, se);
128 
129             throw se;
130         }
131     }
132 
133     public static com.liferay.portlet.shopping.model.ShoppingOrder getOrder(
134         HttpPrincipal httpPrincipal, long groupId, long orderId)
135         throws com.liferay.portal.PortalException,
136             com.liferay.portal.SystemException {
137         try {
138             MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
139                     "getOrder", _getOrderParameterTypes2);
140 
141             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
142                     orderId);
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.PortalException) {
151                     throw (com.liferay.portal.PortalException)e;
152                 }
153 
154                 if (e instanceof com.liferay.portal.SystemException) {
155                     throw (com.liferay.portal.SystemException)e;
156                 }
157 
158                 throw new com.liferay.portal.SystemException(e);
159             }
160 
161             return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
162         }
163         catch (com.liferay.portal.SystemException se) {
164             _log.error(se, se);
165 
166             throw se;
167         }
168     }
169 
170     public static void sendEmail(HttpPrincipal httpPrincipal, long groupId,
171         long orderId, java.lang.String emailType)
172         throws com.liferay.portal.PortalException,
173             com.liferay.portal.SystemException {
174         try {
175             MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
176                     "sendEmail", _sendEmailParameterTypes3);
177 
178             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
179                     orderId, emailType);
180 
181             try {
182                 TunnelUtil.invoke(httpPrincipal, methodHandler);
183             }
184             catch (Exception e) {
185                 if (e instanceof com.liferay.portal.PortalException) {
186                     throw (com.liferay.portal.PortalException)e;
187                 }
188 
189                 if (e instanceof com.liferay.portal.SystemException) {
190                     throw (com.liferay.portal.SystemException)e;
191                 }
192 
193                 throw new com.liferay.portal.SystemException(e);
194             }
195         }
196         catch (com.liferay.portal.SystemException se) {
197             _log.error(se, se);
198 
199             throw se;
200         }
201     }
202 
203     public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
204         HttpPrincipal httpPrincipal, long groupId, long orderId,
205         java.lang.String ppTxnId, java.lang.String ppPaymentStatus,
206         double ppPaymentGross, java.lang.String ppReceiverEmail,
207         java.lang.String ppPayerEmail)
208         throws com.liferay.portal.PortalException,
209             com.liferay.portal.SystemException {
210         try {
211             MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
212                     "updateOrder", _updateOrderParameterTypes4);
213 
214             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
215                     orderId, ppTxnId, ppPaymentStatus, ppPaymentGross,
216                     ppReceiverEmail, ppPayerEmail);
217 
218             Object returnObj = null;
219 
220             try {
221                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
222             }
223             catch (Exception e) {
224                 if (e instanceof com.liferay.portal.PortalException) {
225                     throw (com.liferay.portal.PortalException)e;
226                 }
227 
228                 if (e instanceof com.liferay.portal.SystemException) {
229                     throw (com.liferay.portal.SystemException)e;
230                 }
231 
232                 throw new com.liferay.portal.SystemException(e);
233             }
234 
235             return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
236         }
237         catch (com.liferay.portal.SystemException se) {
238             _log.error(se, se);
239 
240             throw se;
241         }
242     }
243 
244     public static com.liferay.portlet.shopping.model.ShoppingOrder updateOrder(
245         HttpPrincipal httpPrincipal, long groupId, long orderId,
246         java.lang.String billingFirstName, java.lang.String billingLastName,
247         java.lang.String billingEmailAddress, java.lang.String billingCompany,
248         java.lang.String billingStreet, java.lang.String billingCity,
249         java.lang.String billingState, java.lang.String billingZip,
250         java.lang.String billingCountry, java.lang.String billingPhone,
251         boolean shipToBilling, java.lang.String shippingFirstName,
252         java.lang.String shippingLastName,
253         java.lang.String shippingEmailAddress,
254         java.lang.String shippingCompany, java.lang.String shippingStreet,
255         java.lang.String shippingCity, java.lang.String shippingState,
256         java.lang.String shippingZip, java.lang.String shippingCountry,
257         java.lang.String shippingPhone, java.lang.String ccName,
258         java.lang.String ccType, java.lang.String ccNumber, int ccExpMonth,
259         int ccExpYear, java.lang.String ccVerNumber, java.lang.String comments)
260         throws com.liferay.portal.PortalException,
261             com.liferay.portal.SystemException {
262         try {
263             MethodKey methodKey = new MethodKey(ShoppingOrderServiceUtil.class.getName(),
264                     "updateOrder", _updateOrderParameterTypes5);
265 
266             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
267                     orderId, billingFirstName, billingLastName,
268                     billingEmailAddress, billingCompany, billingStreet,
269                     billingCity, billingState, billingZip, billingCountry,
270                     billingPhone, shipToBilling, shippingFirstName,
271                     shippingLastName, shippingEmailAddress, shippingCompany,
272                     shippingStreet, shippingCity, shippingState, shippingZip,
273                     shippingCountry, shippingPhone, ccName, ccType, ccNumber,
274                     ccExpMonth, ccExpYear, ccVerNumber, comments);
275 
276             Object returnObj = null;
277 
278             try {
279                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
280             }
281             catch (Exception e) {
282                 if (e instanceof com.liferay.portal.PortalException) {
283                     throw (com.liferay.portal.PortalException)e;
284                 }
285 
286                 if (e instanceof com.liferay.portal.SystemException) {
287                     throw (com.liferay.portal.SystemException)e;
288                 }
289 
290                 throw new com.liferay.portal.SystemException(e);
291             }
292 
293             return (com.liferay.portlet.shopping.model.ShoppingOrder)returnObj;
294         }
295         catch (com.liferay.portal.SystemException se) {
296             _log.error(se, se);
297 
298             throw se;
299         }
300     }
301 
302     private static Log _log = LogFactoryUtil.getLog(ShoppingOrderServiceHttp.class);
303     private static final Class<?>[] _completeOrderParameterTypes0 = new Class[] {
304             long.class, java.lang.String.class, java.lang.String.class,
305             java.lang.String.class, double.class, java.lang.String.class,
306             java.lang.String.class
307         };
308     private static final Class<?>[] _deleteOrderParameterTypes1 = new Class[] {
309             long.class, long.class
310         };
311     private static final Class<?>[] _getOrderParameterTypes2 = new Class[] {
312             long.class, long.class
313         };
314     private static final Class<?>[] _sendEmailParameterTypes3 = new Class[] {
315             long.class, long.class, java.lang.String.class
316         };
317     private static final Class<?>[] _updateOrderParameterTypes4 = new Class[] {
318             long.class, long.class, java.lang.String.class,
319             java.lang.String.class, double.class, java.lang.String.class,
320             java.lang.String.class
321         };
322     private static final Class<?>[] _updateOrderParameterTypes5 = new Class[] {
323             long.class, long.class, java.lang.String.class,
324             java.lang.String.class, java.lang.String.class,
325             java.lang.String.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, boolean.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,
332             java.lang.String.class, java.lang.String.class,
333             java.lang.String.class, java.lang.String.class,
334             java.lang.String.class, java.lang.String.class, int.class, int.class,
335             java.lang.String.class, java.lang.String.class
336         };
337 }