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          java.lang.String className, long classPK, long threadId,
77          long parentMessageId, java.lang.String subject, java.lang.String body,
78          com.liferay.portal.service.ServiceContext serviceContext)
79          throws RemoteException {
80          try {
81              com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addDiscussionMessage(className,
82                      classPK, threadId, parentMessageId, subject, body,
83                      serviceContext);
84  
85              return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
86          }
87          catch (Exception e) {
88              _log.error(e, e);
89  
90              throw new RemoteException(e.getMessage());
91          }
92      }
93  
94      public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
95          long groupId, long categoryId, java.lang.String subject,
96          java.lang.String body,
97          java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
98          boolean anonymous, double priority, boolean allowPingbacks,
99          com.liferay.portal.service.ServiceContext serviceContext)
100         throws RemoteException {
101         try {
102             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
103                     categoryId, subject, body, files, anonymous, priority,
104                     allowPingbacks, serviceContext);
105 
106             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
107         }
108         catch (Exception e) {
109             _log.error(e, e);
110 
111             throw new RemoteException(e.getMessage());
112         }
113     }
114 
115     public static com.liferay.portlet.messageboards.model.MBMessageSoap addMessage(
116         long groupId, long categoryId, long threadId, long parentMessageId,
117         java.lang.String subject, java.lang.String body,
118         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
119         boolean anonymous, double priority, boolean allowPingbacks,
120         com.liferay.portal.service.ServiceContext serviceContext)
121         throws RemoteException {
122         try {
123             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.addMessage(groupId,
124                     categoryId, threadId, parentMessageId, subject, body,
125                     files, anonymous, priority, allowPingbacks, serviceContext);
126 
127             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
128         }
129         catch (Exception e) {
130             _log.error(e, e);
131 
132             throw new RemoteException(e.getMessage());
133         }
134     }
135 
136     public static void deleteDiscussionMessage(long groupId,
137         java.lang.String className, long classPK, long messageId)
138         throws RemoteException {
139         try {
140             MBMessageServiceUtil.deleteDiscussionMessage(groupId, className,
141                 classPK, messageId);
142         }
143         catch (Exception e) {
144             _log.error(e, e);
145 
146             throw new RemoteException(e.getMessage());
147         }
148     }
149 
150     public static void deleteMessage(long messageId) throws RemoteException {
151         try {
152             MBMessageServiceUtil.deleteMessage(messageId);
153         }
154         catch (Exception e) {
155             _log.error(e, e);
156 
157             throw new RemoteException(e.getMessage());
158         }
159     }
160 
161     public static com.liferay.portlet.messageboards.model.MBMessageSoap[] getCategoryMessages(
162         long groupId, long categoryId, int status, int start, int end)
163         throws RemoteException {
164         try {
165             java.util.List<com.liferay.portlet.messageboards.model.MBMessage> returnValue =
166                 MBMessageServiceUtil.getCategoryMessages(groupId, categoryId,
167                     status, start, end);
168 
169             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModels(returnValue);
170         }
171         catch (Exception e) {
172             _log.error(e, e);
173 
174             throw new RemoteException(e.getMessage());
175         }
176     }
177 
178     public static int getCategoryMessagesCount(long groupId, long categoryId,
179         int status) throws RemoteException {
180         try {
181             int returnValue = MBMessageServiceUtil.getCategoryMessagesCount(groupId,
182                     categoryId, status);
183 
184             return returnValue;
185         }
186         catch (Exception e) {
187             _log.error(e, e);
188 
189             throw new RemoteException(e.getMessage());
190         }
191     }
192 
193     public static com.liferay.portlet.messageboards.model.MBMessageSoap getMessage(
194         long messageId) throws RemoteException {
195         try {
196             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.getMessage(messageId);
197 
198             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
199         }
200         catch (Exception e) {
201             _log.error(e, e);
202 
203             throw new RemoteException(e.getMessage());
204         }
205     }
206 
207     public static void subscribeMessage(long messageId)
208         throws RemoteException {
209         try {
210             MBMessageServiceUtil.subscribeMessage(messageId);
211         }
212         catch (Exception e) {
213             _log.error(e, e);
214 
215             throw new RemoteException(e.getMessage());
216         }
217     }
218 
219     public static void unsubscribeMessage(long messageId)
220         throws RemoteException {
221         try {
222             MBMessageServiceUtil.unsubscribeMessage(messageId);
223         }
224         catch (Exception e) {
225             _log.error(e, e);
226 
227             throw new RemoteException(e.getMessage());
228         }
229     }
230 
231     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateDiscussionMessage(
232         java.lang.String className, long classPK, long messageId,
233         java.lang.String subject, java.lang.String body,
234         com.liferay.portal.service.ServiceContext serviceContext)
235         throws RemoteException {
236         try {
237             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateDiscussionMessage(className,
238                     classPK, messageId, subject, body, serviceContext);
239 
240             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
241         }
242         catch (Exception e) {
243             _log.error(e, e);
244 
245             throw new RemoteException(e.getMessage());
246         }
247     }
248 
249     public static com.liferay.portlet.messageboards.model.MBMessageSoap updateMessage(
250         long messageId, java.lang.String subject, java.lang.String body,
251         java.util.List<com.liferay.portal.kernel.util.ObjectValuePair<String, byte[]>> files,
252         java.util.List<String> existingFiles, double priority,
253         boolean allowPingbacks,
254         com.liferay.portal.service.ServiceContext serviceContext)
255         throws RemoteException {
256         try {
257             com.liferay.portlet.messageboards.model.MBMessage returnValue = MBMessageServiceUtil.updateMessage(messageId,
258                     subject, body, files, existingFiles, priority,
259                     allowPingbacks, serviceContext);
260 
261             return com.liferay.portlet.messageboards.model.MBMessageSoap.toSoapModel(returnValue);
262         }
263         catch (Exception e) {
264             _log.error(e, e);
265 
266             throw new RemoteException(e.getMessage());
267         }
268     }
269 
270     private static Log _log = LogFactoryUtil.getLog(MBMessageServiceSoap.class);
271 }