001    /**
002     * Copyright (c) 2000-2011 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.SCProductEntryServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil} 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       SCProductEntryServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil
054     * @generated
055     */
056    public class SCProductEntryServiceHttp {
057            public static com.liferay.portlet.softwarecatalog.model.SCProductEntry addProductEntry(
058                    HttpPrincipal httpPrincipal, java.lang.String name,
059                    java.lang.String type, java.lang.String tags,
060                    java.lang.String shortDescription, java.lang.String longDescription,
061                    java.lang.String pageURL, java.lang.String author,
062                    java.lang.String repoGroupId, java.lang.String repoArtifactId,
063                    long[] licenseIds, java.util.List<byte[]> thumbnails,
064                    java.util.List<byte[]> fullImages,
065                    com.liferay.portal.service.ServiceContext serviceContext)
066                    throws com.liferay.portal.kernel.exception.PortalException,
067                            com.liferay.portal.kernel.exception.SystemException {
068                    try {
069                            MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
070                                            "addProductEntry", java.lang.String.class,
071                                            java.lang.String.class, java.lang.String.class,
072                                            java.lang.String.class, java.lang.String.class,
073                                            java.lang.String.class, java.lang.String.class,
074                                            java.lang.String.class, java.lang.String.class,
075                                            long[].class, java.util.List.class, java.util.List.class,
076                                            com.liferay.portal.service.ServiceContext.class);
077    
078                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
079                                            type, tags, shortDescription, longDescription, pageURL,
080                                            author, repoGroupId, repoArtifactId, licenseIds,
081                                            thumbnails, fullImages, serviceContext);
082    
083                            Object returnObj = null;
084    
085                            try {
086                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
087                            }
088                            catch (Exception e) {
089                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
090                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
091                                    }
092    
093                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
094                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
095                                    }
096    
097                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
098                            }
099    
100                            return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
101                    }
102                    catch (com.liferay.portal.kernel.exception.SystemException se) {
103                            _log.error(se, se);
104    
105                            throw se;
106                    }
107            }
108    
109            public static void deleteProductEntry(HttpPrincipal httpPrincipal,
110                    long productEntryId)
111                    throws com.liferay.portal.kernel.exception.PortalException,
112                            com.liferay.portal.kernel.exception.SystemException {
113                    try {
114                            MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
115                                            "deleteProductEntry", long.class);
116    
117                            MethodHandler methodHandler = new MethodHandler(methodKey,
118                                            productEntryId);
119    
120                            try {
121                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
122                            }
123                            catch (Exception e) {
124                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
125                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
126                                    }
127    
128                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
129                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
130                                    }
131    
132                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
133                            }
134                    }
135                    catch (com.liferay.portal.kernel.exception.SystemException se) {
136                            _log.error(se, se);
137    
138                            throw se;
139                    }
140            }
141    
142            public static com.liferay.portlet.softwarecatalog.model.SCProductEntry getProductEntry(
143                    HttpPrincipal httpPrincipal, long productEntryId)
144                    throws com.liferay.portal.kernel.exception.PortalException,
145                            com.liferay.portal.kernel.exception.SystemException {
146                    try {
147                            MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
148                                            "getProductEntry", long.class);
149    
150                            MethodHandler methodHandler = new MethodHandler(methodKey,
151                                            productEntryId);
152    
153                            Object returnObj = null;
154    
155                            try {
156                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
157                            }
158                            catch (Exception e) {
159                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
160                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
161                                    }
162    
163                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
164                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
165                                    }
166    
167                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
168                            }
169    
170                            return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
171                    }
172                    catch (com.liferay.portal.kernel.exception.SystemException se) {
173                            _log.error(se, se);
174    
175                            throw se;
176                    }
177            }
178    
179            public static com.liferay.portlet.softwarecatalog.model.SCProductEntry updateProductEntry(
180                    HttpPrincipal httpPrincipal, long productEntryId,
181                    java.lang.String name, java.lang.String type, java.lang.String tags,
182                    java.lang.String shortDescription, java.lang.String longDescription,
183                    java.lang.String pageURL, java.lang.String author,
184                    java.lang.String repoGroupId, java.lang.String repoArtifactId,
185                    long[] licenseIds, java.util.List<byte[]> thumbnails,
186                    java.util.List<byte[]> fullImages)
187                    throws com.liferay.portal.kernel.exception.PortalException,
188                            com.liferay.portal.kernel.exception.SystemException {
189                    try {
190                            MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class.getName(),
191                                            "updateProductEntry", long.class, java.lang.String.class,
192                                            java.lang.String.class, java.lang.String.class,
193                                            java.lang.String.class, java.lang.String.class,
194                                            java.lang.String.class, java.lang.String.class,
195                                            java.lang.String.class, java.lang.String.class,
196                                            long[].class, java.util.List.class, java.util.List.class);
197    
198                            MethodHandler methodHandler = new MethodHandler(methodKey,
199                                            productEntryId, name, type, tags, shortDescription,
200                                            longDescription, pageURL, author, repoGroupId,
201                                            repoArtifactId, licenseIds, thumbnails, fullImages);
202    
203                            Object returnObj = null;
204    
205                            try {
206                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
207                            }
208                            catch (Exception e) {
209                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
210                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
211                                    }
212    
213                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
214                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
215                                    }
216    
217                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
218                            }
219    
220                            return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
221                    }
222                    catch (com.liferay.portal.kernel.exception.SystemException se) {
223                            _log.error(se, se);
224    
225                            throw se;
226                    }
227            }
228    
229            private static Log _log = LogFactoryUtil.getLog(SCProductEntryServiceHttp.class);
230    }