blackboard.data.discussionboard.datamanager
Interface UserMsgStateManager


public interface UserMsgStateManager

utility class for handling UserMsgState objects

Since:
Bb 7.0
Version:
Revision: #1 Date: 2005-4-30

Method Summary
 UserMsgState create(Id messageId, Id userId)
          Set the user's read state for the message
 java.lang.String getSubscribedInd(Id messageId, Id userId)
          Get the indicator for whether the user is subscribed to the thread in which the message appears.
 java.util.List loadAllByMessageId(Id messageId)
          load All UserMsgState objects for a given message
 UserMsgState loadByMessageIdAndUserId(Id messageId, Id userId)
          load UserMsgState of a particular message-user combination
 UserMsgState recordMessageReadStateAndReadCount(Id messageId, Id userId)
          Record the UserMsgState's read-state of a particular message-user combination
 void save(UserMsgState ums)
          save a UserMsgState object.
 void setFlag(Id messageId, Id userId, boolean isAdd)
          Set user's Add/Clear flag for a given message
 void setRating(Id messageId, Id userId, int rating)
          set the user's rating for the message
 void setSubscribedInd(Id messageId, Id userId)
          Flip the indicator for whether the the user is subscribed to the thread in which the message appears from true to false or false to true.
 void setUserReadStateForMessage(Id messageId, Id userId, boolean isRead)
          Set the user's read state for the message
 void setUserReadStateForThread(Id threadId, Id userId, boolean isRead)
          Set the user's read state for the thread
 void setUserReadStateToUnreadForAllUsers(Id messageId)
          Marks the specified message as unread for all users
 java.util.List<Message> updateUserMessageReadCount(java.util.List<Message> messageList, Id userId)
          Updates the read count for the list of messages.
 

Method Detail

create

UserMsgState create(Id messageId,
                    Id userId)
                    throws PersistenceException,
                           ValidationException
Set the user's read state for the message

Parameters:
messageId -
userId -
Throws:
PersistenceException
ValidationException

save

void save(UserMsgState ums)
          throws PersistenceException,
                 ValidationException
save a UserMsgState object.

Parameters:
ums - UserMsgState to be saved
Throws:
ValidationException - if the object is not in a consistent state to be persisted.
PersistenceException - if some other exception happens while persisting the object.

loadAllByMessageId

java.util.List loadAllByMessageId(Id messageId)
                                  throws KeyNotFoundException,
                                         PersistenceException
load All UserMsgState objects for a given message

Parameters:
messageId - Message ID.
Returns:
A list contains all UserMsgState objects for a given message id.
Throws:
KeyNotFoundException
PersistenceException - if some other exception happens while persisting the object.

loadByMessageIdAndUserId

UserMsgState loadByMessageIdAndUserId(Id messageId,
                                      Id userId)
                                      throws PersistenceException
load UserMsgState of a particular message-user combination

Parameters:
messageId - Message ID.
userId - User ID
Returns:
The specific UserMsgState object for that combination
Throws:
PersistenceException - if some other exception happens while persisting the object.

updateUserMessageReadCount

java.util.List<Message> updateUserMessageReadCount(java.util.List<Message> messageList,
                                                   Id userId)
                                                   throws java.lang.Exception
Updates the read count for the list of messages. (Update to database happens out of process.)

Parameters:
messageList -
userId -
Returns:
Throws:
java.lang.Exception
Since:
7.3

recordMessageReadStateAndReadCount

UserMsgState recordMessageReadStateAndReadCount(Id messageId,
                                                Id userId)
                                                throws PersistenceException,
                                                       ValidationException
Record the UserMsgState's read-state of a particular message-user combination

Parameters:
messageId - Message ID.
userId - User ID
Returns:
The specifc UserMsgState object for that combination
Throws:
ValidationException - if the object is not in a consistent state to be persisted.
PersistenceException - if some other exception happens while persisting the object.

getSubscribedInd

java.lang.String getSubscribedInd(Id messageId,
                                  Id userId)
Get the indicator for whether the user is subscribed to the thread in which the message appears.

Parameters:
messageId -
userId -
Returns:
Y or N

setFlag

void setFlag(Id messageId,
             Id userId,
             boolean isAdd)
             throws PersistenceException,
                    ValidationException
Set user's Add/Clear flag for a given message

Parameters:
messageId -
userId -
isAdd -
Throws:
PersistenceException
ValidationException

setRating

void setRating(Id messageId,
               Id userId,
               int rating)
               throws PersistenceException,
                      ValidationException
set the user's rating for the message

Parameters:
messageId -
userId -
rating -
Throws:
PersistenceException
ValidationException

setSubscribedInd

void setSubscribedInd(Id messageId,
                      Id userId)
                      throws PersistenceException,
                             ValidationException
Flip the indicator for whether the the user is subscribed to the thread in which the message appears from true to false or false to true. This call has no effect if the forum does not allow subscription

Parameters:
messageId -
userId -
Throws:
PersistenceException
ValidationException

setUserReadStateForThread

void setUserReadStateForThread(Id threadId,
                               Id userId,
                               boolean isRead)
                               throws PersistenceException,
                                      ValidationException
Set the user's read state for the thread

Parameters:
messageId -
userId -
Throws:
PersistenceException
ValidationException

setUserReadStateForMessage

void setUserReadStateForMessage(Id messageId,
                                Id userId,
                                boolean isRead)
                                throws PersistenceException,
                                       ValidationException
Set the user's read state for the message

Parameters:
messageId -
userId -
Throws:
PersistenceException
ValidationException

setUserReadStateToUnreadForAllUsers

void setUserReadStateToUnreadForAllUsers(Id messageId)
                                         throws PersistenceException
Marks the specified message as unread for all users

Parameters:
messageId - Id of the message to set as unread for all users
Throws:
PersistenceException - if some other exception happens while persisting the object.
Since:
Bb 7.3


Copyright © 2003 Blackboard, Inc. All Rights Reserved.