001
014
015 package com.liferay.portlet.messageboards.service;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.util.MethodCache;
019 import com.liferay.portal.kernel.util.ReferenceRegistry;
020
021
034 public class MBThreadServiceUtil {
035
040 public static void deleteThread(long threadId)
041 throws com.liferay.portal.kernel.exception.PortalException,
042 com.liferay.portal.kernel.exception.SystemException {
043 getService().deleteThread(threadId);
044 }
045
046 public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
047 long groupId, long userId, int status, boolean subscribed,
048 boolean includeAnonymous, int start, int end)
049 throws com.liferay.portal.kernel.exception.PortalException,
050 com.liferay.portal.kernel.exception.SystemException {
051 return getService()
052 .getGroupThreads(groupId, userId, status, subscribed,
053 includeAnonymous, start, end);
054 }
055
056 public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
057 long groupId, long userId, int status, boolean subscribed, int start,
058 int end)
059 throws com.liferay.portal.kernel.exception.PortalException,
060 com.liferay.portal.kernel.exception.SystemException {
061 return getService()
062 .getGroupThreads(groupId, userId, status, subscribed, start,
063 end);
064 }
065
066 public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getGroupThreads(
067 long groupId, long userId, int status, int start, int end)
068 throws com.liferay.portal.kernel.exception.PortalException,
069 com.liferay.portal.kernel.exception.SystemException {
070 return getService().getGroupThreads(groupId, userId, status, start, end);
071 }
072
073 public static int getGroupThreadsCount(long groupId, long userId, int status)
074 throws com.liferay.portal.kernel.exception.SystemException {
075 return getService().getGroupThreadsCount(groupId, userId, status);
076 }
077
078 public static int getGroupThreadsCount(long groupId, long userId,
079 int status, boolean subscribed)
080 throws com.liferay.portal.kernel.exception.SystemException {
081 return getService()
082 .getGroupThreadsCount(groupId, userId, status, subscribed);
083 }
084
085 public static int getGroupThreadsCount(long groupId, long userId,
086 int status, boolean subscribed, boolean includeAnonymous)
087 throws com.liferay.portal.kernel.exception.SystemException {
088 return getService()
089 .getGroupThreadsCount(groupId, userId, status, subscribed,
090 includeAnonymous);
091 }
092
093 public static java.util.List<com.liferay.portlet.messageboards.model.MBThread> getThreads(
094 long groupId, long categoryId, int status, int start, int end)
095 throws com.liferay.portal.kernel.exception.SystemException {
096 return getService().getThreads(groupId, categoryId, status, start, end);
097 }
098
099 public static int getThreadsCount(long groupId, long categoryId, int status)
100 throws com.liferay.portal.kernel.exception.SystemException {
101 return getService().getThreadsCount(groupId, categoryId, status);
102 }
103
104 public static com.liferay.portal.model.Lock lockThread(long threadId)
105 throws com.liferay.portal.kernel.exception.PortalException,
106 com.liferay.portal.kernel.exception.SystemException {
107 return getService().lockThread(threadId);
108 }
109
110 public static com.liferay.portlet.messageboards.model.MBThread moveThread(
111 long categoryId, long threadId)
112 throws com.liferay.portal.kernel.exception.PortalException,
113 com.liferay.portal.kernel.exception.SystemException {
114 return getService().moveThread(categoryId, threadId);
115 }
116
117 public static com.liferay.portlet.messageboards.model.MBThread splitThread(
118 long messageId, com.liferay.portal.service.ServiceContext serviceContext)
119 throws com.liferay.portal.kernel.exception.PortalException,
120 com.liferay.portal.kernel.exception.SystemException {
121 return getService().splitThread(messageId, serviceContext);
122 }
123
124 public static void unlockThread(long threadId)
125 throws com.liferay.portal.kernel.exception.PortalException,
126 com.liferay.portal.kernel.exception.SystemException {
127 getService().unlockThread(threadId);
128 }
129
130 public static MBThreadService getService() {
131 if (_service == null) {
132 _service = (MBThreadService)PortalBeanLocatorUtil.locate(MBThreadService.class.getName());
133
134 ReferenceRegistry.registerReference(MBThreadServiceUtil.class,
135 "_service");
136 MethodCache.remove(MBThreadService.class);
137 }
138
139 return _service;
140 }
141
142 public void setService(MBThreadService service) {
143 MethodCache.remove(MBThreadService.class);
144
145 _service = service;
146
147 ReferenceRegistry.registerReference(MBThreadServiceUtil.class,
148 "_service");
149 MethodCache.remove(MBThreadService.class);
150 }
151
152 private static MBThreadService _service;
153 }