001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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    /**
022     * The utility for the message boards thread remote service. This utility wraps {@link com.liferay.portlet.messageboards.service.impl.MBThreadServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see MBThreadService
030     * @see com.liferay.portlet.messageboards.service.base.MBThreadServiceBaseImpl
031     * @see com.liferay.portlet.messageboards.service.impl.MBThreadServiceImpl
032     * @generated
033     */
034    public class MBThreadServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.messageboards.service.impl.MBThreadServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
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, java.lang.String subject,
119                    com.liferay.portal.service.ServiceContext serviceContext)
120                    throws com.liferay.portal.kernel.exception.PortalException,
121                            com.liferay.portal.kernel.exception.SystemException {
122                    return getService().splitThread(messageId, subject, serviceContext);
123            }
124    
125            public static void unlockThread(long threadId)
126                    throws com.liferay.portal.kernel.exception.PortalException,
127                            com.liferay.portal.kernel.exception.SystemException {
128                    getService().unlockThread(threadId);
129            }
130    
131            public static MBThreadService getService() {
132                    if (_service == null) {
133                            _service = (MBThreadService)PortalBeanLocatorUtil.locate(MBThreadService.class.getName());
134    
135                            ReferenceRegistry.registerReference(MBThreadServiceUtil.class,
136                                    "_service");
137                            MethodCache.remove(MBThreadService.class);
138                    }
139    
140                    return _service;
141            }
142    
143            public void setService(MBThreadService service) {
144                    MethodCache.remove(MBThreadService.class);
145    
146                    _service = service;
147    
148                    ReferenceRegistry.registerReference(MBThreadServiceUtil.class,
149                            "_service");
150                    MethodCache.remove(MBThreadService.class);
151            }
152    
153            private static MBThreadService _service;
154    }