001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.http.TunnelUtil;
025    
026    import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil;
027    
028    /**
029     * Provides the HTTP utility for the
030     * {@link SCFrameworkVersionServiceUtil} service utility. The
031     * static methods of this class calls the same methods of the service utility.
032     * However, the signatures are different because it requires an additional
033     * {@link HttpPrincipal} parameter.
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 HttpPrincipal
053     * @see SCFrameworkVersionServiceUtil
054     * @generated
055     */
056    @ProviderType
057    public class SCFrameworkVersionServiceHttp {
058            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion addFrameworkVersion(
059                    HttpPrincipal httpPrincipal, java.lang.String name,
060                    java.lang.String url, boolean active, int priority,
061                    com.liferay.portal.service.ServiceContext serviceContext)
062                    throws com.liferay.portal.kernel.exception.PortalException {
063                    try {
064                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class,
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
081                            }
082    
083                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
084                    }
085                    catch (com.liferay.portal.kernel.exception.SystemException se) {
086                            _log.error(se, se);
087    
088                            throw se;
089                    }
090            }
091    
092            public static void deleteFrameworkVersion(HttpPrincipal httpPrincipal,
093                    long frameworkVersionId)
094                    throws com.liferay.portal.kernel.exception.PortalException {
095                    try {
096                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class,
097                                            "deleteFrameworkVersion",
098                                            _deleteFrameworkVersionParameterTypes1);
099    
100                            MethodHandler methodHandler = new MethodHandler(methodKey,
101                                            frameworkVersionId);
102    
103                            try {
104                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
105                            }
106                            catch (Exception e) {
107                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
108                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
109                                    }
110    
111                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
112                            }
113                    }
114                    catch (com.liferay.portal.kernel.exception.SystemException se) {
115                            _log.error(se, se);
116    
117                            throw se;
118                    }
119            }
120    
121            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion getFrameworkVersion(
122                    HttpPrincipal httpPrincipal, long frameworkVersionId)
123                    throws com.liferay.portal.kernel.exception.PortalException {
124                    try {
125                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class,
126                                            "getFrameworkVersion", _getFrameworkVersionParameterTypes2);
127    
128                            MethodHandler methodHandler = new MethodHandler(methodKey,
129                                            frameworkVersionId);
130    
131                            Object returnObj = null;
132    
133                            try {
134                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
135                            }
136                            catch (Exception e) {
137                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
138                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
139                                    }
140    
141                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
142                            }
143    
144                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
145                    }
146                    catch (com.liferay.portal.kernel.exception.SystemException se) {
147                            _log.error(se, se);
148    
149                            throw se;
150                    }
151            }
152    
153            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
154                    HttpPrincipal httpPrincipal, long groupId, boolean active) {
155                    try {
156                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class,
157                                            "getFrameworkVersions", _getFrameworkVersionsParameterTypes3);
158    
159                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
160                                            active);
161    
162                            Object returnObj = null;
163    
164                            try {
165                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
166                            }
167                            catch (Exception e) {
168                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
169                            }
170    
171                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
172                    }
173                    catch (com.liferay.portal.kernel.exception.SystemException se) {
174                            _log.error(se, se);
175    
176                            throw se;
177                    }
178            }
179    
180            public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
181                    HttpPrincipal httpPrincipal, long groupId, boolean active, int start,
182                    int end) {
183                    try {
184                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class,
185                                            "getFrameworkVersions", _getFrameworkVersionsParameterTypes4);
186    
187                            MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
188                                            active, start, end);
189    
190                            Object returnObj = null;
191    
192                            try {
193                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
194                            }
195                            catch (Exception e) {
196                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
197                            }
198    
199                            return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
200                    }
201                    catch (com.liferay.portal.kernel.exception.SystemException se) {
202                            _log.error(se, se);
203    
204                            throw se;
205                    }
206            }
207    
208            public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion updateFrameworkVersion(
209                    HttpPrincipal httpPrincipal, long frameworkVersionId,
210                    java.lang.String name, java.lang.String url, boolean active,
211                    int priority)
212                    throws com.liferay.portal.kernel.exception.PortalException {
213                    try {
214                            MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class,
215                                            "updateFrameworkVersion",
216                                            _updateFrameworkVersionParameterTypes5);
217    
218                            MethodHandler methodHandler = new MethodHandler(methodKey,
219                                            frameworkVersionId, name, url, active, priority);
220    
221                            Object returnObj = null;
222    
223                            try {
224                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
225                            }
226                            catch (Exception e) {
227                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
228                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
229                                    }
230    
231                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
232                            }
233    
234                            return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
235                    }
236                    catch (com.liferay.portal.kernel.exception.SystemException se) {
237                            _log.error(se, se);
238    
239                            throw se;
240                    }
241            }
242    
243            private static Log _log = LogFactoryUtil.getLog(SCFrameworkVersionServiceHttp.class);
244            private static final Class<?>[] _addFrameworkVersionParameterTypes0 = new Class[] {
245                            java.lang.String.class, java.lang.String.class, boolean.class,
246                            int.class, com.liferay.portal.service.ServiceContext.class
247                    };
248            private static final Class<?>[] _deleteFrameworkVersionParameterTypes1 = new Class[] {
249                            long.class
250                    };
251            private static final Class<?>[] _getFrameworkVersionParameterTypes2 = new Class[] {
252                            long.class
253                    };
254            private static final Class<?>[] _getFrameworkVersionsParameterTypes3 = new Class[] {
255                            long.class, boolean.class
256                    };
257            private static final Class<?>[] _getFrameworkVersionsParameterTypes4 = new Class[] {
258                            long.class, boolean.class, int.class, int.class
259                    };
260            private static final Class<?>[] _updateFrameworkVersionParameterTypes5 = new Class[] {
261                            long.class, java.lang.String.class, java.lang.String.class,
262                            boolean.class, int.class
263                    };
264    }