001    /**
002     * Copyright (c) 2000-2013 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     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author Brian Wing Shun Chan
049     * @see SCProductVersionServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil
052     * @generated
053     */
054    public class SCProductVersionServiceHttp {
055            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
056                    HttpPrincipal httpPrincipal, long productEntryId,
057                    java.lang.String version, java.lang.String changeLog,
058                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
059                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
060                    long[] frameworkVersionIds,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException,
063                            com.liferay.portal.kernel.exception.SystemException {
064                    try {
065                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
066                                            "addProductVersion", _addProductVersionParameterTypes0);
067    
068                            MethodHandler methodHandler = new MethodHandler(methodKey,
069                                            productEntryId, version, changeLog, downloadPageURL,
070                                            directDownloadURL, testDirectDownloadURL,
071                                            repoStoreArtifact, frameworkVersionIds, serviceContext);
072    
073                            Object returnObj = null;
074    
075                            try {
076                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
077                            }
078                            catch (Exception e) {
079                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
080                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
081                                    }
082    
083                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
084                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
085                                    }
086    
087                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
088                            }
089    
090                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
091                    }
092                    catch (com.liferay.portal.kernel.exception.SystemException se) {
093                            _log.error(se, se);
094    
095                            throw se;
096                    }
097            }
098    
099            public static void deleteProductVersion(HttpPrincipal httpPrincipal,
100                    long productVersionId)
101                    throws com.liferay.portal.kernel.exception.PortalException,
102                            com.liferay.portal.kernel.exception.SystemException {
103                    try {
104                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
105                                            "deleteProductVersion", _deleteProductVersionParameterTypes1);
106    
107                            MethodHandler methodHandler = new MethodHandler(methodKey,
108                                            productVersionId);
109    
110                            try {
111                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
112                            }
113                            catch (Exception e) {
114                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
115                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
116                                    }
117    
118                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
119                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
120                                    }
121    
122                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
123                            }
124                    }
125                    catch (com.liferay.portal.kernel.exception.SystemException se) {
126                            _log.error(se, se);
127    
128                            throw se;
129                    }
130            }
131    
132            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
133                    HttpPrincipal httpPrincipal, long productVersionId)
134                    throws com.liferay.portal.kernel.exception.PortalException,
135                            com.liferay.portal.kernel.exception.SystemException {
136                    try {
137                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
138                                            "getProductVersion", _getProductVersionParameterTypes2);
139    
140                            MethodHandler methodHandler = new MethodHandler(methodKey,
141                                            productVersionId);
142    
143                            Object returnObj = null;
144    
145                            try {
146                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
147                            }
148                            catch (Exception e) {
149                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
150                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
151                                    }
152    
153                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
154                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
155                                    }
156    
157                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
158                            }
159    
160                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
161                    }
162                    catch (com.liferay.portal.kernel.exception.SystemException se) {
163                            _log.error(se, se);
164    
165                            throw se;
166                    }
167            }
168    
169            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
170                    HttpPrincipal httpPrincipal, long productEntryId, int start, int end)
171                    throws com.liferay.portal.kernel.exception.PortalException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    try {
174                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
175                                            "getProductVersions", _getProductVersionsParameterTypes3);
176    
177                            MethodHandler methodHandler = new MethodHandler(methodKey,
178                                            productEntryId, start, end);
179    
180                            Object returnObj = null;
181    
182                            try {
183                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
184                            }
185                            catch (Exception e) {
186                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
187                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
188                                    }
189    
190                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
191                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
192                                    }
193    
194                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
195                            }
196    
197                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
198                    }
199                    catch (com.liferay.portal.kernel.exception.SystemException se) {
200                            _log.error(se, se);
201    
202                            throw se;
203                    }
204            }
205    
206            public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
207                    long productEntryId)
208                    throws com.liferay.portal.kernel.exception.PortalException,
209                            com.liferay.portal.kernel.exception.SystemException {
210                    try {
211                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
212                                            "getProductVersionsCount",
213                                            _getProductVersionsCountParameterTypes4);
214    
215                            MethodHandler methodHandler = new MethodHandler(methodKey,
216                                            productEntryId);
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.kernel.exception.PortalException) {
225                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
226                                    }
227    
228                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
229                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
230                                    }
231    
232                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
233                            }
234    
235                            return ((Integer)returnObj).intValue();
236                    }
237                    catch (com.liferay.portal.kernel.exception.SystemException se) {
238                            _log.error(se, se);
239    
240                            throw se;
241                    }
242            }
243    
244            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
245                    HttpPrincipal httpPrincipal, long productVersionId,
246                    java.lang.String version, java.lang.String changeLog,
247                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
248                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
249                    long[] frameworkVersionIds)
250                    throws com.liferay.portal.kernel.exception.PortalException,
251                            com.liferay.portal.kernel.exception.SystemException {
252                    try {
253                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
254                                            "updateProductVersion", _updateProductVersionParameterTypes5);
255    
256                            MethodHandler methodHandler = new MethodHandler(methodKey,
257                                            productVersionId, version, changeLog, downloadPageURL,
258                                            directDownloadURL, testDirectDownloadURL,
259                                            repoStoreArtifact, frameworkVersionIds);
260    
261                            Object returnObj = null;
262    
263                            try {
264                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
265                            }
266                            catch (Exception e) {
267                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
268                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
269                                    }
270    
271                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
272                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
273                                    }
274    
275                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
276                            }
277    
278                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
279                    }
280                    catch (com.liferay.portal.kernel.exception.SystemException se) {
281                            _log.error(se, se);
282    
283                            throw se;
284                    }
285            }
286    
287            private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
288            private static final Class<?>[] _addProductVersionParameterTypes0 = new Class[] {
289                            long.class, java.lang.String.class, java.lang.String.class,
290                            java.lang.String.class, java.lang.String.class, boolean.class,
291                            boolean.class, long[].class,
292                            com.liferay.portal.service.ServiceContext.class
293                    };
294            private static final Class<?>[] _deleteProductVersionParameterTypes1 = new Class[] {
295                            long.class
296                    };
297            private static final Class<?>[] _getProductVersionParameterTypes2 = new Class[] {
298                            long.class
299                    };
300            private static final Class<?>[] _getProductVersionsParameterTypes3 = new Class[] {
301                            long.class, int.class, int.class
302                    };
303            private static final Class<?>[] _getProductVersionsCountParameterTypes4 = new Class[] {
304                            long.class
305                    };
306            private static final Class<?>[] _updateProductVersionParameterTypes5 = new Class[] {
307                            long.class, java.lang.String.class, java.lang.String.class,
308                            java.lang.String.class, java.lang.String.class, boolean.class,
309                            boolean.class, long[].class
310                    };
311    }