001    /**
002     * Copyright (c) 2000-2010 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.softwarecatalog.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.BooleanWrapper;
020    import com.liferay.portal.kernel.util.IntegerWrapper;
021    import com.liferay.portal.kernel.util.LongWrapper;
022    import com.liferay.portal.kernel.util.MethodWrapper;
023    import com.liferay.portal.kernel.util.NullWrapper;
024    import com.liferay.portal.security.auth.HttpPrincipal;
025    import com.liferay.portal.service.http.TunnelUtil;
026    
027    import com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil;
028    
029    /**
030     * <p>
031     * This class provides a HTTP utility for the
032     * {@link com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil} service utility. The
033     * static methods of this class calls the same methods of the service utility.
034     * However, the signatures are different because it requires an additional
035     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
036     * </p>
037     *
038     * <p>
039     * The benefits of using the HTTP utility is that it is fast and allows for
040     * tunneling without the cost of serializing to text. The drawback is that it
041     * only works with Java.
042     * </p>
043     *
044     * <p>
045     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
046     * configure security.
047     * </p>
048     *
049     * <p>
050     * The HTTP utility is only generated for remote services.
051     * </p>
052     *
053     * @author    Brian Wing Shun Chan
054     * @see       SCProductVersionServiceSoap
055     * @see       com.liferay.portal.security.auth.HttpPrincipal
056     * @see       com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil
057     * @generated
058     */
059    public class SCProductVersionServiceHttp {
060            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
061                    HttpPrincipal httpPrincipal, long productEntryId,
062                    java.lang.String version, java.lang.String changeLog,
063                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
064                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
065                    long[] frameworkVersionIds,
066                    com.liferay.portal.service.ServiceContext serviceContext)
067                    throws com.liferay.portal.kernel.exception.PortalException,
068                            com.liferay.portal.kernel.exception.SystemException {
069                    try {
070                            Object paramObj0 = new LongWrapper(productEntryId);
071    
072                            Object paramObj1 = version;
073    
074                            if (version == null) {
075                                    paramObj1 = new NullWrapper("java.lang.String");
076                            }
077    
078                            Object paramObj2 = changeLog;
079    
080                            if (changeLog == null) {
081                                    paramObj2 = new NullWrapper("java.lang.String");
082                            }
083    
084                            Object paramObj3 = downloadPageURL;
085    
086                            if (downloadPageURL == null) {
087                                    paramObj3 = new NullWrapper("java.lang.String");
088                            }
089    
090                            Object paramObj4 = directDownloadURL;
091    
092                            if (directDownloadURL == null) {
093                                    paramObj4 = new NullWrapper("java.lang.String");
094                            }
095    
096                            Object paramObj5 = new BooleanWrapper(testDirectDownloadURL);
097    
098                            Object paramObj6 = new BooleanWrapper(repoStoreArtifact);
099    
100                            Object paramObj7 = frameworkVersionIds;
101    
102                            if (frameworkVersionIds == null) {
103                                    paramObj7 = new NullWrapper("[J");
104                            }
105    
106                            Object paramObj8 = serviceContext;
107    
108                            if (serviceContext == null) {
109                                    paramObj8 = new NullWrapper(
110                                                    "com.liferay.portal.service.ServiceContext");
111                            }
112    
113                            MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
114                                            "addProductVersion",
115                                            new Object[] {
116                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
117                                                    paramObj5, paramObj6, paramObj7, paramObj8
118                                            });
119    
120                            Object returnObj = null;
121    
122                            try {
123                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
124                            }
125                            catch (Exception e) {
126                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
127                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
128                                    }
129    
130                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
131                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
132                                    }
133    
134                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
135                            }
136    
137                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
138                    }
139                    catch (com.liferay.portal.kernel.exception.SystemException se) {
140                            _log.error(se, se);
141    
142                            throw se;
143                    }
144            }
145    
146            public static void deleteProductVersion(HttpPrincipal httpPrincipal,
147                    long productVersionId)
148                    throws com.liferay.portal.kernel.exception.PortalException,
149                            com.liferay.portal.kernel.exception.SystemException {
150                    try {
151                            Object paramObj0 = new LongWrapper(productVersionId);
152    
153                            MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
154                                            "deleteProductVersion", new Object[] { paramObj0 });
155    
156                            try {
157                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
158                            }
159                            catch (Exception e) {
160                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
161                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
162                                    }
163    
164                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
165                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
166                                    }
167    
168                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
169                            }
170                    }
171                    catch (com.liferay.portal.kernel.exception.SystemException se) {
172                            _log.error(se, se);
173    
174                            throw se;
175                    }
176            }
177    
178            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
179                    HttpPrincipal httpPrincipal, long productVersionId)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    try {
183                            Object paramObj0 = new LongWrapper(productVersionId);
184    
185                            MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
186                                            "getProductVersion", new Object[] { paramObj0 });
187    
188                            Object returnObj = null;
189    
190                            try {
191                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
192                            }
193                            catch (Exception e) {
194                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
195                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
196                                    }
197    
198                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
199                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
200                                    }
201    
202                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
203                            }
204    
205                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
206                    }
207                    catch (com.liferay.portal.kernel.exception.SystemException se) {
208                            _log.error(se, se);
209    
210                            throw se;
211                    }
212            }
213    
214            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
215                    HttpPrincipal httpPrincipal, long productEntryId, int start, int end)
216                    throws com.liferay.portal.kernel.exception.PortalException,
217                            com.liferay.portal.kernel.exception.SystemException {
218                    try {
219                            Object paramObj0 = new LongWrapper(productEntryId);
220    
221                            Object paramObj1 = new IntegerWrapper(start);
222    
223                            Object paramObj2 = new IntegerWrapper(end);
224    
225                            MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
226                                            "getProductVersions",
227                                            new Object[] { paramObj0, paramObj1, paramObj2 });
228    
229                            Object returnObj = null;
230    
231                            try {
232                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
233                            }
234                            catch (Exception e) {
235                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
236                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
237                                    }
238    
239                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
240                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
241                                    }
242    
243                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
244                            }
245    
246                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
247                    }
248                    catch (com.liferay.portal.kernel.exception.SystemException se) {
249                            _log.error(se, se);
250    
251                            throw se;
252                    }
253            }
254    
255            public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
256                    long productEntryId)
257                    throws com.liferay.portal.kernel.exception.PortalException,
258                            com.liferay.portal.kernel.exception.SystemException {
259                    try {
260                            Object paramObj0 = new LongWrapper(productEntryId);
261    
262                            MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
263                                            "getProductVersionsCount", new Object[] { paramObj0 });
264    
265                            Object returnObj = null;
266    
267                            try {
268                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
269                            }
270                            catch (Exception e) {
271                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
272                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
273                                    }
274    
275                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
276                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
277                                    }
278    
279                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
280                            }
281    
282                            return ((Integer)returnObj).intValue();
283                    }
284                    catch (com.liferay.portal.kernel.exception.SystemException se) {
285                            _log.error(se, se);
286    
287                            throw se;
288                    }
289            }
290    
291            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
292                    HttpPrincipal httpPrincipal, long productVersionId,
293                    java.lang.String version, java.lang.String changeLog,
294                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
295                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
296                    long[] frameworkVersionIds)
297                    throws com.liferay.portal.kernel.exception.PortalException,
298                            com.liferay.portal.kernel.exception.SystemException {
299                    try {
300                            Object paramObj0 = new LongWrapper(productVersionId);
301    
302                            Object paramObj1 = version;
303    
304                            if (version == null) {
305                                    paramObj1 = new NullWrapper("java.lang.String");
306                            }
307    
308                            Object paramObj2 = changeLog;
309    
310                            if (changeLog == null) {
311                                    paramObj2 = new NullWrapper("java.lang.String");
312                            }
313    
314                            Object paramObj3 = downloadPageURL;
315    
316                            if (downloadPageURL == null) {
317                                    paramObj3 = new NullWrapper("java.lang.String");
318                            }
319    
320                            Object paramObj4 = directDownloadURL;
321    
322                            if (directDownloadURL == null) {
323                                    paramObj4 = new NullWrapper("java.lang.String");
324                            }
325    
326                            Object paramObj5 = new BooleanWrapper(testDirectDownloadURL);
327    
328                            Object paramObj6 = new BooleanWrapper(repoStoreArtifact);
329    
330                            Object paramObj7 = frameworkVersionIds;
331    
332                            if (frameworkVersionIds == null) {
333                                    paramObj7 = new NullWrapper("[J");
334                            }
335    
336                            MethodWrapper methodWrapper = new MethodWrapper(SCProductVersionServiceUtil.class.getName(),
337                                            "updateProductVersion",
338                                            new Object[] {
339                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
340                                                    paramObj5, paramObj6, paramObj7
341                                            });
342    
343                            Object returnObj = null;
344    
345                            try {
346                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
347                            }
348                            catch (Exception e) {
349                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
350                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
351                                    }
352    
353                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
354                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
355                                    }
356    
357                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
358                            }
359    
360                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
361                    }
362                    catch (com.liferay.portal.kernel.exception.SystemException se) {
363                            _log.error(se, se);
364    
365                            throw se;
366                    }
367            }
368    
369            private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
370    }