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