1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.messageboards.service.http;
16  
17  import com.liferay.portal.kernel.log.Log;
18  import com.liferay.portal.kernel.log.LogFactoryUtil;
19  
20  import com.liferay.portlet.messageboards.service.MBMessageServiceUtil;
21  
22  import java.rmi.RemoteException;
23  
24  /**
25   * <a href="MBMessageServiceSoap.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * <p>
33   * This class provides a SOAP utility for the
34   * {@link com.liferay.portlet.messageboards.service.MBMessageServiceUtil} service utility. The
35   * static methods of this class calls the same methods of the service utility.
36   * However, the signatures are different because it is difficult for SOAP to
37   * support certain types.
38   * </p>
39   *
40   * <p>
41   * ServiceBuilder follows certain rules in translating the methods. For example,
42   * if the method in the service utility returns a {@link java.util.List}, that
43   * is translated to an array of {@link com.liferay.portlet.messageboards.model.MBMessageSoap}.
44   * If the method in the service utility returns a
45   * {@link com.liferay.portlet.messageboards.model.MBMessage}, that is translated to a
46   * {@link com.liferay.portlet.messageboards.model.MBMessageSoap}. Methods that SOAP cannot
47   * safely wire are skipped.
48   * </p>
49   *
50   * <p>
51   * The benefits of using the SOAP utility is that it is cross platform
52   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
53   * even Perl, to call the generated services. One drawback of SOAP is that it is
54   * slow because it needs to serialize all calls into a text format (XML).
55   * </p>
56   *
57   * <p>
58   * You can see a list of services at
59   * http://localhost:8080/tunnel-web/secure/axis. Set the property
60   * <b>tunnel.servlet.hosts.allowed</b> in portal.properties to configure
61   * security.
62   * </p>
63   *
64   * <p>
65   * The SOAP utility is only generated for remote services.
66   * </p>
67   *
68   * @author    Brian Wing Shun Chan
69   * @see       MBMessageServiceHttp
70   * @see       com.liferay.portlet.messageboards.model.MBMessageSoap
71   * @see       com.liferay.portlet.messageboards.service.MBMessageServiceUtil
72   * @generated
73   */
74  public class MBMessageServiceSoap {
75      public static com.liferay.portlet.messageboards.model.MBMessageSoap addDiscussionMessage(
76          long groupId, java.lang.String className, long classPK,
77          java.lang.String permissionClassName, long permissionClassPK,
78          long threadId, long parentMessageId, java.lang.String subject,
79          java.lang.String body,
80          com.liferay.portal.service.ServiceContext serviceContext)
81          throws RemoteException {
82          try {
83              com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addDiscussionMessage(groupId,
84                      className, classPK, permissionClassName, permissionClassPK,
85                      threadId, parentMessageId, subject, body, serviceContext);
86  
87              return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
88          }
89          catch (Exception e) {
90              _log.error(e, e);
91  
92              throw new RemoteException(e.getMessage());
93          }
94      }
95  
96      public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
97          long groupId, long categoryId, java.lang.String subject,
98          java.lang.String body,
99          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
100         boolean anonymous, double priority, boolean allowPingbacks,
101         com.liferay.portal.service.ServiceContext serviceContext)
102         throws RemoteException {
103         try {
104             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
105                     categoryId, subject, body, files, anonymous, priority,
106                     allowPingbacks, serviceContext);
107 
108             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
109         }
110         catch (Exception e) {
111             _log.error(e, e);
112 
113             throw new RemoteException(e.getMessage());
114         }
115     }
116 
117     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
118         long groupId, long categoryId, long threadId, long parentMessageId,
119         java.lang.String subject, java.lang.String body,
120         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
121         boolean anonymous, double priority, boolean allowPingbacks,
122         com.liferay.portal.service.ServiceContext serviceContext)
123         throws RemoteException {
124         try {
125             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
126                     categoryId, threadId, parentMessageId, subject, body,
127                     files, anonymous, priority, allowPingbacks, serviceContext);
128 
129             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
130         }
131         catch (Exception e) {
132             _log.error(e, e);
133 
134             throw new RemoteException(e.getMessage());
135         }
136     }
137 
138     public static void deleteDiscussionMessage(long groupId,
139         java.lang.String className, long classPK,
140         java.lang.String permissionClassName, long permissionClassPK,
141         long messageId) throws RemoteException {
142         try {
143             MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
144                 classPK, permissionClassName, permissionClassPK, messageId);
145         }
146         catch (Exception e) {
147             _log.error(e, e);
148 
149             throw new RemoteException(e.getMessage());
150         }
151     }
152 
153     public static void deleteMessage(long messageId) throws RemoteException {
154         try {
155             MBMessageServiceUtil.deleteMessage(messageId);
156         }
157         catch (Exception e) {
158             _log.error(e, e);
159 
160             throw new RemoteException(e.getMessage());
161         }
162     }
163 
164     public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
165         long groupId, long categoryId, int status, int start, int end)
166         throws RemoteException {
167         try {
168             java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
169                 MBMessageServiceUtil.getCategoryMessages(groupId, categoryId,
170                     status, start, end);
171 
172             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
173         }
174         catch (Exception e) {
175             _log.error(e, e);
176 
177             throw new RemoteException(e.getMessage());
178         }
179     }
180 
181     public static int getCategoryMessagesCount(long groupId, long categoryId,
182         int status) throws RemoteException {
183         try {
184             int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(groupId,
185                     categoryId, status);
186 
187             return returnValue;
188         }
189         catch (Exception e) {
190             _log.error(e, e);
191 
192             throw new RemoteException(e.getMessage());
193         }
194     }
195 
196     public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
197         long messageId) throws RemoteException {
198         try {
199             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
200 
201             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
202         }
203         catch (Exception e) {
204             _log.error(e, e);
205 
206             throw new RemoteException(e.getMessage());
207         }
208     }
209 
210     public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getThreadMessages(
211         long groupId, long categoryId, long threadId, int status, int start,
212         int end) throws RemoteException {
213         try {
214             java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
215                 MBMessageServiceUtil.getThreadMessages(groupId, categoryId,
216                     threadId, status, start, end);
217 
218             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
219         }
220         catch (Exception e) {
221             _log.error(e, e);
222 
223             throw new RemoteException(e.getMessage());
224         }
225     }
226 
227     public static int getThreadMessagesCount(long groupId, long categoryId,
228         long threadId, int status) throws RemoteException {
229         try {
230             int returnValue = MBMessageServiceUtil.getThreadMessagesCount(groupId,
231                     categoryId, threadId, status);
232 
233             return returnValue;
234         }
235         catch (Exception e) {
236             _log.error(e, e);
237 
238             throw new RemoteException(e.getMessage());
239         }
240     }
241 
242     public static void subscribeMessage(long messageId)
243         throws RemoteException {
244         try {
245             MBMessageServiceUtil.subscribeMessage(messageId);
246         }
247         catch (Exception e) {
248             _log.error(e, e);
249 
250             throw new RemoteException(e.getMessage());
251         }
252     }
253 
254     public static void unsubscribeMessage(long messageId)
255         throws RemoteException {
256         try {
257             MBMessageServiceUtil.unsubscribeMessage(messageId);
258         }
259         catch (Exception e) {
260             _log.error(e, e);
261 
262             throw new RemoteException(e.getMessage());
263         }
264     }
265 
266     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
267         java.lang.String className, long classPK,
268         java.lang.String permissionClassName, long permissionClassPK,
269         long messageId, java.lang.String subject, java.lang.String body,
270         com.liferay.portal.service.ServiceContext serviceContext)
271         throws RemoteException {
272         try {
273             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(className,
274                     classPK, permissionClassName, permissionClassPK, messageId,
275                     subject, body, serviceContext);
276 
277             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
278         }
279         catch (Exception e) {
280             _log.error(e, e);
281 
282             throw new RemoteException(e.getMessage());
283         }
284     }
285 
286     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
287         long messageId, java.lang.String subject, java.lang.String body,
288         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<java.lang.String, byte[]>> files,
289         java.util.List<java.lang.String> existingFiles, double priority,
290         boolean allowPingbacks,
291         com.liferay.portal.service.ServiceContext serviceContext)
292         throws RemoteException {
293         try {
294             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
295                     subject, body, files, existingFiles, priority,
296                     allowPingbacks, serviceContext);
297 
298             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
299         }
300         catch (Exception e) {
301             _log.error(e, e);
302 
303             throw new RemoteException(e.getMessage());
304         }
305     }
306 
307     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
308 }