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