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.softwarecatalog.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.softwarecatalog.service.SCProductEntryServiceUtil;
25  
26  /**
27   * <a href="SCProductEntryServiceHttp.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.softwarecatalog.service.SCProductEntryServiceUtil} 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       SCProductEntryServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil
61   * @generated
62   */
63  public class SCProductEntryServiceHttp {
64      public static com.liferay.portlet.softwarecatalog.model.SCProductEntry addProductEntry(
65          HttpPrincipal httpPrincipal, java.lang.String name,
66          java.lang.String type, java.lang.String tags,
67          java.lang.String shortDescription, java.lang.String longDescription,
68          java.lang.String pageURL, java.lang.String author,
69          java.lang.String repoGroupId, java.lang.String repoArtifactId,
70          long[] licenseIds, java.util.List<byte[]> thumbnails,
71          java.util.List<byte[]> fullImages,
72          com.liferay.portal.service.ServiceContext serviceContext)
73          throws com.liferay.portal.PortalException,
74              com.liferay.portal.SystemException {
75          try {
76              MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
77                      "addProductEntry", _addProductEntryParameterTypes0);
78  
79              MethodHandler methodHandler = new MethodHandler(methodKey, name,
80                      type, tags, shortDescription, longDescription, pageURL,
81                      author, repoGroupId, repoArtifactId, licenseIds,
82                      thumbnails, fullImages, serviceContext);
83  
84              Object returnObj = null;
85  
86              try {
87                  returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
88              }
89              catch (Exception e) {
90                  if (e instanceof com.liferay.portal.PortalException) {
91                      throw (com.liferay.portal.PortalException)e;
92                  }
93  
94                  if (e instanceof com.liferay.portal.SystemException) {
95                      throw (com.liferay.portal.SystemException)e;
96                  }
97  
98                  throw new com.liferay.portal.SystemException(e);
99              }
100 
101             return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
102         }
103         catch (com.liferay.portal.SystemException se) {
104             _log.error(se, se);
105 
106             throw se;
107         }
108     }
109 
110     public static void deleteProductEntry(HttpPrincipal httpPrincipal,
111         long productEntryId)
112         throws com.liferay.portal.PortalException,
113             com.liferay.portal.SystemException {
114         try {
115             MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
116                     "deleteProductEntry", _deleteProductEntryParameterTypes1);
117 
118             MethodHandler methodHandler = new MethodHandler(methodKey,
119                     productEntryId);
120 
121             try {
122                 TunnelUtil.invoke(httpPrincipal, methodHandler);
123             }
124             catch (Exception e) {
125                 if (e instanceof com.liferay.portal.PortalException) {
126                     throw (com.liferay.portal.PortalException)e;
127                 }
128 
129                 if (e instanceof com.liferay.portal.SystemException) {
130                     throw (com.liferay.portal.SystemException)e;
131                 }
132 
133                 throw new com.liferay.portal.SystemException(e);
134             }
135         }
136         catch (com.liferay.portal.SystemException se) {
137             _log.error(se, se);
138 
139             throw se;
140         }
141     }
142 
143     public static com.liferay.portlet.softwarecatalog.model.SCProductEntry getProductEntry(
144         HttpPrincipal httpPrincipal, long productEntryId)
145         throws com.liferay.portal.PortalException,
146             com.liferay.portal.SystemException {
147         try {
148             MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
149                     "getProductEntry", _getProductEntryParameterTypes2);
150 
151             MethodHandler methodHandler = new MethodHandler(methodKey,
152                     productEntryId);
153 
154             Object returnObj = null;
155 
156             try {
157                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
158             }
159             catch (Exception e) {
160                 if (e instanceof com.liferay.portal.PortalException) {
161                     throw (com.liferay.portal.PortalException)e;
162                 }
163 
164                 if (e instanceof com.liferay.portal.SystemException) {
165                     throw (com.liferay.portal.SystemException)e;
166                 }
167 
168                 throw new com.liferay.portal.SystemException(e);
169             }
170 
171             return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
172         }
173         catch (com.liferay.portal.SystemException se) {
174             _log.error(se, se);
175 
176             throw se;
177         }
178     }
179 
180     public static com.liferay.portlet.softwarecatalog.model.SCProductEntry updateProductEntry(
181         HttpPrincipal httpPrincipal, long productEntryId,
182         java.lang.String name, java.lang.String type, java.lang.String tags,
183         java.lang.String shortDescription, java.lang.String longDescription,
184         java.lang.String pageURL, java.lang.String author,
185         java.lang.String repoGroupId, java.lang.String repoArtifactId,
186         long[] licenseIds, java.util.List<byte[]> thumbnails,
187         java.util.List<byte[]> fullImages)
188         throws com.liferay.portal.PortalException,
189             com.liferay.portal.SystemException {
190         try {
191             MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
192                     "updateProductEntry", _updateProductEntryParameterTypes3);
193 
194             MethodHandler methodHandler = new MethodHandler(methodKey,
195                     productEntryId, name, type, tags, shortDescription,
196                     longDescription, pageURL, author, repoGroupId,
197                     repoArtifactId, licenseIds, thumbnails, fullImages);
198 
199             Object returnObj = null;
200 
201             try {
202                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
203             }
204             catch (Exception e) {
205                 if (e instanceof com.liferay.portal.PortalException) {
206                     throw (com.liferay.portal.PortalException)e;
207                 }
208 
209                 if (e instanceof com.liferay.portal.SystemException) {
210                     throw (com.liferay.portal.SystemException)e;
211                 }
212 
213                 throw new com.liferay.portal.SystemException(e);
214             }
215 
216             return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
217         }
218         catch (com.liferay.portal.SystemException se) {
219             _log.error(se, se);
220 
221             throw se;
222         }
223     }
224 
225     private static Log _log = LogFactoryUtil.getLog(SCProductEntryServiceHttp.class);
226     private static final Class<?>[] _addProductEntryParameterTypes0 = new Class[] {
227             java.lang.String.class, java.lang.String.class,
228             java.lang.String.class, java.lang.String.class,
229             java.lang.String.class, java.lang.String.class,
230             java.lang.String.class, java.lang.String.class,
231             java.lang.String.class, long[].class, java.util.List.class,
232             java.util.List.class,
233             com.liferay.portal.service.ServiceContext.class
234         };
235     private static final Class<?>[] _deleteProductEntryParameterTypes1 = new Class[] {
236             long.class
237         };
238     private static final Class<?>[] _getProductEntryParameterTypes2 = new Class[] {
239             long.class
240         };
241     private static final Class<?>[] _updateProductEntryParameterTypes3 = new Class[] {
242             long.class, java.lang.String.class, java.lang.String.class,
243             java.lang.String.class, java.lang.String.class,
244             java.lang.String.class, java.lang.String.class,
245             java.lang.String.class, java.lang.String.class,
246             java.lang.String.class, long[].class, java.util.List.class,
247             java.util.List.class
248         };
249 }