001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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", _addFrameworkVersionParameterTypes0);
066    
067                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
068                                            url, active, priority, serviceContext);
069    
070                            Object returnObj = null;
071    
072                            try {
073                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
074                            }
075                            catch (Exception e) {
076                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
077                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
078                                    }
079    
080                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
081                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
082                                    }
083    
084                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
085                            }
086    
087                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
088                    }
089                    catch (com.liferay.portal.kernel.exception.SystemException se) {
090                            _log.error(se, se);
091    
092                            throw se;
093                    }
094            }
095    
096            public static void deleteFrameworkVersion(HttpPrincipal httpPrincipal,
097                    long frameworkVersionId)
098                    throws com.liferay.portal.kernel.exception.PortalException,
099                            com.liferay.portal.kernel.exception.SystemException {
100                    try {
101                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
102                                            "deleteFrameworkVersion",
103                                            _deleteFrameworkVersionParameterTypes1);
104    
105                            MethodHandler methodHandler = new MethodHandler(methodKey,
106                                            frameworkVersionId);
107    
108                            try {
109                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
110                            }
111                            catch (Exception e) {
112                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
113                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
114                                    }
115    
116                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
117                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
118                                    }
119    
120                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
121                            }
122                    }
123                    catch (com.liferay.portal.kernel.exception.SystemException se) {
124                            _log.error(se, se);
125    
126                            throw se;
127                    }
128            }
129    
130            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion getFrameworkVersion(
131                    HttpPrincipal httpPrincipal, long frameworkVersionId)
132                    throws com.liferay.portal.kernel.exception.PortalException,
133                            com.liferay.portal.kernel.exception.SystemException {
134                    try {
135                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
136                                            "getFrameworkVersion", _getFrameworkVersionParameterTypes2);
137    
138                            MethodHandler methodHandler = new MethodHandler(methodKey,
139                                            frameworkVersionId);
140    
141                            Object returnObj = null;
142    
143                            try {
144                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
145                            }
146                            catch (Exception e) {
147                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
148                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
149                                    }
150    
151                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
152                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
153                                    }
154    
155                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
156                            }
157    
158                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
159                    }
160                    catch (com.liferay.portal.kernel.exception.SystemException se) {
161                            _log.error(se, se);
162    
163                            throw se;
164                    }
165            }
166    
167            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
168                    HttpPrincipal httpPrincipal, long groupId, boolean active)
169                    throws com.liferay.portal.kernel.exception.SystemException {
170                    try {
171                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
172                                            "getFrameworkVersions", _getFrameworkVersionsParameterTypes3);
173    
174                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
175                                            active);
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.SystemException) {
184                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
185                                    }
186    
187                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
188                            }
189    
190                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
191                    }
192                    catch (com.liferay.portal.kernel.exception.SystemException se) {
193                            _log.error(se, se);
194    
195                            throw se;
196                    }
197            }
198    
199            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
200                    HttpPrincipal httpPrincipal, long groupId, boolean active, int start,
201                    int end) throws com.liferay.portal.kernel.exception.SystemException {
202                    try {
203                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
204                                            "getFrameworkVersions", _getFrameworkVersionsParameterTypes4);
205    
206                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
207                                            active, start, end);
208    
209                            Object returnObj = null;
210    
211                            try {
212                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
213                            }
214                            catch (Exception e) {
215                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
216                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
217                                    }
218    
219                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
220                            }
221    
222                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
223                    }
224                    catch (com.liferay.portal.kernel.exception.SystemException se) {
225                            _log.error(se, se);
226    
227                            throw se;
228                    }
229            }
230    
231            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion updateFrameworkVersion(
232                    HttpPrincipal httpPrincipal, long frameworkVersionId,
233                    java.lang.String name, java.lang.String url, boolean active,
234                    int priority)
235                    throws com.liferay.portal.kernel.exception.PortalException,
236                            com.liferay.portal.kernel.exception.SystemException {
237                    try {
238                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
239                                            "updateFrameworkVersion",
240                                            _updateFrameworkVersionParameterTypes5);
241    
242                            MethodHandler methodHandler = new MethodHandler(methodKey,
243                                            frameworkVersionId, name, url, active, priority);
244    
245                            Object returnObj = null;
246    
247                            try {
248                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
249                            }
250                            catch (Exception e) {
251                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
252                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
253                                    }
254    
255                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
256                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
257                                    }
258    
259                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
260                            }
261    
262                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
263                    }
264                    catch (com.liferay.portal.kernel.exception.SystemException se) {
265                            _log.error(se, se);
266    
267                            throw se;
268                    }
269            }
270    
271            private static Log _log = LogFactoryUtil.getLog(SCFrameworkVersionServiceHttp.class);
272            private static final Class<?>[] _addFrameworkVersionParameterTypes0 = new Class[] {
273                            java.lang.String.class, java.lang.String.class, boolean.class,
274                            int.class, com.liferay.portal.service.ServiceContext.class
275                    };
276            private static final Class<?>[] _deleteFrameworkVersionParameterTypes1 = new Class[] {
277                            long.class
278                    };
279            private static final Class<?>[] _getFrameworkVersionParameterTypes2 = new Class[] {
280                            long.class
281                    };
282            private static final Class<?>[] _getFrameworkVersionsParameterTypes3 = new Class[] {
283                            long.class, boolean.class
284                    };
285            private static final Class<?>[] _getFrameworkVersionsParameterTypes4 = new Class[] {
286                            long.class, boolean.class, int.class, int.class
287                    };
288            private static final Class<?>[] _updateFrameworkVersionParameterTypes5 = new Class[] {
289                            long.class, java.lang.String.class, java.lang.String.class,
290                            boolean.class, int.class
291                    };
292    }