1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.journal.service.http;
24  
25  import com.liferay.portal.kernel.log.Log;
26  import com.liferay.portal.kernel.log.LogFactoryUtil;
27  import com.liferay.portal.kernel.util.BooleanWrapper;
28  import com.liferay.portal.kernel.util.DoubleWrapper;
29  import com.liferay.portal.kernel.util.IntegerWrapper;
30  import com.liferay.portal.kernel.util.LongWrapper;
31  import com.liferay.portal.kernel.util.MethodWrapper;
32  import com.liferay.portal.kernel.util.NullWrapper;
33  import com.liferay.portal.security.auth.HttpPrincipal;
34  import com.liferay.portal.service.http.TunnelUtil;
35  
36  import com.liferay.portlet.journal.service.JournalFeedServiceUtil;
37  
38  /**
39   * <a href="JournalFeedServiceHttp.java.html"><b><i>View Source</i></b></a>
40   *
41   * <p>
42   * ServiceBuilder generated this class. Modifications in this class will be
43   * overwritten the next time is generated.
44   * </p>
45   *
46   * <p>
47   * This class provides a HTTP utility for the
48   * {@link com.liferay.portlet.journal.service.JournalFeedServiceUtil} service utility. The
49   * static methods of this class calls the same methods of the service utility.
50   * However, the signatures are different because it requires an additional
51   * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
52   * </p>
53   *
54   * <p>
55   * The benefits of using the HTTP utility is that it is fast and allows for
56   * tunneling without the cost of serializing to text. The drawback is that it
57   * only works with Java.
58   * </p>
59   *
60   * <p>
61   * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
62   * configure security.
63   * </p>
64   *
65   * <p>
66   * The HTTP utility is only generated for remote services.
67   * </p>
68   *
69   * @author    Brian Wing Shun Chan
70   * @see       JournalFeedServiceSoap
71   * @see       com.liferay.portal.security.auth.HttpPrincipal
72   * @see       com.liferay.portlet.journal.service.JournalFeedServiceUtil
73   * @generated
74   */
75  public class JournalFeedServiceHttp {
76      public static com.liferay.portlet.journal.model.JournalFeed addFeed(
77          HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
78          boolean autoFeedId, java.lang.String name,
79          java.lang.String description, java.lang.String type,
80          java.lang.String structureId, java.lang.String templateId,
81          java.lang.String rendererTemplateId, int delta,
82          java.lang.String orderByCol, java.lang.String orderByType,
83          java.lang.String targetLayoutFriendlyUrl,
84          java.lang.String targetPortletId, java.lang.String contentField,
85          java.lang.String feedType, double feedVersion,
86          com.liferay.portal.service.ServiceContext serviceContext)
87          throws com.liferay.portal.PortalException,
88              com.liferay.portal.SystemException {
89          try {
90              Object paramObj0 = new LongWrapper(groupId);
91  
92              Object paramObj1 = feedId;
93  
94              if (feedId == null) {
95                  paramObj1 = new NullWrapper("java.lang.String");
96              }
97  
98              Object paramObj2 = new BooleanWrapper(autoFeedId);
99  
100             Object paramObj3 = name;
101 
102             if (name == null) {
103                 paramObj3 = new NullWrapper("java.lang.String");
104             }
105 
106             Object paramObj4 = description;
107 
108             if (description == null) {
109                 paramObj4 = new NullWrapper("java.lang.String");
110             }
111 
112             Object paramObj5 = type;
113 
114             if (type == null) {
115                 paramObj5 = new NullWrapper("java.lang.String");
116             }
117 
118             Object paramObj6 = structureId;
119 
120             if (structureId == null) {
121                 paramObj6 = new NullWrapper("java.lang.String");
122             }
123 
124             Object paramObj7 = templateId;
125 
126             if (templateId == null) {
127                 paramObj7 = new NullWrapper("java.lang.String");
128             }
129 
130             Object paramObj8 = rendererTemplateId;
131 
132             if (rendererTemplateId == null) {
133                 paramObj8 = new NullWrapper("java.lang.String");
134             }
135 
136             Object paramObj9 = new IntegerWrapper(delta);
137 
138             Object paramObj10 = orderByCol;
139 
140             if (orderByCol == null) {
141                 paramObj10 = new NullWrapper("java.lang.String");
142             }
143 
144             Object paramObj11 = orderByType;
145 
146             if (orderByType == null) {
147                 paramObj11 = new NullWrapper("java.lang.String");
148             }
149 
150             Object paramObj12 = targetLayoutFriendlyUrl;
151 
152             if (targetLayoutFriendlyUrl == null) {
153                 paramObj12 = new NullWrapper("java.lang.String");
154             }
155 
156             Object paramObj13 = targetPortletId;
157 
158             if (targetPortletId == null) {
159                 paramObj13 = new NullWrapper("java.lang.String");
160             }
161 
162             Object paramObj14 = contentField;
163 
164             if (contentField == null) {
165                 paramObj14 = new NullWrapper("java.lang.String");
166             }
167 
168             Object paramObj15 = feedType;
169 
170             if (feedType == null) {
171                 paramObj15 = new NullWrapper("java.lang.String");
172             }
173 
174             Object paramObj16 = new DoubleWrapper(feedVersion);
175 
176             Object paramObj17 = serviceContext;
177 
178             if (serviceContext == null) {
179                 paramObj17 = new NullWrapper(
180                         "com.liferay.portal.service.ServiceContext");
181             }
182 
183             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
184                     "addFeed",
185                     new Object[] {
186                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
187                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
188                         paramObj10, paramObj11, paramObj12, paramObj13,
189                         paramObj14, paramObj15, paramObj16, paramObj17
190                     });
191 
192             Object returnObj = null;
193 
194             try {
195                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
196             }
197             catch (Exception e) {
198                 if (e instanceof com.liferay.portal.PortalException) {
199                     throw (com.liferay.portal.PortalException)e;
200                 }
201 
202                 if (e instanceof com.liferay.portal.SystemException) {
203                     throw (com.liferay.portal.SystemException)e;
204                 }
205 
206                 throw new com.liferay.portal.SystemException(e);
207             }
208 
209             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
210         }
211         catch (com.liferay.portal.SystemException se) {
212             _log.error(se, se);
213 
214             throw se;
215         }
216     }
217 
218     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
219         long feedId)
220         throws com.liferay.portal.PortalException,
221             com.liferay.portal.SystemException {
222         try {
223             Object paramObj0 = new LongWrapper(groupId);
224 
225             Object paramObj1 = new LongWrapper(feedId);
226 
227             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
228                     "deleteFeed", new Object[] { paramObj0, paramObj1 });
229 
230             try {
231                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
232             }
233             catch (Exception e) {
234                 if (e instanceof com.liferay.portal.PortalException) {
235                     throw (com.liferay.portal.PortalException)e;
236                 }
237 
238                 if (e instanceof com.liferay.portal.SystemException) {
239                     throw (com.liferay.portal.SystemException)e;
240                 }
241 
242                 throw new com.liferay.portal.SystemException(e);
243             }
244         }
245         catch (com.liferay.portal.SystemException se) {
246             _log.error(se, se);
247 
248             throw se;
249         }
250     }
251 
252     public static void deleteFeed(HttpPrincipal httpPrincipal, long groupId,
253         java.lang.String feedId)
254         throws com.liferay.portal.PortalException,
255             com.liferay.portal.SystemException {
256         try {
257             Object paramObj0 = new LongWrapper(groupId);
258 
259             Object paramObj1 = feedId;
260 
261             if (feedId == null) {
262                 paramObj1 = new NullWrapper("java.lang.String");
263             }
264 
265             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
266                     "deleteFeed", new Object[] { paramObj0, paramObj1 });
267 
268             try {
269                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
270             }
271             catch (Exception e) {
272                 if (e instanceof com.liferay.portal.PortalException) {
273                     throw (com.liferay.portal.PortalException)e;
274                 }
275 
276                 if (e instanceof com.liferay.portal.SystemException) {
277                     throw (com.liferay.portal.SystemException)e;
278                 }
279 
280                 throw new com.liferay.portal.SystemException(e);
281             }
282         }
283         catch (com.liferay.portal.SystemException se) {
284             _log.error(se, se);
285 
286             throw se;
287         }
288     }
289 
290     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
291         HttpPrincipal httpPrincipal, long groupId, long feedId)
292         throws com.liferay.portal.PortalException,
293             com.liferay.portal.SystemException {
294         try {
295             Object paramObj0 = new LongWrapper(groupId);
296 
297             Object paramObj1 = new LongWrapper(feedId);
298 
299             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
300                     "getFeed", new Object[] { paramObj0, paramObj1 });
301 
302             Object returnObj = null;
303 
304             try {
305                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
306             }
307             catch (Exception e) {
308                 if (e instanceof com.liferay.portal.PortalException) {
309                     throw (com.liferay.portal.PortalException)e;
310                 }
311 
312                 if (e instanceof com.liferay.portal.SystemException) {
313                     throw (com.liferay.portal.SystemException)e;
314                 }
315 
316                 throw new com.liferay.portal.SystemException(e);
317             }
318 
319             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
320         }
321         catch (com.liferay.portal.SystemException se) {
322             _log.error(se, se);
323 
324             throw se;
325         }
326     }
327 
328     public static com.liferay.portlet.journal.model.JournalFeed getFeed(
329         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId)
330         throws com.liferay.portal.PortalException,
331             com.liferay.portal.SystemException {
332         try {
333             Object paramObj0 = new LongWrapper(groupId);
334 
335             Object paramObj1 = feedId;
336 
337             if (feedId == null) {
338                 paramObj1 = new NullWrapper("java.lang.String");
339             }
340 
341             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
342                     "getFeed", new Object[] { paramObj0, paramObj1 });
343 
344             Object returnObj = null;
345 
346             try {
347                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
348             }
349             catch (Exception e) {
350                 if (e instanceof com.liferay.portal.PortalException) {
351                     throw (com.liferay.portal.PortalException)e;
352                 }
353 
354                 if (e instanceof com.liferay.portal.SystemException) {
355                     throw (com.liferay.portal.SystemException)e;
356                 }
357 
358                 throw new com.liferay.portal.SystemException(e);
359             }
360 
361             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
362         }
363         catch (com.liferay.portal.SystemException se) {
364             _log.error(se, se);
365 
366             throw se;
367         }
368     }
369 
370     public static com.liferay.portlet.journal.model.JournalFeed updateFeed(
371         HttpPrincipal httpPrincipal, long groupId, java.lang.String feedId,
372         java.lang.String name, java.lang.String description,
373         java.lang.String type, java.lang.String structureId,
374         java.lang.String templateId, java.lang.String rendererTemplateId,
375         int delta, java.lang.String orderByCol, java.lang.String orderByType,
376         java.lang.String targetLayoutFriendlyUrl,
377         java.lang.String targetPortletId, java.lang.String contentField,
378         java.lang.String feedType, double feedVersion,
379         com.liferay.portal.service.ServiceContext serviceContext)
380         throws com.liferay.portal.PortalException,
381             com.liferay.portal.SystemException {
382         try {
383             Object paramObj0 = new LongWrapper(groupId);
384 
385             Object paramObj1 = feedId;
386 
387             if (feedId == null) {
388                 paramObj1 = new NullWrapper("java.lang.String");
389             }
390 
391             Object paramObj2 = name;
392 
393             if (name == null) {
394                 paramObj2 = new NullWrapper("java.lang.String");
395             }
396 
397             Object paramObj3 = description;
398 
399             if (description == null) {
400                 paramObj3 = new NullWrapper("java.lang.String");
401             }
402 
403             Object paramObj4 = type;
404 
405             if (type == null) {
406                 paramObj4 = new NullWrapper("java.lang.String");
407             }
408 
409             Object paramObj5 = structureId;
410 
411             if (structureId == null) {
412                 paramObj5 = new NullWrapper("java.lang.String");
413             }
414 
415             Object paramObj6 = templateId;
416 
417             if (templateId == null) {
418                 paramObj6 = new NullWrapper("java.lang.String");
419             }
420 
421             Object paramObj7 = rendererTemplateId;
422 
423             if (rendererTemplateId == null) {
424                 paramObj7 = new NullWrapper("java.lang.String");
425             }
426 
427             Object paramObj8 = new IntegerWrapper(delta);
428 
429             Object paramObj9 = orderByCol;
430 
431             if (orderByCol == null) {
432                 paramObj9 = new NullWrapper("java.lang.String");
433             }
434 
435             Object paramObj10 = orderByType;
436 
437             if (orderByType == null) {
438                 paramObj10 = new NullWrapper("java.lang.String");
439             }
440 
441             Object paramObj11 = targetLayoutFriendlyUrl;
442 
443             if (targetLayoutFriendlyUrl == null) {
444                 paramObj11 = new NullWrapper("java.lang.String");
445             }
446 
447             Object paramObj12 = targetPortletId;
448 
449             if (targetPortletId == null) {
450                 paramObj12 = new NullWrapper("java.lang.String");
451             }
452 
453             Object paramObj13 = contentField;
454 
455             if (contentField == null) {
456                 paramObj13 = new NullWrapper("java.lang.String");
457             }
458 
459             Object paramObj14 = feedType;
460 
461             if (feedType == null) {
462                 paramObj14 = new NullWrapper("java.lang.String");
463             }
464 
465             Object paramObj15 = new DoubleWrapper(feedVersion);
466 
467             Object paramObj16 = serviceContext;
468 
469             if (serviceContext == null) {
470                 paramObj16 = new NullWrapper(
471                         "com.liferay.portal.service.ServiceContext");
472             }
473 
474             MethodWrapper methodWrapper = new MethodWrapper(JournalFeedServiceUtil.class.getName(),
475                     "updateFeed",
476                     new Object[] {
477                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
478                         paramObj5, paramObj6, paramObj7, paramObj8, paramObj9,
479                         paramObj10, paramObj11, paramObj12, paramObj13,
480                         paramObj14, paramObj15, paramObj16
481                     });
482 
483             Object returnObj = null;
484 
485             try {
486                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
487             }
488             catch (Exception e) {
489                 if (e instanceof com.liferay.portal.PortalException) {
490                     throw (com.liferay.portal.PortalException)e;
491                 }
492 
493                 if (e instanceof com.liferay.portal.SystemException) {
494                     throw (com.liferay.portal.SystemException)e;
495                 }
496 
497                 throw new com.liferay.portal.SystemException(e);
498             }
499 
500             return (com.liferay.portlet.journal.model.JournalFeed)returnObj;
501         }
502         catch (com.liferay.portal.SystemException se) {
503             _log.error(se, se);
504 
505             throw se;
506         }
507     }
508 
509     private static Log _log = LogFactoryUtil.getLog(JournalFeedServiceHttp.class);
510 }