001    /**
002     * Copyright (c) 2000-2010 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.BooleanWrapper;
020    import com.liferay.portal.kernel.util.IntegerWrapper;
021    import com.liferay.portal.kernel.util.LongWrapper;
022    import com.liferay.portal.kernel.util.MethodWrapper;
023    import com.liferay.portal.kernel.util.NullWrapper;
024    import com.liferay.portal.security.auth.HttpPrincipal;
025    import com.liferay.portal.service.http.TunnelUtil;
026    
027    import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil;
028    
029    /**
030     * <p>
031     * This class provides a HTTP utility for the
032     * {@link com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil} service utility. The
033     * static methods of this class calls the same methods of the service utility.
034     * However, the signatures are different because it requires an additional
035     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
036     * </p>
037     *
038     * <p>
039     * The benefits of using the HTTP utility is that it is fast and allows for
040     * tunneling without the cost of serializing to text. The drawback is that it
041     * only works with Java.
042     * </p>
043     *
044     * <p>
045     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
046     * configure security.
047     * </p>
048     *
049     * <p>
050     * The HTTP utility is only generated for remote services.
051     * </p>
052     *
053     * @author    Brian Wing Shun Chan
054     * @see       SCFrameworkVersionServiceSoap
055     * @see       com.liferay.portal.security.auth.HttpPrincipal
056     * @see       com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil
057     * @generated
058     */
059    public class SCFrameworkVersionServiceHttp {
060            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion addFrameworkVersion(
061                    HttpPrincipal httpPrincipal, java.lang.String name,
062                    java.lang.String url, boolean active, int priority,
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                            Object paramObj0 = name;
068    
069                            if (name == null) {
070                                    paramObj0 = new NullWrapper("java.lang.String");
071                            }
072    
073                            Object paramObj1 = url;
074    
075                            if (url == null) {
076                                    paramObj1 = new NullWrapper("java.lang.String");
077                            }
078    
079                            Object paramObj2 = new BooleanWrapper(active);
080    
081                            Object paramObj3 = new IntegerWrapper(priority);
082    
083                            Object paramObj4 = serviceContext;
084    
085                            if (serviceContext == null) {
086                                    paramObj4 = new NullWrapper(
087                                                    "com.liferay.portal.service.ServiceContext");
088                            }
089    
090                            MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
091                                            "addFrameworkVersion",
092                                            new Object[] {
093                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
094                                            });
095    
096                            Object returnObj = null;
097    
098                            try {
099                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
100                            }
101                            catch (Exception e) {
102                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
103                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
104                                    }
105    
106                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
107                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
108                                    }
109    
110                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
111                            }
112    
113                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
114                    }
115                    catch (com.liferay.portal.kernel.exception.SystemException se) {
116                            _log.error(se, se);
117    
118                            throw se;
119                    }
120            }
121    
122            public static void deleteFrameworkVersion(HttpPrincipal httpPrincipal,
123                    long frameworkVersionId)
124                    throws com.liferay.portal.kernel.exception.PortalException,
125                            com.liferay.portal.kernel.exception.SystemException {
126                    try {
127                            Object paramObj0 = new LongWrapper(frameworkVersionId);
128    
129                            MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
130                                            "deleteFrameworkVersion", new Object[] { paramObj0 });
131    
132                            try {
133                                    TunnelUtil.invoke(httpPrincipal, methodWrapper);
134                            }
135                            catch (Exception e) {
136                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
137                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
138                                    }
139    
140                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
141                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
142                                    }
143    
144                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
145                            }
146                    }
147                    catch (com.liferay.portal.kernel.exception.SystemException se) {
148                            _log.error(se, se);
149    
150                            throw se;
151                    }
152            }
153    
154            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion getFrameworkVersion(
155                    HttpPrincipal httpPrincipal, long frameworkVersionId)
156                    throws com.liferay.portal.kernel.exception.PortalException,
157                            com.liferay.portal.kernel.exception.SystemException {
158                    try {
159                            Object paramObj0 = new LongWrapper(frameworkVersionId);
160    
161                            MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
162                                            "getFrameworkVersion", new Object[] { paramObj0 });
163    
164                            Object returnObj = null;
165    
166                            try {
167                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
168                            }
169                            catch (Exception e) {
170                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
171                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
172                                    }
173    
174                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
175                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
176                                    }
177    
178                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
179                            }
180    
181                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
182                    }
183                    catch (com.liferay.portal.kernel.exception.SystemException se) {
184                            _log.error(se, se);
185    
186                            throw se;
187                    }
188            }
189    
190            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
191                    HttpPrincipal httpPrincipal, long groupId, boolean active)
192                    throws com.liferay.portal.kernel.exception.SystemException {
193                    try {
194                            Object paramObj0 = new LongWrapper(groupId);
195    
196                            Object paramObj1 = new BooleanWrapper(active);
197    
198                            MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
199                                            "getFrameworkVersions",
200                                            new Object[] { paramObj0, paramObj1 });
201    
202                            Object returnObj = null;
203    
204                            try {
205                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
206                            }
207                            catch (Exception e) {
208                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
209                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
210                                    }
211    
212                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
213                            }
214    
215                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
216                    }
217                    catch (com.liferay.portal.kernel.exception.SystemException se) {
218                            _log.error(se, se);
219    
220                            throw se;
221                    }
222            }
223    
224            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
225                    HttpPrincipal httpPrincipal, long groupId, boolean active, int start,
226                    int end) throws com.liferay.portal.kernel.exception.SystemException {
227                    try {
228                            Object paramObj0 = new LongWrapper(groupId);
229    
230                            Object paramObj1 = new BooleanWrapper(active);
231    
232                            Object paramObj2 = new IntegerWrapper(start);
233    
234                            Object paramObj3 = new IntegerWrapper(end);
235    
236                            MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
237                                            "getFrameworkVersions",
238                                            new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
239    
240                            Object returnObj = null;
241    
242                            try {
243                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
244                            }
245                            catch (Exception e) {
246                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
247                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
248                                    }
249    
250                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
251                            }
252    
253                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
254                    }
255                    catch (com.liferay.portal.kernel.exception.SystemException se) {
256                            _log.error(se, se);
257    
258                            throw se;
259                    }
260            }
261    
262            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion updateFrameworkVersion(
263                    HttpPrincipal httpPrincipal, long frameworkVersionId,
264                    java.lang.String name, java.lang.String url, boolean active,
265                    int priority)
266                    throws com.liferay.portal.kernel.exception.PortalException,
267                            com.liferay.portal.kernel.exception.SystemException {
268                    try {
269                            Object paramObj0 = new LongWrapper(frameworkVersionId);
270    
271                            Object paramObj1 = name;
272    
273                            if (name == null) {
274                                    paramObj1 = new NullWrapper("java.lang.String");
275                            }
276    
277                            Object paramObj2 = url;
278    
279                            if (url == null) {
280                                    paramObj2 = new NullWrapper("java.lang.String");
281                            }
282    
283                            Object paramObj3 = new BooleanWrapper(active);
284    
285                            Object paramObj4 = new IntegerWrapper(priority);
286    
287                            MethodWrapper methodWrapper = new MethodWrapper(SCFrameworkVersionServiceUtil.class.getName(),
288                                            "updateFrameworkVersion",
289                                            new Object[] {
290                                                    paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
291                                            });
292    
293                            Object returnObj = null;
294    
295                            try {
296                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
297                            }
298                            catch (Exception e) {
299                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
300                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
301                                    }
302    
303                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
304                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
305                                    }
306    
307                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
308                            }
309    
310                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
311                    }
312                    catch (com.liferay.portal.kernel.exception.SystemException se) {
313                            _log.error(se, se);
314    
315                            throw se;
316                    }
317            }
318    
319            private static Log _log = LogFactoryUtil.getLog(SCFrameworkVersionServiceHttp.class);
320    }