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.journal.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.journal.service.JournalFeedServiceUtil;
25  
26  /**
27   * <a href="JournalFeedServiceHttp.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.journal.service.JournalFeedServiceUtil} 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       JournalFeedServiceSoap
59   * @see       com.liferay.portal.security.auth.HttpPrincipal
60   * @see       com.liferay.portlet.journal.service.JournalFeedServiceUtil
61   * @generated
62   */
63  public class JournalFeedServiceHttp {
64      public static com.liferay.portlet.journal.model.JournalFeed addFeed(
65          HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
66          boolean autoFeedId, java.lang.String name,
67          java.lang.String description, java.lang.String type,
68          java.lang.String structureId, java.lang.String templateId,
69          java.lang.String rendererTemplateId, int delta,
70          java.lang.String orderByCol, java.lang.String orderByType,
71          java.lang.String targetLayoutFriendlyUrl,
72          java.lang.String targetPortletId, java.lang.String contentField,
73          java.lang.String feedType, double feedVersion,
74          com.liferay.portal.service.ServiceContext serviceContext)
75          throws com.liferay.portal.PortalException,
76              com.liferay.portal.SystemException {
77          try {
78              MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
79                      "addFeed", _addFeedParameterTypes0);
80  
81              MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
82                      feedId, autoFeedId, name, description, type, structureId,
83                      templateId, rendererTemplateId, delta, orderByCol,
84                      orderByType, targetLayoutFriendlyUrl, targetPortletId,
85                      contentField, feedType, feedVersion, serviceContext);
86  
87              Object returnObj = null;
88  
89              try {
90                  returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
91              }
92              catch (Exception e) {
93                  if (e instanceof com.liferay.portal.PortalException) {
94                      throw (com.liferay.portal.PortalException)e;
95                  }
96  
97                  if (e instanceof com.liferay.portal.SystemException) {
98                      throw (com.liferay.portal.SystemException)e;
99                  }
100 
101                 throw new com.liferay.portal.SystemException(e);
102             }
103 
104             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
105         }
106         catch (com.liferay.portal.SystemException se) {
107             _log.error(se, se);
108 
109             throw se;
110         }
111     }
112 
113     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
114         long feedId)
115         throws com.liferay.portal.PortalException,
116             com.liferay.portal.SystemException {
117         try {
118             MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
119                     "deleteFeed", _deleteFeedParameterTypes1);
120 
121             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
122                     feedId);
123 
124             try {
125                 TunnelUtil.invoke(httpPrincipal, methodHandler);
126             }
127             catch (Exception e) {
128                 if (e instanceof com.liferay.portal.PortalException) {
129                     throw (com.liferay.portal.PortalException)e;
130                 }
131 
132                 if (e instanceof com.liferay.portal.SystemException) {
133                     throw (com.liferay.portal.SystemException)e;
134                 }
135 
136                 throw new com.liferay.portal.SystemException(e);
137             }
138         }
139         catch (com.liferay.portal.SystemException se) {
140             _log.error(se, se);
141 
142             throw se;
143         }
144     }
145 
146     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
147         java.lang.String feedId)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         try {
151             MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
152                     "deleteFeed", _deleteFeedParameterTypes2);
153 
154             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
155                     feedId);
156 
157             try {
158                 TunnelUtil.invoke(httpPrincipal, methodHandler);
159             }
160             catch (Exception e) {
161                 if (e instanceof com.liferay.portal.PortalException) {
162                     throw (com.liferay.portal.PortalException)e;
163                 }
164 
165                 if (e instanceof com.liferay.portal.SystemException) {
166                     throw (com.liferay.portal.SystemException)e;
167                 }
168 
169                 throw new com.liferay.portal.SystemException(e);
170             }
171         }
172         catch (com.liferay.portal.SystemException se) {
173             _log.error(se, se);
174 
175             throw se;
176         }
177     }
178 
179     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
180         HttpPrincipal httpPrincipal, long groupId, long feedId)
181         throws com.liferay.portal.PortalException,
182             com.liferay.portal.SystemException {
183         try {
184             MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
185                     "getFeed", _getFeedParameterTypes3);
186 
187             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
188                     feedId);
189 
190             Object returnObj = null;
191 
192             try {
193                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
194             }
195             catch (Exception e) {
196                 if (e instanceof com.liferay.portal.PortalException) {
197                     throw (com.liferay.portal.PortalException)e;
198                 }
199 
200                 if (e instanceof com.liferay.portal.SystemException) {
201                     throw (com.liferay.portal.SystemException)e;
202                 }
203 
204                 throw new com.liferay.portal.SystemException(e);
205             }
206 
207             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
208         }
209         catch (com.liferay.portal.SystemException se) {
210             _log.error(se, se);
211 
212             throw se;
213         }
214     }
215 
216     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
217         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
218         throws com.liferay.portal.PortalException,
219             com.liferay.portal.SystemException {
220         try {
221             MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
222                     "getFeed", _getFeedParameterTypes4);
223 
224             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
225                     feedId);
226 
227             Object returnObj = null;
228 
229             try {
230                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
231             }
232             catch (Exception e) {
233                 if (e instanceof com.liferay.portal.PortalException) {
234                     throw (com.liferay.portal.PortalException)e;
235                 }
236 
237                 if (e instanceof com.liferay.portal.SystemException) {
238                     throw (com.liferay.portal.SystemException)e;
239                 }
240 
241                 throw new com.liferay.portal.SystemException(e);
242             }
243 
244             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
245         }
246         catch (com.liferay.portal.SystemException se) {
247             _log.error(se, se);
248 
249             throw se;
250         }
251     }
252 
253     public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
254         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
255         java.lang.String name, java.lang.String description,
256         java.lang.String type, java.lang.String structureId,
257         java.lang.String templateId, java.lang.String rendererTemplateId,
258         int delta, java.lang.String orderByCol, java.lang.String orderByType,
259         java.lang.String targetLayoutFriendlyUrl,
260         java.lang.String targetPortletId, java.lang.String contentField,
261         java.lang.String feedType, double feedVersion,
262         com.liferay.portal.service.ServiceContext serviceContext)
263         throws com.liferay.portal.PortalException,
264             com.liferay.portal.SystemException {
265         try {
266             MethodKey methodKey = new MethodKey(JournalFeedServiceUtil.class.getName(),
267                     "updateFeed", _updateFeedParameterTypes5);
268 
269             MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
270                     feedId, name, description, type, structureId, templateId,
271                     rendererTemplateId, delta, orderByCol, orderByType,
272                     targetLayoutFriendlyUrl, targetPortletId, contentField,
273                     feedType, feedVersion, serviceContext);
274 
275             Object returnObj = null;
276 
277             try {
278                 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
279             }
280             catch (Exception e) {
281                 if (e instanceof com.liferay.portal.PortalException) {
282                     throw (com.liferay.portal.PortalException)e;
283                 }
284 
285                 if (e instanceof com.liferay.portal.SystemException) {
286                     throw (com.liferay.portal.SystemException)e;
287                 }
288 
289                 throw new com.liferay.portal.SystemException(e);
290             }
291 
292             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
293         }
294         catch (com.liferay.portal.SystemException se) {
295             _log.error(se, se);
296 
297             throw se;
298         }
299     }
300 
301     private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
302     private static final Class<?>[] _addFeedParameterTypes0 = new Class[] {
303             long.class, java.lang.String.class, boolean.class,
304             java.lang.String.class, java.lang.String.class,
305             java.lang.String.class, java.lang.String.class,
306             java.lang.String.class, java.lang.String.class, int.class,
307             java.lang.String.class, java.lang.String.class,
308             java.lang.String.class, java.lang.String.class,
309             java.lang.String.class, java.lang.String.class, double.class,
310             com.liferay.portal.service.ServiceContext.class
311         };
312     private static final Class<?>[] _deleteFeedParameterTypes1 = new Class[] {
313             long.class, long.class
314         };
315     private static final Class<?>[] _deleteFeedParameterTypes2 = new Class[] {
316             long.class, java.lang.String.class
317         };
318     private static final Class<?>[] _getFeedParameterTypes3 = new Class[] {
319             long.class, long.class
320         };
321     private static final Class<?>[] _getFeedParameterTypes4 = new Class[] {
322             long.class, java.lang.String.class
323         };
324     private static final Class<?>[] _updateFeedParameterTypes5 = new Class[] {
325             long.class, java.lang.String.class, java.lang.String.class,
326             java.lang.String.class, java.lang.String.class,
327             java.lang.String.class, java.lang.String.class,
328             java.lang.String.class, int.class, java.lang.String.class,
329             java.lang.String.class, java.lang.String.class,
330             java.lang.String.class, java.lang.String.class,
331             java.lang.String.class, double.class,
332             com.liferay.portal.service.ServiceContext.class
333         };
334 }