Liferay 6.1.2-ce-ga3

com.liferay.portlet.messageboards.service
Class MBThreadLocalServiceUtil

java.lang.Object
  extended by com.liferay.portlet.messageboards.service.MBThreadLocalServiceUtil

public class MBThreadLocalServiceUtil
extends Object

The utility for the message boards thread local service. This utility wraps com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl and is the primary access point for service operations in application layer code running on the local server.

This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.

See Also:
MBThreadLocalService, com.liferay.portlet.messageboards.service.base.MBThreadLocalServiceBaseImpl, com.liferay.portlet.messageboards.service.impl.MBThreadLocalServiceImpl

Constructor Summary
MBThreadLocalServiceUtil()
           
 
Method Summary
static MBThread addMBThread(MBThread mbThread)
          Adds the message boards thread to the database.
static MBThread addThread(long categoryId, MBMessage message)
           
static MBThread createMBThread(long threadId)
          Creates a new message boards thread with the primary key.
static MBThread deleteMBThread(long threadId)
          Deletes the message boards thread with the primary key from the database.
static MBThread deleteMBThread(MBThread mbThread)
          Deletes the message boards thread from the database.
static void deleteThread(long threadId)
           
static void deleteThread(MBThread thread)
           
static void deleteThreads(long groupId, long categoryId)
           
static DynamicQuery dynamicQuery()
           
static List dynamicQuery(DynamicQuery dynamicQuery)
          Performs a dynamic query on the database and returns the matching rows.
static List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
          Performs a dynamic query on the database and returns a range of the matching rows.
static List dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator)
          Performs a dynamic query on the database and returns an ordered range of the matching rows.
static long dynamicQueryCount(DynamicQuery dynamicQuery)
          Returns the number of rows that match the dynamic query.
static MBThread fetchMBThread(long threadId)
           
static MBThread fetchThread(long threadId)
           
static String getBeanIdentifier()
          Returns the Spring bean ID for this bean.
static int getCategoryThreadsCount(long groupId, long categoryId, int status)
           
static List<MBThread> getGroupThreads(long groupId, int status, int start, int end)
           
static List<MBThread> getGroupThreads(long groupId, long userId, int status, boolean subscribed, boolean includeAnonymous, int start, int end)
           
static List<MBThread> getGroupThreads(long groupId, long userId, int status, boolean subscribed, int start, int end)
           
static List<MBThread> getGroupThreads(long groupId, long userId, int status, int start, int end)
           
static int getGroupThreadsCount(long groupId, int status)
           
static int getGroupThreadsCount(long groupId, long userId, int status)
           
static int getGroupThreadsCount(long groupId, long userId, int status, boolean subscribed)
           
static int getGroupThreadsCount(long groupId, long userId, int status, boolean subscribed, boolean includeAnonymous)
           
static MBThread getMBThread(long threadId)
          Returns the message boards thread with the primary key.
static List<MBThread> getMBThreads(int start, int end)
          Returns a range of all the message boards threads.
static int getMBThreadsCount()
          Returns the number of message boards threads.
static List<MBThread> getNoAssetThreads()
           
static PersistedModel getPersistedModel(Serializable primaryKeyObj)
           
static List<MBThread> getPriorityThreads(long categoryId, double priority)
           
static List<MBThread> getPriorityThreads(long categoryId, double priority, boolean inherit)
           
static MBThreadLocalService getService()
           
static MBThread getThread(long threadId)
           
static List<MBThread> getThreads(long groupId, long categoryId, int status, int start, int end)
           
static int getThreadsCount(long groupId, long categoryId, int status)
           
static boolean hasAnswerMessage(long threadId)
           
static MBThread incrementViewCounter(long threadId, int increment)
           
static MBThread moveThread(long groupId, long categoryId, long threadId)
           
static void setBeanIdentifier(String beanIdentifier)
          Sets the Spring bean ID for this bean.
 void setService(MBThreadLocalService service)
          Deprecated.  
static MBThread splitThread(long messageId, String subject, ServiceContext serviceContext)
           
static MBThread updateMBThread(MBThread mbThread)
          Updates the message boards thread in the database or adds it if it does not yet exist.
static MBThread updateMBThread(MBThread mbThread, boolean merge)
          Updates the message boards thread in the database or adds it if it does not yet exist.
static void updateQuestion(long threadId, boolean question)
           
static MBThread updateThread(long threadId, int viewCount)
          Deprecated. incrementViewCounter(long, int)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBThreadLocalServiceUtil

public MBThreadLocalServiceUtil()
Method Detail

addMBThread

public static MBThread addMBThread(MBThread mbThread)
                            throws SystemException
Adds the message boards thread to the database. Also notifies the appropriate model listeners.

Parameters:
mbThread - the message boards thread
Returns:
the message boards thread that was added
Throws:
SystemException - if a system exception occurred

createMBThread

public static MBThread createMBThread(long threadId)
Creates a new message boards thread with the primary key. Does not add the message boards thread to the database.

Parameters:
threadId - the primary key for the new message boards thread
Returns:
the new message boards thread

deleteMBThread

public static MBThread deleteMBThread(long threadId)
                               throws PortalException,
                                      SystemException
Deletes the message boards thread with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
threadId - the primary key of the message boards thread
Returns:
the message boards thread that was removed
Throws:
PortalException - if a message boards thread with the primary key could not be found
SystemException - if a system exception occurred

deleteMBThread

public static MBThread deleteMBThread(MBThread mbThread)
                               throws SystemException
Deletes the message boards thread from the database. Also notifies the appropriate model listeners.

Parameters:
mbThread - the message boards thread
Returns:
the message boards thread that was removed
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static DynamicQuery dynamicQuery()

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery)
                         throws SystemException
Performs a dynamic query on the database and returns the matching rows.

Parameters:
dynamicQuery - the dynamic query
Returns:
the matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery,
                                int start,
                                int end)
                         throws SystemException
Performs a dynamic query on the database and returns a range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
Returns:
the range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQuery

public static List dynamicQuery(DynamicQuery dynamicQuery,
                                int start,
                                int end,
                                OrderByComparator orderByComparator)
                         throws SystemException
Performs a dynamic query on the database and returns an ordered range of the matching rows.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
dynamicQuery - the dynamic query
start - the lower bound of the range of model instances
end - the upper bound of the range of model instances (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching rows
Throws:
SystemException - if a system exception occurred

dynamicQueryCount

public static long dynamicQueryCount(DynamicQuery dynamicQuery)
                              throws SystemException
Returns the number of rows that match the dynamic query.

Parameters:
dynamicQuery - the dynamic query
Returns:
the number of rows that match the dynamic query
Throws:
SystemException - if a system exception occurred

fetchMBThread

public static MBThread fetchMBThread(long threadId)
                              throws SystemException
Throws:
SystemException

getMBThread

public static MBThread getMBThread(long threadId)
                            throws PortalException,
                                   SystemException
Returns the message boards thread with the primary key.

Parameters:
threadId - the primary key of the message boards thread
Returns:
the message boards thread
Throws:
PortalException - if a message boards thread with the primary key could not be found
SystemException - if a system exception occurred

getPersistedModel

public static PersistedModel getPersistedModel(Serializable primaryKeyObj)
                                        throws PortalException,
                                               SystemException
Throws:
PortalException
SystemException

getMBThreads

public static List<MBThread> getMBThreads(int start,
                                          int end)
                                   throws SystemException
Returns a range of all the message boards threads.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of message boards threads
end - the upper bound of the range of message boards threads (not inclusive)
Returns:
the range of message boards threads
Throws:
SystemException - if a system exception occurred

getMBThreadsCount

public static int getMBThreadsCount()
                             throws SystemException
Returns the number of message boards threads.

Returns:
the number of message boards threads
Throws:
SystemException - if a system exception occurred

updateMBThread

public static MBThread updateMBThread(MBThread mbThread)
                               throws SystemException
Updates the message boards thread in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
mbThread - the message boards thread
Returns:
the message boards thread that was updated
Throws:
SystemException - if a system exception occurred

updateMBThread

public static MBThread updateMBThread(MBThread mbThread,
                                      boolean merge)
                               throws SystemException
Updates the message boards thread in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.

Parameters:
mbThread - the message boards thread
merge - whether to merge the message boards thread with the current session. See BatchSession.update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean) for an explanation.
Returns:
the message boards thread that was updated
Throws:
SystemException - if a system exception occurred

getBeanIdentifier

public static String getBeanIdentifier()
Returns the Spring bean ID for this bean.

Returns:
the Spring bean ID for this bean

setBeanIdentifier

public static void setBeanIdentifier(String beanIdentifier)
Sets the Spring bean ID for this bean.

Parameters:
beanIdentifier - the Spring bean ID for this bean

addThread

public static MBThread addThread(long categoryId,
                                 MBMessage message)
                          throws PortalException,
                                 SystemException
Throws:
PortalException
SystemException

deleteThread

public static void deleteThread(long threadId)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

deleteThread

public static void deleteThread(MBThread thread)
                         throws PortalException,
                                SystemException
Throws:
PortalException
SystemException

deleteThreads

public static void deleteThreads(long groupId,
                                 long categoryId)
                          throws PortalException,
                                 SystemException
Throws:
PortalException
SystemException

fetchThread

public static MBThread fetchThread(long threadId)
                            throws SystemException
Throws:
SystemException

getCategoryThreadsCount

public static int getCategoryThreadsCount(long groupId,
                                          long categoryId,
                                          int status)
                                   throws SystemException
Throws:
SystemException

getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             int status,
                                             int start,
                                             int end)
                                      throws SystemException
Throws:
SystemException

getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             long userId,
                                             int status,
                                             boolean subscribed,
                                             boolean includeAnonymous,
                                             int start,
                                             int end)
                                      throws PortalException,
                                             SystemException
Throws:
PortalException
SystemException

getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             long userId,
                                             int status,
                                             boolean subscribed,
                                             int start,
                                             int end)
                                      throws PortalException,
                                             SystemException
Throws:
PortalException
SystemException

getGroupThreads

public static List<MBThread> getGroupThreads(long groupId,
                                             long userId,
                                             int status,
                                             int start,
                                             int end)
                                      throws PortalException,
                                             SystemException
Throws:
PortalException
SystemException

getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       int status)
                                throws SystemException
Throws:
SystemException

getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       long userId,
                                       int status)
                                throws SystemException
Throws:
SystemException

getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       long userId,
                                       int status,
                                       boolean subscribed)
                                throws SystemException
Throws:
SystemException

getGroupThreadsCount

public static int getGroupThreadsCount(long groupId,
                                       long userId,
                                       int status,
                                       boolean subscribed,
                                       boolean includeAnonymous)
                                throws SystemException
Throws:
SystemException

getNoAssetThreads

public static List<MBThread> getNoAssetThreads()
                                        throws SystemException
Throws:
SystemException

getPriorityThreads

public static List<MBThread> getPriorityThreads(long categoryId,
                                                double priority)
                                         throws PortalException,
                                                SystemException
Throws:
PortalException
SystemException

getPriorityThreads

public static List<MBThread> getPriorityThreads(long categoryId,
                                                double priority,
                                                boolean inherit)
                                         throws PortalException,
                                                SystemException
Throws:
PortalException
SystemException

getThread

public static MBThread getThread(long threadId)
                          throws PortalException,
                                 SystemException
Throws:
PortalException
SystemException

getThreads

public static List<MBThread> getThreads(long groupId,
                                        long categoryId,
                                        int status,
                                        int start,
                                        int end)
                                 throws SystemException
Throws:
SystemException

getThreadsCount

public static int getThreadsCount(long groupId,
                                  long categoryId,
                                  int status)
                           throws SystemException
Throws:
SystemException

hasAnswerMessage

public static boolean hasAnswerMessage(long threadId)
                                throws SystemException
Throws:
SystemException

incrementViewCounter

public static MBThread incrementViewCounter(long threadId,
                                            int increment)
                                     throws PortalException,
                                            SystemException
Throws:
PortalException
SystemException

moveThread

public static MBThread moveThread(long groupId,
                                  long categoryId,
                                  long threadId)
                           throws PortalException,
                                  SystemException
Throws:
PortalException
SystemException

splitThread

public static MBThread splitThread(long messageId,
                                   String subject,
                                   ServiceContext serviceContext)
                            throws PortalException,
                                   SystemException
Throws:
PortalException
SystemException

updateQuestion

public static void updateQuestion(long threadId,
                                  boolean question)
                           throws PortalException,
                                  SystemException
Throws:
PortalException
SystemException

updateThread

public static MBThread updateThread(long threadId,
                                    int viewCount)
                             throws PortalException,
                                    SystemException
Deprecated. incrementViewCounter(long, int)

Throws:
PortalException
SystemException

getService

public static MBThreadLocalService getService()

setService

public void setService(MBThreadLocalService service)
Deprecated. 


Liferay 6.1.2-ce-ga3