001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link com.liferay.portlet.softwarecatalog.service.SCProductVersionServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
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    @ProviderType
057    public class SCProductVersionServiceHttp {
058            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion addProductVersion(
059                    HttpPrincipal httpPrincipal, long productEntryId,
060                    java.lang.String version, java.lang.String changeLog,
061                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
062                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
063                    long[] frameworkVersionIds,
064                    com.liferay.portal.service.ServiceContext serviceContext)
065                    throws com.liferay.portal.kernel.exception.PortalException {
066                    try {
067                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
086                            }
087    
088                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
089                    }
090                    catch (com.liferay.portal.kernel.exception.SystemException se) {
091                            _log.error(se, se);
092    
093                            throw se;
094                    }
095            }
096    
097            public static void deleteProductVersion(HttpPrincipal httpPrincipal,
098                    long productVersionId)
099                    throws com.liferay.portal.kernel.exception.PortalException {
100                    try {
101                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
102                                            "deleteProductVersion", _deleteProductVersionParameterTypes1);
103    
104                            MethodHandler methodHandler = new MethodHandler(methodKey,
105                                            productVersionId);
106    
107                            try {
108                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
109                            }
110                            catch (Exception e) {
111                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
112                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
113                                    }
114    
115                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
116                            }
117                    }
118                    catch (com.liferay.portal.kernel.exception.SystemException se) {
119                            _log.error(se, se);
120    
121                            throw se;
122                    }
123            }
124    
125            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion getProductVersion(
126                    HttpPrincipal httpPrincipal, long productVersionId)
127                    throws com.liferay.portal.kernel.exception.PortalException {
128                    try {
129                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
130                                            "getProductVersion", _getProductVersionParameterTypes2);
131    
132                            MethodHandler methodHandler = new MethodHandler(methodKey,
133                                            productVersionId);
134    
135                            Object returnObj = null;
136    
137                            try {
138                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
139                            }
140                            catch (Exception e) {
141                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
142                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
143                                    }
144    
145                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
146                            }
147    
148                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
149                    }
150                    catch (com.liferay.portal.kernel.exception.SystemException se) {
151                            _log.error(se, se);
152    
153                            throw se;
154                    }
155            }
156    
157            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion> getProductVersions(
158                    HttpPrincipal httpPrincipal, long productEntryId, int start, int end)
159                    throws com.liferay.portal.kernel.exception.PortalException {
160                    try {
161                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
162                                            "getProductVersions", _getProductVersionsParameterTypes3);
163    
164                            MethodHandler methodHandler = new MethodHandler(methodKey,
165                                            productEntryId, start, end);
166    
167                            Object returnObj = null;
168    
169                            try {
170                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
171                            }
172                            catch (Exception e) {
173                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
174                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
175                                    }
176    
177                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
178                            }
179    
180                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCProductVersion>)returnObj;
181                    }
182                    catch (com.liferay.portal.kernel.exception.SystemException se) {
183                            _log.error(se, se);
184    
185                            throw se;
186                    }
187            }
188    
189            public static int getProductVersionsCount(HttpPrincipal httpPrincipal,
190                    long productEntryId)
191                    throws com.liferay.portal.kernel.exception.PortalException {
192                    try {
193                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
194                                            "getProductVersionsCount",
195                                            _getProductVersionsCountParameterTypes4);
196    
197                            MethodHandler methodHandler = new MethodHandler(methodKey,
198                                            productEntryId);
199    
200                            Object returnObj = null;
201    
202                            try {
203                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
204                            }
205                            catch (Exception e) {
206                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
207                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
208                                    }
209    
210                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
211                            }
212    
213                            return ((Integer)returnObj).intValue();
214                    }
215                    catch (com.liferay.portal.kernel.exception.SystemException se) {
216                            _log.error(se, se);
217    
218                            throw se;
219                    }
220            }
221    
222            public static com.liferay.portlet.softwarecatalog.model.SCProductVersion updateProductVersion(
223                    HttpPrincipal httpPrincipal, long productVersionId,
224                    java.lang.String version, java.lang.String changeLog,
225                    java.lang.String downloadPageURL, java.lang.String directDownloadURL,
226                    boolean testDirectDownloadURL, boolean repoStoreArtifact,
227                    long[] frameworkVersionIds)
228                    throws com.liferay.portal.kernel.exception.PortalException {
229                    try {
230                            MethodKey methodKey = new MethodKey(SCProductVersionServiceUtil.class,
231                                            "updateProductVersion", _updateProductVersionParameterTypes5);
232    
233                            MethodHandler methodHandler = new MethodHandler(methodKey,
234                                            productVersionId, version, changeLog, downloadPageURL,
235                                            directDownloadURL, testDirectDownloadURL,
236                                            repoStoreArtifact, frameworkVersionIds);
237    
238                            Object returnObj = null;
239    
240                            try {
241                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
242                            }
243                            catch (Exception e) {
244                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
245                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
246                                    }
247    
248                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
249                            }
250    
251                            return (com.liferay.portlet.softwarecatalog.model.SCProductVersion)returnObj;
252                    }
253                    catch (com.liferay.portal.kernel.exception.SystemException se) {
254                            _log.error(se, se);
255    
256                            throw se;
257                    }
258            }
259    
260            private static Log _log = LogFactoryUtil.getLog(SCProductVersionServiceHttp.class);
261            private static final Class<?>[] _addProductVersionParameterTypes0 = new Class[] {
262                            long.class, java.lang.String.class, java.lang.String.class,
263                            java.lang.String.class, java.lang.String.class, boolean.class,
264                            boolean.class, long[].class,
265                            com.liferay.portal.service.ServiceContext.class
266                    };
267            private static final Class<?>[] _deleteProductVersionParameterTypes1 = new Class[] {
268                            long.class
269                    };
270            private static final Class<?>[] _getProductVersionParameterTypes2 = new Class[] {
271                            long.class
272                    };
273            private static final Class<?>[] _getProductVersionsParameterTypes3 = new Class[] {
274                            long.class, int.class, int.class
275                    };
276            private static final Class<?>[] _getProductVersionsCountParameterTypes4 = new Class[] {
277                            long.class
278                    };
279            private static final Class<?>[] _updateProductVersionParameterTypes5 = new Class[] {
280                            long.class, java.lang.String.class, java.lang.String.class,
281                            java.lang.String.class, java.lang.String.class, boolean.class,
282                            boolean.class, long[].class
283                    };
284    }