1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.messageboards.service;
21  
22  
23  /**
24   * <a href="MBThreadLocalServiceUtil.java.html"><b><i>View Source</i></b></a>
25   *
26   * <p>
27   * ServiceBuilder generated this class. Modifications in this class will be
28   * overwritten the next time is generated.
29   * </p>
30   *
31   * <p>
32   * This class provides static methods for the
33   * <code>com.liferay.portlet.messageboards.service.MBThreadLocalService</code>
34   * bean. The static methods of this class calls the same methods of the bean
35   * instance. It's convenient to be able to just write one line to call a method
36   * on a bean instead of writing a lookup call and a method call.
37   * </p>
38   *
39   * @author Brian Wing Shun Chan
40   *
41   * @see com.liferay.portlet.messageboards.service.MBThreadLocalService
42   *
43   */
44  public class MBThreadLocalServiceUtil {
45      public static com.liferay.portlet.messageboards.model.MBThread addMBThread(
46          com.liferay.portlet.messageboards.model.MBThread mbThread)
47          throws com.liferay.portal.SystemException {
48          return getService().addMBThread(mbThread);
49      }
50  
51      public static com.liferay.portlet.messageboards.model.MBThread createMBThread(
52          long threadId) {
53          return getService().createMBThread(threadId);
54      }
55  
56      public static void deleteMBThread(long threadId)
57          throws com.liferay.portal.PortalException,
58              com.liferay.portal.SystemException {
59          getService().deleteMBThread(threadId);
60      }
61  
62      public static void deleteMBThread(
63          com.liferay.portlet.messageboards.model.MBThread mbThread)
64          throws com.liferay.portal.SystemException {
65          getService().deleteMBThread(mbThread);
66      }
67  
68      public static java.util.List<Object> dynamicQuery(
69          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
70          throws com.liferay.portal.SystemException {
71          return getService().dynamicQuery(dynamicQuery);
72      }
73  
74      public static java.util.List<Object> dynamicQuery(
75          com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
76          int end) throws com.liferay.portal.SystemException {
77          return getService().dynamicQuery(dynamicQuery, start, end);
78      }
79  
80      public static com.liferay.portlet.messageboards.model.MBThread getMBThread(
81          long threadId)
82          throws com.liferay.portal.PortalException,
83              com.liferay.portal.SystemException {
84          return getService().getMBThread(threadId);
85      }
86  
87      public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getMBThreads(
88          int start, int end) throws com.liferay.portal.SystemException {
89          return getService().getMBThreads(start, end);
90      }
91  
92      public static int getMBThreadsCount()
93          throws com.liferay.portal.SystemException {
94          return getService().getMBThreadsCount();
95      }
96  
97      public static com.liferay.portlet.messageboards.model.MBThread updateMBThread(
98          com.liferay.portlet.messageboards.model.MBThread mbThread)
99          throws com.liferay.portal.SystemException {
100         return getService().updateMBThread(mbThread);
101     }
102 
103     public static com.liferay.portlet.messageboards.model.MBThread updateMBThread(
104         com.liferay.portlet.messageboards.model.MBThread mbThread, boolean merge)
105         throws com.liferay.portal.SystemException {
106         return getService().updateMBThread(mbThread, merge);
107     }
108 
109     public static void deleteThread(long threadId)
110         throws com.liferay.portal.PortalException,
111             com.liferay.portal.SystemException {
112         getService().deleteThread(threadId);
113     }
114 
115     public static void deleteThread(
116         com.liferay.portlet.messageboards.model.MBThread thread)
117         throws com.liferay.portal.PortalException,
118             com.liferay.portal.SystemException {
119         getService().deleteThread(thread);
120     }
121 
122     public static void deleteThreads(long categoryId)
123         throws com.liferay.portal.PortalException,
124             com.liferay.portal.SystemException {
125         getService().deleteThreads(categoryId);
126     }
127 
128     public static int getCategoryThreadsCount(long categoryId)
129         throws com.liferay.portal.SystemException {
130         return getService().getCategoryThreadsCount(categoryId);
131     }
132 
133     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
134         long groupId, int start, int end)
135         throws com.liferay.portal.SystemException {
136         return getService().getGroupThreads(groupId, start, end);
137     }
138 
139     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
140         long groupId, long userId, int start, int end)
141         throws com.liferay.portal.PortalException,
142             com.liferay.portal.SystemException {
143         return getService().getGroupThreads(groupId, userId, start, end);
144     }
145 
146     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
147         long groupId, long userId, boolean subscribed, int start, int end)
148         throws com.liferay.portal.PortalException,
149             com.liferay.portal.SystemException {
150         return getService()
151                    .getGroupThreads(groupId, userId, subscribed, start, end);
152     }
153 
154     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
155         long groupId, long userId, boolean subscribed,
156         boolean includeAnonymous, int start, int end)
157         throws com.liferay.portal.PortalException,
158             com.liferay.portal.SystemException {
159         return getService()
160                    .getGroupThreads(groupId, userId, subscribed,
161             includeAnonymous, start, end);
162     }
163 
164     public static int getGroupThreadsCount(long groupId)
165         throws com.liferay.portal.SystemException {
166         return getService().getGroupThreadsCount(groupId);
167     }
168 
169     public static int getGroupThreadsCount(long groupId, long userId)
170         throws com.liferay.portal.SystemException {
171         return getService().getGroupThreadsCount(groupId, userId);
172     }
173 
174     public static int getGroupThreadsCount(long groupId, long userId,
175         boolean subscribed) throws com.liferay.portal.SystemException {
176         return getService().getGroupThreadsCount(groupId, userId, subscribed);
177     }
178 
179     public static int getGroupThreadsCount(long groupId, long userId,
180         boolean subscribed, boolean includeAnonymous)
181         throws com.liferay.portal.SystemException {
182         return getService()
183                    .getGroupThreadsCount(groupId, userId, subscribed,
184             includeAnonymous);
185     }
186 
187     public static com.liferay.portlet.messageboards.model.MBThread getThread(
188         long threadId)
189         throws com.liferay.portal.PortalException,
190             com.liferay.portal.SystemException {
191         return getService().getThread(threadId);
192     }
193 
194     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getThreads(
195         long categoryId, int start, int end)
196         throws com.liferay.portal.SystemException {
197         return getService().getThreads(categoryId, start, end);
198     }
199 
200     public static int getThreadsCount(long categoryId)
201         throws com.liferay.portal.SystemException {
202         return getService().getThreadsCount(categoryId);
203     }
204 
205     public static com.liferay.portlet.messageboards.model.MBThread moveThread(
206         long categoryId, long threadId)
207         throws com.liferay.portal.PortalException,
208             com.liferay.portal.SystemException {
209         return getService().moveThread(categoryId, threadId);
210     }
211 
212     public static com.liferay.portlet.messageboards.model.MBThread splitThread(
213         long messageId, com.liferay.portal.service.ServiceContext serviceContext)
214         throws com.liferay.portal.PortalException,
215             com.liferay.portal.SystemException {
216         return getService().splitThread(messageId, serviceContext);
217     }
218 
219     public static com.liferay.portlet.messageboards.model.MBThread updateThread(
220         long threadId, int viewCount)
221         throws com.liferay.portal.PortalException,
222             com.liferay.portal.SystemException {
223         return getService().updateThread(threadId, viewCount);
224     }
225 
226     public static MBThreadLocalService getService() {
227         if (_service == null) {
228             throw new RuntimeException("MBThreadLocalService is not set");
229         }
230 
231         return _service;
232     }
233 
234     public void setService(MBThreadLocalService service) {
235         _service = service;
236     }
237 
238     private static MBThreadLocalService _service;
239 }