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.SCFrameworkVersionServiceUtil;
025    
026    /**
027     * <p>
028     * This class provides a HTTP utility for the
029     * {@link com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil} 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       SCFrameworkVersionServiceSoap
052     * @see       com.liferay.portal.security.auth.HttpPrincipal
053     * @see       com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil
054     * @generated
055     */
056    public class SCFrameworkVersionServiceHttp {
057            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion addFrameworkVersion(
058                    HttpPrincipal httpPrincipal, java.lang.String name,
059                    java.lang.String url, boolean active, int priority,
060                    com.liferay.portal.service.ServiceContext serviceContext)
061                    throws com.liferay.portal.kernel.exception.PortalException,
062                            com.liferay.portal.kernel.exception.SystemException {
063                    try {
064                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
065                                            "addFrameworkVersion", java.lang.String.class,
066                                            java.lang.String.class, boolean.class, int.class,
067                                            com.liferay.portal.service.ServiceContext.class);
068    
069                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
070                                            url, active, priority, serviceContext);
071    
072                            Object returnObj = null;
073    
074                            try {
075                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
076                            }
077                            catch (Exception e) {
078                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
079                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
080                                    }
081    
082                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
083                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
084                                    }
085    
086                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
087                            }
088    
089                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
090                    }
091                    catch (com.liferay.portal.kernel.exception.SystemException se) {
092                            _log.error(se, se);
093    
094                            throw se;
095                    }
096            }
097    
098            public static void deleteFrameworkVersion(HttpPrincipal httpPrincipal,
099                    long frameworkVersionId)
100                    throws com.liferay.portal.kernel.exception.PortalException,
101                            com.liferay.portal.kernel.exception.SystemException {
102                    try {
103                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
104                                            "deleteFrameworkVersion", long.class);
105    
106                            MethodHandler methodHandler = new MethodHandler(methodKey,
107                                            frameworkVersionId);
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                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
118                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
119                                    }
120    
121                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
122                            }
123                    }
124                    catch (com.liferay.portal.kernel.exception.SystemException se) {
125                            _log.error(se, se);
126    
127                            throw se;
128                    }
129            }
130    
131            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion getFrameworkVersion(
132                    HttpPrincipal httpPrincipal, long frameworkVersionId)
133                    throws com.liferay.portal.kernel.exception.PortalException,
134                            com.liferay.portal.kernel.exception.SystemException {
135                    try {
136                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
137                                            "getFrameworkVersion", long.class);
138    
139                            MethodHandler methodHandler = new MethodHandler(methodKey,
140                                            frameworkVersionId);
141    
142                            Object returnObj = null;
143    
144                            try {
145                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
146                            }
147                            catch (Exception e) {
148                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
149                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
150                                    }
151    
152                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
153                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
154                                    }
155    
156                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
157                            }
158    
159                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
160                    }
161                    catch (com.liferay.portal.kernel.exception.SystemException se) {
162                            _log.error(se, se);
163    
164                            throw se;
165                    }
166            }
167    
168            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
169                    HttpPrincipal httpPrincipal, long groupId, boolean active)
170                    throws com.liferay.portal.kernel.exception.SystemException {
171                    try {
172                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
173                                            "getFrameworkVersions", long.class, boolean.class);
174    
175                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
176                                            active);
177    
178                            Object returnObj = null;
179    
180                            try {
181                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
182                            }
183                            catch (Exception e) {
184                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
185                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
186                                    }
187    
188                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
189                            }
190    
191                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
192                    }
193                    catch (com.liferay.portal.kernel.exception.SystemException se) {
194                            _log.error(se, se);
195    
196                            throw se;
197                    }
198            }
199    
200            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
201                    HttpPrincipal httpPrincipal, long groupId, boolean active, int start,
202                    int end) throws com.liferay.portal.kernel.exception.SystemException {
203                    try {
204                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
205                                            "getFrameworkVersions", long.class, boolean.class,
206                                            int.class, int.class);
207    
208                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
209                                            active, start, end);
210    
211                            Object returnObj = null;
212    
213                            try {
214                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
215                            }
216                            catch (Exception e) {
217                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
218                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
219                                    }
220    
221                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
222                            }
223    
224                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
225                    }
226                    catch (com.liferay.portal.kernel.exception.SystemException se) {
227                            _log.error(se, se);
228    
229                            throw se;
230                    }
231            }
232    
233            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion updateFrameworkVersion(
234                    HttpPrincipal httpPrincipal, long frameworkVersionId,
235                    java.lang.String name, java.lang.String url, boolean active,
236                    int priority)
237                    throws com.liferay.portal.kernel.exception.PortalException,
238                            com.liferay.portal.kernel.exception.SystemException {
239                    try {
240                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
241                                            "updateFrameworkVersion", long.class,
242                                            java.lang.String.class, java.lang.String.class,
243                                            boolean.class, int.class);
244    
245                            MethodHandler methodHandler = new MethodHandler(methodKey,
246                                            frameworkVersionId, name, url, active, priority);
247    
248                            Object returnObj = null;
249    
250                            try {
251                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
252                            }
253                            catch (Exception e) {
254                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
255                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
256                                    }
257    
258                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
259                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
260                                    }
261    
262                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
263                            }
264    
265                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
266                    }
267                    catch (com.liferay.portal.kernel.exception.SystemException se) {
268                            _log.error(se, se);
269    
270                            throw se;
271                    }
272            }
273    
274            private static Log _log = LogFactoryUtil.getLog(SCFrameworkVersionServiceHttp.class);
275    }