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.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.softwarecatalog.service.SCProductVersionServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil} 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       SCProductVersionServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil
054     * @generated
055     */
056    public class SCProductVersionServiceHttp {
057            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
058                    HttpPrincipal httpPrincipal, long productEntryId,
059                    java.lang.String version, java.lang.String changeLog,
060                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
061                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
062                    long[] frameworkVersionIds,
063                    com.liferay.portal.service.ServiceContext serviceContext)
064                    throws com.liferay.portal.kernel.exception.PortalException,
065                            com.liferay.portal.kernel.exception.SystemException {
066                    try {
067                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
068                                            "addProductVersion", long.class, java.lang.String.class,
069                                            java.lang.String.class, java.lang.String.class,
070                                            java.lang.String.class, boolean.class, boolean.class,
071                                            long[].class,
072                                            com.liferay.portal.service.ServiceContext.class);
073    
074                            MethodHandler methodHandler = new MethodHandler(methodKey,
075                                            productEntryId, version, changeLog, downloadPageURL,
076                                            directDownloadURL, testDirectDownloadURL,
077                                            repoStoreArtifact, frameworkVersionIds, serviceContext);
078    
079                            Object returnObj = null;
080    
081                            try {
082                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
083                            }
084                            catch (Exception e) {
085                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
086                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
087                                    }
088    
089                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
090                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
091                                    }
092    
093                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
094                            }
095    
096                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
097                    }
098                    catch (com.liferay.portal.kernel.exception.SystemException se) {
099                            _log.error(se, se);
100    
101                            throw se;
102                    }
103            }
104    
105            public static void deleteProductVersion(HttpPrincipal httpPrincipal,
106                    long productVersionId)
107                    throws com.liferay.portal.kernel.exception.PortalException,
108                            com.liferay.portal.kernel.exception.SystemException {
109                    try {
110                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
111                                            "deleteProductVersion", long.class);
112    
113                            MethodHandler methodHandler = new MethodHandler(methodKey,
114                                            productVersionId);
115    
116                            try {
117                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
118                            }
119                            catch (Exception e) {
120                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
121                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
122                                    }
123    
124                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
125                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
126                                    }
127    
128                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
129                            }
130                    }
131                    catch (com.liferay.portal.kernel.exception.SystemException se) {
132                            _log.error(se, se);
133    
134                            throw se;
135                    }
136            }
137    
138            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
139                    HttpPrincipal httpPrincipal, long productVersionId)
140                    throws com.liferay.portal.kernel.exception.PortalException,
141                            com.liferay.portal.kernel.exception.SystemException {
142                    try {
143                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
144                                            "getProductVersion", long.class);
145    
146                            MethodHandler methodHandler = new MethodHandler(methodKey,
147                                            productVersionId);
148    
149                            Object returnObj = null;
150    
151                            try {
152                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
153                            }
154                            catch (Exception e) {
155                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
156                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
157                                    }
158    
159                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
160                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
161                                    }
162    
163                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
164                            }
165    
166                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
167                    }
168                    catch (com.liferay.portal.kernel.exception.SystemException se) {
169                            _log.error(se, se);
170    
171                            throw se;
172                    }
173            }
174    
175            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
176                    HttpPrincipal httpPrincipal, long productEntryId, int start, int end)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    try {
180                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
181                                            "getProductVersions", long.class, int.class, int.class);
182    
183                            MethodHandler methodHandler = new MethodHandler(methodKey,
184                                            productEntryId, start, end);
185    
186                            Object returnObj = null;
187    
188                            try {
189                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
190                            }
191                            catch (Exception e) {
192                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
193                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
194                                    }
195    
196                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
197                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
198                                    }
199    
200                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
201                            }
202    
203                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
204                    }
205                    catch (com.liferay.portal.kernel.exception.SystemException se) {
206                            _log.error(se, se);
207    
208                            throw se;
209                    }
210            }
211    
212            public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
213                    long productEntryId)
214                    throws com.liferay.portal.kernel.exception.PortalException,
215                            com.liferay.portal.kernel.exception.SystemException {
216                    try {
217                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
218                                            "getProductVersionsCount", long.class);
219    
220                            MethodHandler methodHandler = new MethodHandler(methodKey,
221                                            productEntryId);
222    
223                            Object returnObj = null;
224    
225                            try {
226                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
227                            }
228                            catch (Exception e) {
229                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
230                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
231                                    }
232    
233                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
234                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
235                                    }
236    
237                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
238                            }
239    
240                            return ((Integer)returnObj).intValue();
241                    }
242                    catch (com.liferay.portal.kernel.exception.SystemException se) {
243                            _log.error(se, se);
244    
245                            throw se;
246                    }
247            }
248    
249            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
250                    HttpPrincipal httpPrincipal, long productVersionId,
251                    java.lang.String version, java.lang.String changeLog,
252                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
253                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
254                    long[] frameworkVersionIds)
255                    throws com.liferay.portal.kernel.exception.PortalException,
256                            com.liferay.portal.kernel.exception.SystemException {
257                    try {
258                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class.getName(),
259                                            "updateProductVersion", long.class, java.lang.String.class,
260                                            java.lang.String.class, java.lang.String.class,
261                                            java.lang.String.class, boolean.class, boolean.class,
262                                            long[].class);
263    
264                            MethodHandler methodHandler = new MethodHandler(methodKey,
265                                            productVersionId, version, changeLog, downloadPageURL,
266                                            directDownloadURL, testDirectDownloadURL,
267                                            repoStoreArtifact, frameworkVersionIds);
268    
269                            Object returnObj = null;
270    
271                            try {
272                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
273                            }
274                            catch (Exception e) {
275                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
276                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
277                                    }
278    
279                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
280                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
281                                    }
282    
283                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
284                            }
285    
286                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
287                    }
288                    catch (com.liferay.portal.kernel.exception.SystemException se) {
289                            _log.error(se, se);
290    
291                            throw se;
292                    }
293            }
294    
295            private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
296    }