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