1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions 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.messageboards.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.messageboards.service.MBMessageServiceUtil;
37  
38  /**
39   * <a href="MBMessageServiceHttp.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   * <code>com.liferay.portlet.messageboards.service.MBMessageServiceUtil</code> service
49   * utility. The static methods of this class calls the same methods of the
50   * service utility. However, the signatures are different because it requires an
51   * additional <code>com.liferay.portal.security.auth.HttpPrincipal</code>
52   * parameter.
53   * </p>
54   *
55   * <p>
56   * The benefits of using the HTTP utility is that it is fast and allows for
57   * tunneling without the cost of serializing to text. The drawback is that it
58   * only works with Java.
59   * </p>
60   *
61   * <p>
62   * Set the property <code>tunnel.servlet.hosts.allowed</code> in
63   * portal.properties to configure security.
64   * </p>
65   *
66   * <p>
67   * The HTTP utility is only generated for remote services.
68   * </p>
69   *
70   * @author Brian Wing Shun Chan
71   *
72   * @see com.liferay.portal.security.auth.HttpPrincipal
73   * @see com.liferay.portlet.messageboards.service.MBMessageServiceUtil
74   * @see com.liferay.portlet.messageboards.service.http.MBMessageServiceSoap
75   *
76   */
77  public class MBMessageServiceHttp {
78      public static com.liferay.portlet.messageboards.model.MBMessage addDiscussionMessage(
79          HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
80          long threadId, long parentMessageId, java.lang.String subject,
81          java.lang.String body,
82          com.liferay.portal.service.ServiceContext serviceContext)
83          throws com.liferay.portal.PortalException,
84              com.liferay.portal.SystemException {
85          try {
86              Object paramObj0 = className;
87  
88              if (className == null) {
89                  paramObj0 = new NullWrapper("java.lang.String");
90              }
91  
92              Object paramObj1 = new LongWrapper(classPK);
93  
94              Object paramObj2 = new LongWrapper(threadId);
95  
96              Object paramObj3 = new LongWrapper(parentMessageId);
97  
98              Object paramObj4 = subject;
99  
100             if (subject == null) {
101                 paramObj4 = new NullWrapper("java.lang.String");
102             }
103 
104             Object paramObj5 = body;
105 
106             if (body == null) {
107                 paramObj5 = new NullWrapper("java.lang.String");
108             }
109 
110             Object paramObj6 = serviceContext;
111 
112             if (serviceContext == null) {
113                 paramObj6 = new NullWrapper(
114                         "com.liferay.portal.service.ServiceContext");
115             }
116 
117             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
118                     "addDiscussionMessage",
119                     new Object[] {
120                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
121                         paramObj5, paramObj6
122                     });
123 
124             Object returnObj = null;
125 
126             try {
127                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
128             }
129             catch (Exception e) {
130                 if (e instanceof com.liferay.portal.PortalException) {
131                     throw (com.liferay.portal.PortalException)e;
132                 }
133 
134                 if (e instanceof com.liferay.portal.SystemException) {
135                     throw (com.liferay.portal.SystemException)e;
136                 }
137 
138                 throw new com.liferay.portal.SystemException(e);
139             }
140 
141             return (com.liferay.portlet.messageboards.model.MBMessage)returnObj;
142         }
143         catch (com.liferay.portal.SystemException se) {
144             _log.error(se, se);
145 
146             throw se;
147         }
148     }
149 
150     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
151         HttpPrincipal httpPrincipal, long categoryId, java.lang.String subject,
152         java.lang.String body,
153         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
154         boolean anonymous, double priority,
155         com.liferay.portal.service.ServiceContext serviceContext)
156         throws com.liferay.portal.PortalException,
157             com.liferay.portal.SystemException {
158         try {
159             Object paramObj0 = new LongWrapper(categoryId);
160 
161             Object paramObj1 = subject;
162 
163             if (subject == null) {
164                 paramObj1 = new NullWrapper("java.lang.String");
165             }
166 
167             Object paramObj2 = body;
168 
169             if (body == null) {
170                 paramObj2 = new NullWrapper("java.lang.String");
171             }
172 
173             Object paramObj3 = files;
174 
175             if (files == null) {
176                 paramObj3 = new NullWrapper("java.util.List");
177             }
178 
179             Object paramObj4 = new BooleanWrapper(anonymous);
180 
181             Object paramObj5 = new DoubleWrapper(priority);
182 
183             Object paramObj6 = serviceContext;
184 
185             if (serviceContext == null) {
186                 paramObj6 = new NullWrapper(
187                         "com.liferay.portal.service.ServiceContext");
188             }
189 
190             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
191                     "addMessage",
192                     new Object[] {
193                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
194                         paramObj5, paramObj6
195                     });
196 
197             Object returnObj = null;
198 
199             try {
200                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
201             }
202             catch (Exception e) {
203                 if (e instanceof com.liferay.portal.PortalException) {
204                     throw (com.liferay.portal.PortalException)e;
205                 }
206 
207                 if (e instanceof com.liferay.portal.SystemException) {
208                     throw (com.liferay.portal.SystemException)e;
209                 }
210 
211                 throw new com.liferay.portal.SystemException(e);
212             }
213 
214             return (com.liferay.portlet.messageboards.model.MBMessage)returnObj;
215         }
216         catch (com.liferay.portal.SystemException se) {
217             _log.error(se, se);
218 
219             throw se;
220         }
221     }
222 
223     public static com.liferay.portlet.messageboards.model.MBMessage addMessage(
224         HttpPrincipal httpPrincipal, long categoryId, long threadId,
225         long parentMessageId, java.lang.String subject, java.lang.String body,
226         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
227         boolean anonymous, double priority,
228         com.liferay.portal.service.ServiceContext serviceContext)
229         throws com.liferay.portal.PortalException,
230             com.liferay.portal.SystemException {
231         try {
232             Object paramObj0 = new LongWrapper(categoryId);
233 
234             Object paramObj1 = new LongWrapper(threadId);
235 
236             Object paramObj2 = new LongWrapper(parentMessageId);
237 
238             Object paramObj3 = subject;
239 
240             if (subject == null) {
241                 paramObj3 = new NullWrapper("java.lang.String");
242             }
243 
244             Object paramObj4 = body;
245 
246             if (body == null) {
247                 paramObj4 = new NullWrapper("java.lang.String");
248             }
249 
250             Object paramObj5 = files;
251 
252             if (files == null) {
253                 paramObj5 = new NullWrapper("java.util.List");
254             }
255 
256             Object paramObj6 = new BooleanWrapper(anonymous);
257 
258             Object paramObj7 = new DoubleWrapper(priority);
259 
260             Object paramObj8 = serviceContext;
261 
262             if (serviceContext == null) {
263                 paramObj8 = new NullWrapper(
264                         "com.liferay.portal.service.ServiceContext");
265             }
266 
267             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
268                     "addMessage",
269                     new Object[] {
270                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
271                         paramObj5, paramObj6, paramObj7, paramObj8
272                     });
273 
274             Object returnObj = null;
275 
276             try {
277                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
278             }
279             catch (Exception e) {
280                 if (e instanceof com.liferay.portal.PortalException) {
281                     throw (com.liferay.portal.PortalException)e;
282                 }
283 
284                 if (e instanceof com.liferay.portal.SystemException) {
285                     throw (com.liferay.portal.SystemException)e;
286                 }
287 
288                 throw new com.liferay.portal.SystemException(e);
289             }
290 
291             return (com.liferay.portlet.messageboards.model.MBMessage)returnObj;
292         }
293         catch (com.liferay.portal.SystemException se) {
294             _log.error(se, se);
295 
296             throw se;
297         }
298     }
299 
300     public static void deleteDiscussionMessage(HttpPrincipal httpPrincipal,
301         long groupId, java.lang.String className, long classPK, long messageId)
302         throws com.liferay.portal.PortalException,
303             com.liferay.portal.SystemException {
304         try {
305             Object paramObj0 = new LongWrapper(groupId);
306 
307             Object paramObj1 = className;
308 
309             if (className == null) {
310                 paramObj1 = new NullWrapper("java.lang.String");
311             }
312 
313             Object paramObj2 = new LongWrapper(classPK);
314 
315             Object paramObj3 = new LongWrapper(messageId);
316 
317             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
318                     "deleteDiscussionMessage",
319                     new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
320 
321             try {
322                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
323             }
324             catch (Exception e) {
325                 if (e instanceof com.liferay.portal.PortalException) {
326                     throw (com.liferay.portal.PortalException)e;
327                 }
328 
329                 if (e instanceof com.liferay.portal.SystemException) {
330                     throw (com.liferay.portal.SystemException)e;
331                 }
332 
333                 throw new com.liferay.portal.SystemException(e);
334             }
335         }
336         catch (com.liferay.portal.SystemException se) {
337             _log.error(se, se);
338 
339             throw se;
340         }
341     }
342 
343     public static void deleteMessage(HttpPrincipal httpPrincipal, long messageId)
344         throws com.liferay.portal.PortalException,
345             com.liferay.portal.SystemException {
346         try {
347             Object paramObj0 = new LongWrapper(messageId);
348 
349             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
350                     "deleteMessage", new Object[] { paramObj0 });
351 
352             try {
353                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
354             }
355             catch (Exception e) {
356                 if (e instanceof com.liferay.portal.PortalException) {
357                     throw (com.liferay.portal.PortalException)e;
358                 }
359 
360                 if (e instanceof com.liferay.portal.SystemException) {
361                     throw (com.liferay.portal.SystemException)e;
362                 }
363 
364                 throw new com.liferay.portal.SystemException(e);
365             }
366         }
367         catch (com.liferay.portal.SystemException se) {
368             _log.error(se, se);
369 
370             throw se;
371         }
372     }
373 
374     public static java.util.List<com.liferay.portlet.messageboards.model.MBMessage> getCategoryMessages(
375         HttpPrincipal httpPrincipal, long categoryId, int start, int end)
376         throws com.liferay.portal.PortalException,
377             com.liferay.portal.SystemException {
378         try {
379             Object paramObj0 = new LongWrapper(categoryId);
380 
381             Object paramObj1 = new IntegerWrapper(start);
382 
383             Object paramObj2 = new IntegerWrapper(end);
384 
385             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
386                     "getCategoryMessages",
387                     new Object[] { paramObj0, paramObj1, paramObj2 });
388 
389             Object returnObj = null;
390 
391             try {
392                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
393             }
394             catch (Exception e) {
395                 if (e instanceof com.liferay.portal.PortalException) {
396                     throw (com.liferay.portal.PortalException)e;
397                 }
398 
399                 if (e instanceof com.liferay.portal.SystemException) {
400                     throw (com.liferay.portal.SystemException)e;
401                 }
402 
403                 throw new com.liferay.portal.SystemException(e);
404             }
405 
406             return (java.util.List<com.liferay.portlet.messageboards.model.MBMessage>)returnObj;
407         }
408         catch (com.liferay.portal.SystemException se) {
409             _log.error(se, se);
410 
411             throw se;
412         }
413     }
414 
415     public static int getCategoryMessagesCount(HttpPrincipal httpPrincipal,
416         long categoryId) throws com.liferay.portal.SystemException {
417         try {
418             Object paramObj0 = new LongWrapper(categoryId);
419 
420             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
421                     "getCategoryMessagesCount", new Object[] { paramObj0 });
422 
423             Object returnObj = null;
424 
425             try {
426                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
427             }
428             catch (Exception e) {
429                 if (e instanceof com.liferay.portal.SystemException) {
430                     throw (com.liferay.portal.SystemException)e;
431                 }
432 
433                 throw new com.liferay.portal.SystemException(e);
434             }
435 
436             return ((Integer)returnObj).intValue();
437         }
438         catch (com.liferay.portal.SystemException se) {
439             _log.error(se, se);
440 
441             throw se;
442         }
443     }
444 
445     public static java.lang.String getCategoryMessagesRSS(
446         HttpPrincipal httpPrincipal, long categoryId, int max,
447         java.lang.String type, double version, java.lang.String displayStyle,
448         java.lang.String feedURL, java.lang.String entryURL,
449         com.liferay.portal.theme.ThemeDisplay themeDisplay)
450         throws com.liferay.portal.PortalException,
451             com.liferay.portal.SystemException {
452         try {
453             Object paramObj0 = new LongWrapper(categoryId);
454 
455             Object paramObj1 = new IntegerWrapper(max);
456 
457             Object paramObj2 = type;
458 
459             if (type == null) {
460                 paramObj2 = new NullWrapper("java.lang.String");
461             }
462 
463             Object paramObj3 = new DoubleWrapper(version);
464 
465             Object paramObj4 = displayStyle;
466 
467             if (displayStyle == null) {
468                 paramObj4 = new NullWrapper("java.lang.String");
469             }
470 
471             Object paramObj5 = feedURL;
472 
473             if (feedURL == null) {
474                 paramObj5 = new NullWrapper("java.lang.String");
475             }
476 
477             Object paramObj6 = entryURL;
478 
479             if (entryURL == null) {
480                 paramObj6 = new NullWrapper("java.lang.String");
481             }
482 
483             Object paramObj7 = themeDisplay;
484 
485             if (themeDisplay == null) {
486                 paramObj7 = new NullWrapper(
487                         "com.liferay.portal.theme.ThemeDisplay");
488             }
489 
490             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
491                     "getCategoryMessagesRSS",
492                     new Object[] {
493                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
494                         paramObj5, paramObj6, paramObj7
495                     });
496 
497             Object returnObj = null;
498 
499             try {
500                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
501             }
502             catch (Exception e) {
503                 if (e instanceof com.liferay.portal.PortalException) {
504                     throw (com.liferay.portal.PortalException)e;
505                 }
506 
507                 if (e instanceof com.liferay.portal.SystemException) {
508                     throw (com.liferay.portal.SystemException)e;
509                 }
510 
511                 throw new com.liferay.portal.SystemException(e);
512             }
513 
514             return (java.lang.String)returnObj;
515         }
516         catch (com.liferay.portal.SystemException se) {
517             _log.error(se, se);
518 
519             throw se;
520         }
521     }
522 
523     public static java.lang.String getCompanyMessagesRSS(
524         HttpPrincipal httpPrincipal, long companyId, int max,
525         java.lang.String type, double version, java.lang.String displayStyle,
526         java.lang.String feedURL, java.lang.String entryURL,
527         com.liferay.portal.theme.ThemeDisplay themeDisplay)
528         throws com.liferay.portal.PortalException,
529             com.liferay.portal.SystemException {
530         try {
531             Object paramObj0 = new LongWrapper(companyId);
532 
533             Object paramObj1 = new IntegerWrapper(max);
534 
535             Object paramObj2 = type;
536 
537             if (type == null) {
538                 paramObj2 = new NullWrapper("java.lang.String");
539             }
540 
541             Object paramObj3 = new DoubleWrapper(version);
542 
543             Object paramObj4 = displayStyle;
544 
545             if (displayStyle == null) {
546                 paramObj4 = new NullWrapper("java.lang.String");
547             }
548 
549             Object paramObj5 = feedURL;
550 
551             if (feedURL == null) {
552                 paramObj5 = new NullWrapper("java.lang.String");
553             }
554 
555             Object paramObj6 = entryURL;
556 
557             if (entryURL == null) {
558                 paramObj6 = new NullWrapper("java.lang.String");
559             }
560 
561             Object paramObj7 = themeDisplay;
562 
563             if (themeDisplay == null) {
564                 paramObj7 = new NullWrapper(
565                         "com.liferay.portal.theme.ThemeDisplay");
566             }
567 
568             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
569                     "getCompanyMessagesRSS",
570                     new Object[] {
571                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
572                         paramObj5, paramObj6, paramObj7
573                     });
574 
575             Object returnObj = null;
576 
577             try {
578                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
579             }
580             catch (Exception e) {
581                 if (e instanceof com.liferay.portal.PortalException) {
582                     throw (com.liferay.portal.PortalException)e;
583                 }
584 
585                 if (e instanceof com.liferay.portal.SystemException) {
586                     throw (com.liferay.portal.SystemException)e;
587                 }
588 
589                 throw new com.liferay.portal.SystemException(e);
590             }
591 
592             return (java.lang.String)returnObj;
593         }
594         catch (com.liferay.portal.SystemException se) {
595             _log.error(se, se);
596 
597             throw se;
598         }
599     }
600 
601     public static java.lang.String getGroupMessagesRSS(
602         HttpPrincipal httpPrincipal, long groupId, int max,
603         java.lang.String type, double version, java.lang.String displayStyle,
604         java.lang.String feedURL, java.lang.String entryURL,
605         com.liferay.portal.theme.ThemeDisplay themeDisplay)
606         throws com.liferay.portal.PortalException,
607             com.liferay.portal.SystemException {
608         try {
609             Object paramObj0 = new LongWrapper(groupId);
610 
611             Object paramObj1 = new IntegerWrapper(max);
612 
613             Object paramObj2 = type;
614 
615             if (type == null) {
616                 paramObj2 = new NullWrapper("java.lang.String");
617             }
618 
619             Object paramObj3 = new DoubleWrapper(version);
620 
621             Object paramObj4 = displayStyle;
622 
623             if (displayStyle == null) {
624                 paramObj4 = new NullWrapper("java.lang.String");
625             }
626 
627             Object paramObj5 = feedURL;
628 
629             if (feedURL == null) {
630                 paramObj5 = new NullWrapper("java.lang.String");
631             }
632 
633             Object paramObj6 = entryURL;
634 
635             if (entryURL == null) {
636                 paramObj6 = new NullWrapper("java.lang.String");
637             }
638 
639             Object paramObj7 = themeDisplay;
640 
641             if (themeDisplay == null) {
642                 paramObj7 = new NullWrapper(
643                         "com.liferay.portal.theme.ThemeDisplay");
644             }
645 
646             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
647                     "getGroupMessagesRSS",
648                     new Object[] {
649                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
650                         paramObj5, paramObj6, paramObj7
651                     });
652 
653             Object returnObj = null;
654 
655             try {
656                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
657             }
658             catch (Exception e) {
659                 if (e instanceof com.liferay.portal.PortalException) {
660                     throw (com.liferay.portal.PortalException)e;
661                 }
662 
663                 if (e instanceof com.liferay.portal.SystemException) {
664                     throw (com.liferay.portal.SystemException)e;
665                 }
666 
667                 throw new com.liferay.portal.SystemException(e);
668             }
669 
670             return (java.lang.String)returnObj;
671         }
672         catch (com.liferay.portal.SystemException se) {
673             _log.error(se, se);
674 
675             throw se;
676         }
677     }
678 
679     public static java.lang.String getGroupMessagesRSS(
680         HttpPrincipal httpPrincipal, long groupId, long userId, int max,
681         java.lang.String type, double version, java.lang.String displayStyle,
682         java.lang.String feedURL, java.lang.String entryURL,
683         com.liferay.portal.theme.ThemeDisplay themeDisplay)
684         throws com.liferay.portal.PortalException,
685             com.liferay.portal.SystemException {
686         try {
687             Object paramObj0 = new LongWrapper(groupId);
688 
689             Object paramObj1 = new LongWrapper(userId);
690 
691             Object paramObj2 = new IntegerWrapper(max);
692 
693             Object paramObj3 = type;
694 
695             if (type == null) {
696                 paramObj3 = new NullWrapper("java.lang.String");
697             }
698 
699             Object paramObj4 = new DoubleWrapper(version);
700 
701             Object paramObj5 = displayStyle;
702 
703             if (displayStyle == null) {
704                 paramObj5 = new NullWrapper("java.lang.String");
705             }
706 
707             Object paramObj6 = feedURL;
708 
709             if (feedURL == null) {
710                 paramObj6 = new NullWrapper("java.lang.String");
711             }
712 
713             Object paramObj7 = entryURL;
714 
715             if (entryURL == null) {
716                 paramObj7 = new NullWrapper("java.lang.String");
717             }
718 
719             Object paramObj8 = themeDisplay;
720 
721             if (themeDisplay == null) {
722                 paramObj8 = new NullWrapper(
723                         "com.liferay.portal.theme.ThemeDisplay");
724             }
725 
726             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
727                     "getGroupMessagesRSS",
728                     new Object[] {
729                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
730                         paramObj5, paramObj6, paramObj7, paramObj8
731                     });
732 
733             Object returnObj = null;
734 
735             try {
736                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
737             }
738             catch (Exception e) {
739                 if (e instanceof com.liferay.portal.PortalException) {
740                     throw (com.liferay.portal.PortalException)e;
741                 }
742 
743                 if (e instanceof com.liferay.portal.SystemException) {
744                     throw (com.liferay.portal.SystemException)e;
745                 }
746 
747                 throw new com.liferay.portal.SystemException(e);
748             }
749 
750             return (java.lang.String)returnObj;
751         }
752         catch (com.liferay.portal.SystemException se) {
753             _log.error(se, se);
754 
755             throw se;
756         }
757     }
758 
759     public static com.liferay.portlet.messageboards.model.MBMessage getMessage(
760         HttpPrincipal httpPrincipal, long messageId)
761         throws com.liferay.portal.PortalException,
762             com.liferay.portal.SystemException {
763         try {
764             Object paramObj0 = new LongWrapper(messageId);
765 
766             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
767                     "getMessage", new Object[] { paramObj0 });
768 
769             Object returnObj = null;
770 
771             try {
772                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
773             }
774             catch (Exception e) {
775                 if (e instanceof com.liferay.portal.PortalException) {
776                     throw (com.liferay.portal.PortalException)e;
777                 }
778 
779                 if (e instanceof com.liferay.portal.SystemException) {
780                     throw (com.liferay.portal.SystemException)e;
781                 }
782 
783                 throw new com.liferay.portal.SystemException(e);
784             }
785 
786             return (com.liferay.portlet.messageboards.model.MBMessage)returnObj;
787         }
788         catch (com.liferay.portal.SystemException se) {
789             _log.error(se, se);
790 
791             throw se;
792         }
793     }
794 
795     public static com.liferay.portlet.messageboards.model.MBMessageDisplay getMessageDisplay(
796         HttpPrincipal httpPrincipal, long messageId, java.lang.String threadView)
797         throws com.liferay.portal.PortalException,
798             com.liferay.portal.SystemException {
799         try {
800             Object paramObj0 = new LongWrapper(messageId);
801 
802             Object paramObj1 = threadView;
803 
804             if (threadView == null) {
805                 paramObj1 = new NullWrapper("java.lang.String");
806             }
807 
808             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
809                     "getMessageDisplay", new Object[] { paramObj0, paramObj1 });
810 
811             Object returnObj = null;
812 
813             try {
814                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
815             }
816             catch (Exception e) {
817                 if (e instanceof com.liferay.portal.PortalException) {
818                     throw (com.liferay.portal.PortalException)e;
819                 }
820 
821                 if (e instanceof com.liferay.portal.SystemException) {
822                     throw (com.liferay.portal.SystemException)e;
823                 }
824 
825                 throw new com.liferay.portal.SystemException(e);
826             }
827 
828             return (com.liferay.portlet.messageboards.model.MBMessageDisplay)returnObj;
829         }
830         catch (com.liferay.portal.SystemException se) {
831             _log.error(se, se);
832 
833             throw se;
834         }
835     }
836 
837     public static java.lang.String getThreadMessagesRSS(
838         HttpPrincipal httpPrincipal, long threadId, int max,
839         java.lang.String type, double version, java.lang.String displayStyle,
840         java.lang.String feedURL, java.lang.String entryURL,
841         com.liferay.portal.theme.ThemeDisplay themeDisplay)
842         throws com.liferay.portal.PortalException,
843             com.liferay.portal.SystemException {
844         try {
845             Object paramObj0 = new LongWrapper(threadId);
846 
847             Object paramObj1 = new IntegerWrapper(max);
848 
849             Object paramObj2 = type;
850 
851             if (type == null) {
852                 paramObj2 = new NullWrapper("java.lang.String");
853             }
854 
855             Object paramObj3 = new DoubleWrapper(version);
856 
857             Object paramObj4 = displayStyle;
858 
859             if (displayStyle == null) {
860                 paramObj4 = new NullWrapper("java.lang.String");
861             }
862 
863             Object paramObj5 = feedURL;
864 
865             if (feedURL == null) {
866                 paramObj5 = new NullWrapper("java.lang.String");
867             }
868 
869             Object paramObj6 = entryURL;
870 
871             if (entryURL == null) {
872                 paramObj6 = new NullWrapper("java.lang.String");
873             }
874 
875             Object paramObj7 = themeDisplay;
876 
877             if (themeDisplay == null) {
878                 paramObj7 = new NullWrapper(
879                         "com.liferay.portal.theme.ThemeDisplay");
880             }
881 
882             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
883                     "getThreadMessagesRSS",
884                     new Object[] {
885                         paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
886                         paramObj5, paramObj6, paramObj7
887                     });
888 
889             Object returnObj = null;
890 
891             try {
892                 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
893             }
894             catch (Exception e) {
895                 if (e instanceof com.liferay.portal.PortalException) {
896                     throw (com.liferay.portal.PortalException)e;
897                 }
898 
899                 if (e instanceof com.liferay.portal.SystemException) {
900                     throw (com.liferay.portal.SystemException)e;
901                 }
902 
903                 throw new com.liferay.portal.SystemException(e);
904             }
905 
906             return (java.lang.String)returnObj;
907         }
908         catch (com.liferay.portal.SystemException se) {
909             _log.error(se, se);
910 
911             throw se;
912         }
913     }
914 
915     public static void subscribeMessage(HttpPrincipal httpPrincipal,
916         long messageId)
917         throws com.liferay.portal.PortalException,
918             com.liferay.portal.SystemException {
919         try {
920             Object paramObj0 = new LongWrapper(messageId);
921 
922             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
923                     "subscribeMessage", new Object[] { paramObj0 });
924 
925             try {
926                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
927             }
928             catch (Exception e) {
929                 if (e instanceof com.liferay.portal.PortalException) {
930                     throw (com.liferay.portal.PortalException)e;
931                 }
932 
933                 if (e instanceof com.liferay.portal.SystemException) {
934                     throw (com.liferay.portal.SystemException)e;
935                 }
936 
937                 throw new com.liferay.portal.SystemException(e);
938             }
939         }
940         catch (com.liferay.portal.SystemException se) {
941             _log.error(se, se);
942 
943             throw se;
944         }
945     }
946 
947     public static void unsubscribeMessage(HttpPrincipal httpPrincipal,
948         long messageId)
949         throws com.liferay.portal.PortalException,
950             com.liferay.portal.SystemException {
951         try {
952             Object paramObj0 = new LongWrapper(messageId);
953 
954             MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
955                     "unsubscribeMessage", new Object[] { paramObj0 });
956 
957             try {
958                 TunnelUtil.invoke(httpPrincipal, methodWrapper);
959             }
960             catch (Exception e) {
961                 if (e instanceof com.liferay.portal.PortalException) {
962                     throw (com.liferay.portal.PortalException)e;
963                 }
964 
965                 if (e instanceof com.liferay.portal.SystemException) {
966                     throw (com.liferay.portal.SystemException)e;
967                 }
968 
969                 throw new com.liferay.portal.SystemException(e);
970             }
971         }
972         catch (com.liferay.portal.SystemException se) {
973             _log.error(se, se);
974 
975             throw se;
976         }
977     }
978 
979     public static com.liferay.portlet.messageboards.model.MBMessage updateDiscussionMessage(
980         HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
981         long messageId, java.lang.String subject, java.lang.String body,
982         com.liferay.portal.service.ServiceContext serviceContext)
983         throws com.liferay.portal.PortalException,
984             com.liferay.portal.SystemException {
985         try {
986             Object paramObj0 = className;
987 
988             if (className == null) {
989                 paramObj0 = new NullWrapper("java.lang.String");
990             }
991 
992             Object paramObj1 = new LongWrapper(classPK);
993 
994             Object paramObj2 = new LongWrapper(messageId);
995 
996             Object paramObj3 = subject;
997 
998             if (subject == null) {
999                 paramObj3 = new NullWrapper("java.lang.String");
1000            }
1001
1002            Object paramObj4 = body;
1003
1004            if (body == null) {
1005                paramObj4 = new NullWrapper("java.lang.String");
1006            }
1007
1008            Object paramObj5 = serviceContext;
1009
1010            if (serviceContext == null) {
1011                paramObj5 = new NullWrapper(
1012                        "com.liferay.portal.service.ServiceContext");
1013            }
1014
1015            MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
1016                    "updateDiscussionMessage",
1017                    new Object[] {
1018                        paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
1019                        paramObj5
1020                    });
1021
1022            Object returnObj = null;
1023
1024            try {
1025                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1026            }
1027            catch (Exception e) {
1028                if (e instanceof com.liferay.portal.PortalException) {
1029                    throw (com.liferay.portal.PortalException)e;
1030                }
1031
1032                if (e instanceof com.liferay.portal.SystemException) {
1033                    throw (com.liferay.portal.SystemException)e;
1034                }
1035
1036                throw new com.liferay.portal.SystemException(e);
1037            }
1038
1039            return (com.liferay.portlet.messageboards.model.MBMessage)returnObj;
1040        }
1041        catch (com.liferay.portal.SystemException se) {
1042            _log.error(se, se);
1043
1044            throw se;
1045        }
1046    }
1047
1048    public static com.liferay.portlet.messageboards.model.MBMessage updateMessage(
1049        HttpPrincipal httpPrincipal, long messageId, java.lang.String subject,
1050        java.lang.String body,
1051        java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
1052        java.util.List<String> existingFiles, double priority,
1053        com.liferay.portal.service.ServiceContext serviceContext)
1054        throws com.liferay.portal.PortalException,
1055            com.liferay.portal.SystemException {
1056        try {
1057            Object paramObj0 = new LongWrapper(messageId);
1058
1059            Object paramObj1 = subject;
1060
1061            if (subject == null) {
1062                paramObj1 = new NullWrapper("java.lang.String");
1063            }
1064
1065            Object paramObj2 = body;
1066
1067            if (body == null) {
1068                paramObj2 = new NullWrapper("java.lang.String");
1069            }
1070
1071            Object paramObj3 = files;
1072
1073            if (files == null) {
1074                paramObj3 = new NullWrapper("java.util.List");
1075            }
1076
1077            Object paramObj4 = existingFiles;
1078
1079            if (existingFiles == null) {
1080                paramObj4 = new NullWrapper("java.util.List");
1081            }
1082
1083            Object paramObj5 = new DoubleWrapper(priority);
1084
1085            Object paramObj6 = serviceContext;
1086
1087            if (serviceContext == null) {
1088                paramObj6 = new NullWrapper(
1089                        "com.liferay.portal.service.ServiceContext");
1090            }
1091
1092            MethodWrapper methodWrapper = new MethodWrapper(MBMessageServiceUtil.class.getName(),
1093                    "updateMessage",
1094                    new Object[] {
1095                        paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
1096                        paramObj5, paramObj6
1097                    });
1098
1099            Object returnObj = null;
1100
1101            try {
1102                returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
1103            }
1104            catch (Exception e) {
1105                if (e instanceof com.liferay.portal.PortalException) {
1106                    throw (com.liferay.portal.PortalException)e;
1107                }
1108
1109                if (e instanceof com.liferay.portal.SystemException) {
1110                    throw (com.liferay.portal.SystemException)e;
1111                }
1112
1113                throw new com.liferay.portal.SystemException(e);
1114            }
1115
1116            return (com.liferay.portlet.messageboards.model.MBMessage)returnObj;
1117        }
1118        catch (com.liferay.portal.SystemException se) {
1119            _log.error(se, se);
1120
1121            throw se;
1122        }
1123    }
1124
1125    private static Log _log = LogFactoryUtil.getLog(MBMessageServiceHttp.class);
1126}