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.SCProductVersionServiceUtil;
25  
26  /**
27   * <a href="SCProductVersionServiceHttp.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.SCProductVersionServiceUtil} 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       SCProductVersionServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil
61   * @generated
62   */
63  public class SCProductVersionServiceHttp {
64      public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
65          HttpPrincipal httpPrincipal, long productEntryId,
66          java.lang.String version, java.lang.String changeLog,
67          java.lang.String downloadPageURL, java.lang.String directDownloadURL,
68          boolean testDirectDownloadURL, boolean repoStoreArtifact,
69          long[] frameworkVersionIds,
70          com.liferay.portal.service.ServiceContext serviceContext)
71          throws com.liferay.portal.PortalException,
72              com.liferay.portal.SystemException {
73          try {
74              MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
75                      "addProductVersion", _addProductVersionParameterTypes0);
76  
77              MethodHandler methodHandler = new MethodHandler(methodKey,
78                      productEntryId, version, changeLog, downloadPageURL,
79                      directDownloadURL, testDirectDownloadURL,
80                      repoStoreArtifact, frameworkVersionIds, serviceContext);
81  
82              Object returnObj = null;
83  
84              try {
85                  returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
86              }
87              catch (Exception e) {
88                  if (e instanceof com.liferay.portal.PortalException) {
89                      throw (com.liferay.portal.PortalException)e;
90                  }
91  
92                  if (e instanceof com.liferay.portal.SystemException) {
93                      throw (com.liferay.portal.SystemException)e;
94                  }
95  
96                  throw new com.liferay.portal.SystemException(e);
97              }
98  
99              return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
100         }
101         catch (com.liferay.portal.SystemException se) {
102             _log.error(se, se);
103 
104             throw se;
105         }
106     }
107 
108     public static void deleteProductVersion(HttpPrincipal httpPrincipal,
109         long productVersionId)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         try {
113             MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
114                     "deleteProductVersion", _deleteProductVersionParameterTypes1);
115 
116             MethodHandler methodHandler = new MethodHandler(methodKey,
117                     productVersionId);
118 
119             try {
120                 TunnelUtil.invoke(httpPrincipal, methodHandler);
121             }
122             catch (Exception e) {
123                 if (e instanceof com.liferay.portal.PortalException) {
124                     throw (com.liferay.portal.PortalException)e;
125                 }
126 
127                 if (e instanceof com.liferay.portal.SystemException) {
128                     throw (com.liferay.portal.SystemException)e;
129                 }
130 
131                 throw new com.liferay.portal.SystemException(e);
132             }
133         }
134         catch (com.liferay.portal.SystemException se) {
135             _log.error(se, se);
136 
137             throw se;
138         }
139     }
140 
141     public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
142         HttpPrincipal httpPrincipal, long productVersionId)
143         throws com.liferay.portal.PortalException,
144             com.liferay.portal.SystemException {
145         try {
146             MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
147                     "getProductVersion", _getProductVersionParameterTypes2);
148 
149             MethodHandler methodHandler = new MethodHandler(methodKey,
150                     productVersionId);
151 
152             Object returnObj = null;
153 
154             try {
155                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
156             }
157             catch (Exception e) {
158                 if (e instanceof com.liferay.portal.PortalException) {
159                     throw (com.liferay.portal.PortalException)e;
160                 }
161 
162                 if (e instanceof com.liferay.portal.SystemException) {
163                     throw (com.liferay.portal.SystemException)e;
164                 }
165 
166                 throw new com.liferay.portal.SystemException(e);
167             }
168 
169             return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
170         }
171         catch (com.liferay.portal.SystemException se) {
172             _log.error(se, se);
173 
174             throw se;
175         }
176     }
177 
178     public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
179         HttpPrincipal httpPrincipal, long productEntryId, int start, int end)
180         throws com.liferay.portal.PortalException,
181             com.liferay.portal.SystemException {
182         try {
183             MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
184                     "getProductVersions", _getProductVersionsParameterTypes3);
185 
186             MethodHandler methodHandler = new MethodHandler(methodKey,
187                     productEntryId, start, end);
188 
189             Object returnObj = null;
190 
191             try {
192                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
193             }
194             catch (Exception e) {
195                 if (e instanceof com.liferay.portal.PortalException) {
196                     throw (com.liferay.portal.PortalException)e;
197                 }
198 
199                 if (e instanceof com.liferay.portal.SystemException) {
200                     throw (com.liferay.portal.SystemException)e;
201                 }
202 
203                 throw new com.liferay.portal.SystemException(e);
204             }
205 
206             return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
207         }
208         catch (com.liferay.portal.SystemException se) {
209             _log.error(se, se);
210 
211             throw se;
212         }
213     }
214 
215     public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
216         long productEntryId)
217         throws com.liferay.portal.PortalException,
218             com.liferay.portal.SystemException {
219         try {
220             MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
221                     "getProductVersionsCount",
222                     _getProductVersionsCountParameterTypes4);
223 
224             MethodHandler methodHandler = new MethodHandler(methodKey,
225                     productEntryId);
226 
227             Object returnObj = null;
228 
229             try {
230                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
231             }
232             catch (Exception e) {
233                 if (e instanceof com.liferay.portal.PortalException) {
234                     throw (com.liferay.portal.PortalException)e;
235                 }
236 
237                 if (e instanceof com.liferay.portal.SystemException) {
238                     throw (com.liferay.portal.SystemException)e;
239                 }
240 
241                 throw new com.liferay.portal.SystemException(e);
242             }
243 
244             return ((Integer)returnObj).intValue();
245         }
246         catch (com.liferay.portal.SystemException se) {
247             _log.error(se, se);
248 
249             throw se;
250         }
251     }
252 
253     public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
254         HttpPrincipal httpPrincipal, long productVersionId,
255         java.lang.String version, java.lang.String changeLog,
256         java.lang.String downloadPageURL, java.lang.String directDownloadURL,
257         boolean testDirectDownloadURL, boolean repoStoreArtifact,
258         long[] frameworkVersionIds)
259         throws com.liferay.portal.PortalException,
260             com.liferay.portal.SystemException {
261         try {
262             MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
263                     "updateProductVersion", _updateProductVersionParameterTypes5);
264 
265             MethodHandler methodHandler = new MethodHandler(methodKey,
266                     productVersionId, version, changeLog, downloadPageURL,
267                     directDownloadURL, testDirectDownloadURL,
268                     repoStoreArtifact, frameworkVersionIds);
269 
270             Object returnObj = null;
271 
272             try {
273                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
274             }
275             catch (Exception e) {
276                 if (e instanceof com.liferay.portal.PortalException) {
277                     throw (com.liferay.portal.PortalException)e;
278                 }
279 
280                 if (e instanceof com.liferay.portal.SystemException) {
281                     throw (com.liferay.portal.SystemException)e;
282                 }
283 
284                 throw new com.liferay.portal.SystemException(e);
285             }
286 
287             return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
288         }
289         catch (com.liferay.portal.SystemException se) {
290             _log.error(se, se);
291 
292             throw se;
293         }
294     }
295 
296     private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
297     private static final Class<?>[] _addProductVersionParameterTypes0 = new Class[] {
298             long.class, java.lang.String.class, java.lang.String.class,
299             java.lang.String.class, java.lang.String.class, boolean.class,
300             boolean.class, long[].class,
301             com.liferay.portal.service.ServiceContext.class
302         };
303     private static final Class<?>[] _deleteProductVersionParameterTypes1 = new Class[] {
304             long.class
305         };
306     private static final Class<?>[] _getProductVersionParameterTypes2 = new Class[] {
307             long.class
308         };
309     private static final Class<?>[] _getProductVersionsParameterTypes3 = new Class[] {
310             long.class, int.class, int.class
311         };
312     private static final Class<?>[] _getProductVersionsCountParameterTypes4 = new Class[] {
313             long.class
314         };
315     private static final Class<?>[] _updateProductVersionParameterTypes5 = new Class[] {
316             long.class, java.lang.String.class, java.lang.String.class,
317             java.lang.String.class, java.lang.String.class, boolean.class,
318             boolean.class, long[].class
319         };
320 }