1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.softwarecatalog.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  import com.liferay.portal.kernel.util.MethodHandler;
20  import com.liferay.portal.kernel.util.MethodKey;
21  import com.liferay.portal.security.auth.HttpPrincipal;
22  import com.liferay.portal.service.http.TunnelUtil;
23  
24  import com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil;
25  
26  /**
27   * <a href="SCFrameworkVersionServiceHttp.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * <p>
35   * This class provides a HTTP utility for the
36   * {@link com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil} service utility. The
37   * static methods of this class calls the same methods of the service utility.
38   * However, the signatures are different because it requires an additional
39   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
40   * </p>
41   *
42   * <p>
43   * The benefits of using the HTTP utility is that it is fast and allows for
44   * tunneling without the cost of serializing to text. The drawback is that it
45   * only works with Java.
46   * </p>
47   *
48   * <p>
49   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
50   * configure security.
51   * </p>
52   *
53   * <p>
54   * The HTTP utility is only generated for remote services.
55   * </p>
56   *
57   * @author    Brian Wing Shun Chan
58   * @see       SCFrameworkVersionServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.softwarecatalog.service.SCFrameworkVersionServiceUtil
61   * @generated
62   */
63  public class SCFrameworkVersionServiceHttp {
64      public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion addFrameworkVersion(
65          HttpPrincipal httpPrincipal, java.lang.String name,
66          java.lang.String url, boolean active, int priority,
67          com.liferay.portal.service.ServiceContext serviceContext)
68          throws com.liferay.portal.PortalException,
69              com.liferay.portal.SystemException {
70          try {
71              MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
72                      "addFrameworkVersion", _addFrameworkVersionParameterTypes0);
73  
74              MethodHandler methodHandler = new MethodHandler(methodKey, name,
75                      url, active, priority, serviceContext);
76  
77              Object returnObj = null;
78  
79              try {
80                  returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
81              }
82              catch (Exception e) {
83                  if (e instanceof com.liferay.portal.PortalException) {
84                      throw (com.liferay.portal.PortalException)e;
85                  }
86  
87                  if (e instanceof com.liferay.portal.SystemException) {
88                      throw (com.liferay.portal.SystemException)e;
89                  }
90  
91                  throw new com.liferay.portal.SystemException(e);
92              }
93  
94              return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
95          }
96          catch (com.liferay.portal.SystemException se) {
97              _log.error(se, se);
98  
99              throw se;
100         }
101     }
102 
103     public static void deleteFrameworkVersion(HttpPrincipal httpPrincipal,
104         long frameworkVersionId)
105         throws com.liferay.portal.PortalException,
106             com.liferay.portal.SystemException {
107         try {
108             MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
109                     "deleteFrameworkVersion",
110                     _deleteFrameworkVersionParameterTypes1);
111 
112             MethodHandler methodHandler = new MethodHandler(methodKey,
113                     frameworkVersionId);
114 
115             try {
116                 TunnelUtil.invoke(httpPrincipal, methodHandler);
117             }
118             catch (Exception e) {
119                 if (e instanceof com.liferay.portal.PortalException) {
120                     throw (com.liferay.portal.PortalException)e;
121                 }
122 
123                 if (e instanceof com.liferay.portal.SystemException) {
124                     throw (com.liferay.portal.SystemException)e;
125                 }
126 
127                 throw new com.liferay.portal.SystemException(e);
128             }
129         }
130         catch (com.liferay.portal.SystemException se) {
131             _log.error(se, se);
132 
133             throw se;
134         }
135     }
136 
137     public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion getFrameworkVersion(
138         HttpPrincipal httpPrincipal, long frameworkVersionId)
139         throws com.liferay.portal.PortalException,
140             com.liferay.portal.SystemException {
141         try {
142             MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
143                     "getFrameworkVersion", _getFrameworkVersionParameterTypes2);
144 
145             MethodHandler methodHandler = new MethodHandler(methodKey,
146                     frameworkVersionId);
147 
148             Object returnObj = null;
149 
150             try {
151                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
152             }
153             catch (Exception e) {
154                 if (e instanceof com.liferay.portal.PortalException) {
155                     throw (com.liferay.portal.PortalException)e;
156                 }
157 
158                 if (e instanceof com.liferay.portal.SystemException) {
159                     throw (com.liferay.portal.SystemException)e;
160                 }
161 
162                 throw new com.liferay.portal.SystemException(e);
163             }
164 
165             return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
166         }
167         catch (com.liferay.portal.SystemException se) {
168             _log.error(se, se);
169 
170             throw se;
171         }
172     }
173 
174     public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
175         HttpPrincipal httpPrincipal, long groupId, boolean active)
176         throws com.liferay.portal.SystemException {
177         try {
178             MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
179                     "getFrameworkVersions", _getFrameworkVersionsParameterTypes3);
180 
181             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
182                     active);
183 
184             Object returnObj = null;
185 
186             try {
187                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
188             }
189             catch (Exception e) {
190                 if (e instanceof com.liferay.portal.SystemException) {
191                     throw (com.liferay.portal.SystemException)e;
192                 }
193 
194                 throw new com.liferay.portal.SystemException(e);
195             }
196 
197             return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
198         }
199         catch (com.liferay.portal.SystemException se) {
200             _log.error(se, se);
201 
202             throw se;
203         }
204     }
205 
206     public static java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion> getFrameworkVersions(
207         HttpPrincipal httpPrincipal, long groupId, boolean active, int start,
208         int end) throws com.liferay.portal.SystemException {
209         try {
210             MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
211                     "getFrameworkVersions", _getFrameworkVersionsParameterTypes4);
212 
213             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
214                     active, start, end);
215 
216             Object returnObj = null;
217 
218             try {
219                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
220             }
221             catch (Exception e) {
222                 if (e instanceof com.liferay.portal.SystemException) {
223                     throw (com.liferay.portal.SystemException)e;
224                 }
225 
226                 throw new com.liferay.portal.SystemException(e);
227             }
228 
229             return (java.util.List<com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion>)returnObj;
230         }
231         catch (com.liferay.portal.SystemException se) {
232             _log.error(se, se);
233 
234             throw se;
235         }
236     }
237 
238     public static com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion updateFrameworkVersion(
239         HttpPrincipal httpPrincipal, long frameworkVersionId,
240         java.lang.String name, java.lang.String url, boolean active,
241         int priority)
242         throws com.liferay.portal.PortalException,
243             com.liferay.portal.SystemException {
244         try {
245             MethodKey methodKey = new MethodKey(SCFrameworkVersionServiceUtil.class.getName(),
246                     "updateFrameworkVersion",
247                     _updateFrameworkVersionParameterTypes5);
248 
249             MethodHandler methodHandler = new MethodHandler(methodKey,
250                     frameworkVersionId, name, url, active, priority);
251 
252             Object returnObj = null;
253 
254             try {
255                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
256             }
257             catch (Exception e) {
258                 if (e instanceof com.liferay.portal.PortalException) {
259                     throw (com.liferay.portal.PortalException)e;
260                 }
261 
262                 if (e instanceof com.liferay.portal.SystemException) {
263                     throw (com.liferay.portal.SystemException)e;
264                 }
265 
266                 throw new com.liferay.portal.SystemException(e);
267             }
268 
269             return (com.liferay.portlet.softwarecatalog.model.SCFrameworkVersion)returnObj;
270         }
271         catch (com.liferay.portal.SystemException se) {
272             _log.error(se, se);
273 
274             throw se;
275         }
276     }
277 
278     private static Log _log = LogFactoryUtil.getLog(SCFrameworkVersionServiceHttp.class);
279     private static final Class<?>[] _addFrameworkVersionParameterTypes0 = new Class[] {
280             java.lang.String.class, java.lang.String.class, boolean.class,
281             int.class, com.liferay.portal.service.ServiceContext.class
282         };
283     private static final Class<?>[] _deleteFrameworkVersionParameterTypes1 = new Class[] {
284             long.class
285         };
286     private static final Class<?>[] _getFrameworkVersionParameterTypes2 = new Class[] {
287             long.class
288         };
289     private static final Class<?>[] _getFrameworkVersionsParameterTypes3 = new Class[] {
290             long.class, boolean.class
291         };
292     private static final Class<?>[] _getFrameworkVersionsParameterTypes4 = new Class[] {
293             long.class, boolean.class, int.class, int.class
294         };
295     private static final Class<?>[] _updateFrameworkVersionParameterTypes5 = new Class[] {
296             long.class, java.lang.String.class, java.lang.String.class,
297             boolean.class, int.class
298         };
299 }