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.SCProductEntryServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil} 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 SCProductEntryServiceSoap
050     * @see com.liferay.portal.security.auth.HttpPrincipal
051     * @see com.liferay.portlet.softwarecatalog.service.SCProductEntryServiceUtil
052     * @generated
053     */
054    public class SCProductEntryServiceHttp {
055            public static com.liferay.portlet.softwarecatalog.model.SCProductEntry addProductEntry(
056                    HttpPrincipal httpPrincipal, java.lang.String name,
057                    java.lang.String type, java.lang.String tags,
058                    java.lang.String shortDescription, java.lang.String longDescription,
059                    java.lang.String pageURL, java.lang.String author,
060                    java.lang.String repoGroupId, java.lang.String repoArtifactId,
061                    long[] licenseIds, java.util.List<byte[]> thumbnails,
062                    java.util.List<byte[]> fullImages,
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(SCProductEntryServiceUtil.class,
068                                            "addProductEntry", _addProductEntryParameterTypes0);
069    
070                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
071                                            type, tags, shortDescription, longDescription, pageURL,
072                                            author, repoGroupId, repoArtifactId, licenseIds,
073                                            thumbnails, fullImages, 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.SCProductEntry)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 deleteProductEntry(HttpPrincipal httpPrincipal,
102                    long productEntryId)
103                    throws com.liferay.portal.kernel.exception.PortalException,
104                            com.liferay.portal.kernel.exception.SystemException {
105                    try {
106                            MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class,
107                                            "deleteProductEntry", _deleteProductEntryParameterTypes1);
108    
109                            MethodHandler methodHandler = new MethodHandler(methodKey,
110                                            productEntryId);
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.SCProductEntry getProductEntry(
135                    HttpPrincipal httpPrincipal, long productEntryId)
136                    throws com.liferay.portal.kernel.exception.PortalException,
137                            com.liferay.portal.kernel.exception.SystemException {
138                    try {
139                            MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class,
140                                            "getProductEntry", _getProductEntryParameterTypes2);
141    
142                            MethodHandler methodHandler = new MethodHandler(methodKey,
143                                            productEntryId);
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.SCProductEntry)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 com.liferay.portlet.softwarecatalog.model.SCProductEntry updateProductEntry(
172                    HttpPrincipal httpPrincipal, long productEntryId,
173                    java.lang.String name, java.lang.String type, java.lang.String tags,
174                    java.lang.String shortDescription, java.lang.String longDescription,
175                    java.lang.String pageURL, java.lang.String author,
176                    java.lang.String repoGroupId, java.lang.String repoArtifactId,
177                    long[] licenseIds, java.util.List<byte[]> thumbnails,
178                    java.util.List<byte[]> fullImages)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    try {
182                            MethodKey methodKey = new MethodKey(SCProductEntryServiceUtil.class,
183                                            "updateProductEntry", _updateProductEntryParameterTypes3);
184    
185                            MethodHandler methodHandler = new MethodHandler(methodKey,
186                                            productEntryId, name, type, tags, shortDescription,
187                                            longDescription, pageURL, author, repoGroupId,
188                                            repoArtifactId, licenseIds, thumbnails, fullImages);
189    
190                            Object returnObj = null;
191    
192                            try {
193                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
194                            }
195                            catch (Exception e) {
196                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
197                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
198                                    }
199    
200                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
201                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
202                                    }
203    
204                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
205                            }
206    
207                            return (com.liferay.portlet.softwarecatalog.model.SCProductEntry)returnObj;
208                    }
209                    catch (com.liferay.portal.kernel.exception.SystemException se) {
210                            _log.error(se, se);
211    
212                            throw se;
213                    }
214            }
215    
216            private static Log _log = LogFactoryUtil.getLog(SCProductEntryServiceHttp.class);
217            private static final Class<?>[] _addProductEntryParameterTypes0 = new Class[] {
218                            java.lang.String.class, java.lang.String.class,
219                            java.lang.String.class, java.lang.String.class,
220                            java.lang.String.class, java.lang.String.class,
221                            java.lang.String.class, java.lang.String.class,
222                            java.lang.String.class, long[].class, java.util.List.class,
223                            java.util.List.class,
224                            com.liferay.portal.service.ServiceContext.class
225                    };
226            private static final Class<?>[] _deleteProductEntryParameterTypes1 = new Class[] {
227                            long.class
228                    };
229            private static final Class<?>[] _getProductEntryParameterTypes2 = new Class[] {
230                            long.class
231                    };
232            private static final Class<?>[] _updateProductEntryParameterTypes3 = new Class[] {
233                            long.class, java.lang.String.class, java.lang.String.class,
234                            java.lang.String.class, java.lang.String.class,
235                            java.lang.String.class, java.lang.String.class,
236                            java.lang.String.class, java.lang.String.class,
237                            java.lang.String.class, long[].class, java.util.List.class,
238                            java.util.List.class
239                    };
240    }