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 void deleteThread(long threadId)
104         throws com.liferay.portal.PortalException,
105             com.liferay.portal.SystemException {
106         getService().deleteThread(threadId);
107     }
108 
109     public static void deleteThread(
110         com.liferay.portlet.messageboards.model.MBThread thread)
111         throws com.liferay.portal.PortalException,
112             com.liferay.portal.SystemException {
113         getService().deleteThread(thread);
114     }
115 
116     public static void deleteThreads(long categoryId)
117         throws com.liferay.portal.PortalException,
118             com.liferay.portal.SystemException {
119         getService().deleteThreads(categoryId);
120     }
121 
122     public static int getCategoriesThreadsCount(
123         java.util.List<Long> categoryIds)
124         throws com.liferay.portal.SystemException {
125         return getService().getCategoriesThreadsCount(categoryIds);
126     }
127 
128     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
129         long groupId, int start, int end)
130         throws com.liferay.portal.SystemException {
131         return getService().getGroupThreads(groupId, start, end);
132     }
133 
134     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
135         long groupId, long userId, int start, int end)
136         throws com.liferay.portal.SystemException {
137         return getService().getGroupThreads(groupId, userId, start, end);
138     }
139 
140     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
141         long groupId, long userId, boolean subscribed, int start, int end)
142         throws com.liferay.portal.SystemException {
143         return getService()
144                    .getGroupThreads(groupId, userId, subscribed, start, end);
145     }
146 
147     public static int getGroupThreadsCount(long groupId)
148         throws com.liferay.portal.SystemException {
149         return getService().getGroupThreadsCount(groupId);
150     }
151 
152     public static int getGroupThreadsCount(long groupId, long userId)
153         throws com.liferay.portal.SystemException {
154         return getService().getGroupThreadsCount(groupId, userId);
155     }
156 
157     public static int getGroupThreadsCount(long groupId, long userId,
158         boolean subscribed) throws com.liferay.portal.SystemException {
159         return getService().getGroupThreadsCount(groupId, userId, subscribed);
160     }
161 
162     public static com.liferay.portlet.messageboards.model.MBThread getThread(
163         long threadId)
164         throws com.liferay.portal.PortalException,
165             com.liferay.portal.SystemException {
166         return getService().getThread(threadId);
167     }
168 
169     public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getThreads(
170         long categoryId, int start, int end)
171         throws com.liferay.portal.SystemException {
172         return getService().getThreads(categoryId, start, end);
173     }
174 
175     public static int getThreadsCount(long categoryId)
176         throws com.liferay.portal.SystemException {
177         return getService().getThreadsCount(categoryId);
178     }
179 
180     public static boolean hasReadThread(long userId, long threadId)
181         throws com.liferay.portal.PortalException,
182             com.liferay.portal.SystemException {
183         return getService().hasReadThread(userId, threadId);
184     }
185 
186     public static com.liferay.portlet.messageboards.model.MBThread moveThread(
187         long categoryId, long threadId)
188         throws com.liferay.portal.PortalException,
189             com.liferay.portal.SystemException {
190         return getService().moveThread(categoryId, threadId);
191     }
192 
193     public static com.liferay.portlet.messageboards.model.MBThread splitThread(
194         long messageId, javax.portlet.PortletPreferences prefs,
195         com.liferay.portal.theme.ThemeDisplay themeDisplay)
196         throws com.liferay.portal.PortalException,
197             com.liferay.portal.SystemException {
198         return getService().splitThread(messageId, prefs, themeDisplay);
199     }
200 
201     public static com.liferay.portlet.messageboards.model.MBThread updateThread(
202         long threadId, int viewCount)
203         throws com.liferay.portal.PortalException,
204             com.liferay.portal.SystemException {
205         return getService().updateThread(threadId, viewCount);
206     }
207 
208     public static MBThreadLocalService getService() {
209         if (_service == null) {
210             throw new RuntimeException("MBThreadLocalService is not set");
211         }
212 
213         return _service;
214     }
215 
216     public void setService(MBThreadLocalService service) {
217         _service = service;
218     }
219 
220     private static MBThreadLocalService _service;
221 }