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