| net.jforum.dao.TopicDAO
All known Subclasses: net.jforum.dao.generic.GenericTopicDAO,
TopicDAO | public interface TopicDAO (Code) | | Model interface for
net.jforum.entities.Topic .
This interface defines methods which are expected to be
implementd by a specific data access driver. The intention is
to provide all functionality needed to update, insert, delete and
select some specific data.
author: Rafael Steil version: $Id: TopicDAO.java,v 1.18 2007/09/09 22:53:36 rafaelsteil Exp $ |
Method Summary | |
public int | addNew(Topic topic) Adds a new Topic. | public int | countUserTopics(int userId) | public void | decrementTotalReplies(int topicId) | public void | delete(Topic topic, boolean fromModeration) Delete a Topic. | public void | deleteByForum(int forumId) | public void | deleteTopics(List topics, boolean fromModeration) Deletes a set of topics
Parameters: topics - The topics to delete. | public SearchResult | findTopicsByDateRange(SearchArgs args) | public void | fixFirstLastPostId(int topicId) Fixes the fields topic_first_post_id and
topic_last_post_id. | public int | getMaxPostId(int topicId) | public int | getMinPostId(int topicId) | public int | getTotalPosts(int topicId) Gets the number of posts the topic has. | public void | incrementTotalReplies(int topicId) | public void | incrementTotalViews(int topicId) | public boolean | isUserSubscribed(int topicId, int userId) Return the subscrition status of the user on the topic. | public void | lockUnlock(int[] topicId, int status) Lock or unlock a topic. | public List | notifyUsers(Topic topic) Get the users to notify
Parameters: topic - The topic ArrayList of User objects. | public void | removeSubscription(int topicId, int userId) | public void | removeSubscriptionByTopic(int topicId) | public List | selectAllByForum(int forumId) Selects all topics associated to a specific forum
Parameters: forumId - The forum id to select the topics ArrayList with all topics found. | public List | selectAllByForumByLimit(int forumId, int startFrom, int count) Selects all topics associated to a specific forum, limiting the total number
of records returned.
Parameters: forumId - The forum id to select the topics ArrayList with all topics found. | public Topic | selectById(int topicId) Gets a specific Topic . | public List | selectByUserByLimit(int userId, int startFrom, int count) | public List | selectHottestTopics(int limit) | public Topic | selectRaw(int topicId) Gets a topic's information from the topics table only.
No other information, like usernames, are fetched. | public List | selectRecentTopics(int limit) | public List | selectTopicTitlesByIds(Collection idList) | public void | setFirstPostId(int topicId, int postId) | public void | setLastPostId(int topicId, int postId) | public void | setModerationStatus(int forumId, boolean status) Sets the moderatation flag for all topics of a given forum. | public void | setModerationStatusByTopic(int topicId, boolean status) Sets the moderatation flag for a given topic. | public void | subscribeUser(int topicId, int userId) | public void | subscribeUsers(int topicId, List users) | public Map | topicPosters(int topicId) Get all unique posters of some topic
Parameters: topicId - int A Map instance with all topic posts. | public void | update(Topic topic) Updates a Topic. | public void | updateReadStatus(int topicId, int userId, boolean read) |
addNew | public int addNew(Topic topic)(Code) | | Adds a new Topic.
Parameters: topic - Reference to a valid and configured Topic object The new ID |
countUserTopics | public int countUserTopics(int userId)(Code) | | How many topics were created by a given user
Parameters: userId - the user id to check the number of topics created by the user |
decrementTotalReplies | public void decrementTotalReplies(int topicId)(Code) | | Decrements the number of replies the topic has
Parameters: topicId - The topic ID to decrement the total number of replies |
delete | public void delete(Topic topic, boolean fromModeration)(Code) | | Delete a Topic.
Parameters: topic - The Topic ID to delete Parameters: fromModeration - boolean |
deleteByForum | public void deleteByForum(int forumId)(Code) | | Deletes all topics from a forum
Parameters: forumId - int |
deleteTopics | public void deleteTopics(List topics, boolean fromModeration)(Code) | | Deletes a set of topics
Parameters: topics - The topics to delete. Each entry must bean instance of net.jforum.entities.Topic Parameters: fromModeration - boolean |
fixFirstLastPostId | public void fixFirstLastPostId(int topicId)(Code) | | Fixes the fields topic_first_post_id and
topic_last_post_id.
Parameters: topicId - The topic id to fix |
getMaxPostId | public int getMaxPostId(int topicId)(Code) | | Gets the last post id associated to the topic
Parameters: topicId - The topic id int |
getMinPostId | public int getMinPostId(int topicId)(Code) | | Gets the first post id associated to the topic
Parameters: topicId - The topic id int |
getTotalPosts | public int getTotalPosts(int topicId)(Code) | | Gets the number of posts the topic has.
Parameters: topicId - The topic id The number of posts |
incrementTotalReplies | public void incrementTotalReplies(int topicId)(Code) | | Increments the number of replies the topic has
Parameters: topicId - The topic ID to increment the total number of replies |
incrementTotalViews | public void incrementTotalViews(int topicId)(Code) | | Increments the number of times the topic was saw
Parameters: topicId - The topic ID to increment the total number of views |
isUserSubscribed | public boolean isUserSubscribed(int topicId, int userId)(Code) | | Return the subscrition status of the user on the topic.
Parameters: topicId - The topic id Parameters: userId - The user id true if the user is waiting notification on the topic |
lockUnlock | public void lockUnlock(int[] topicId, int status)(Code) | | Lock or unlock a topic.
Parameters: topicId - The topic id to perform the action on Parameters: status - Use Topic.STATUS_LOCKED to lock the topic, orTopic.STATUS_UNLOCKED to unlock. |
notifyUsers | public List notifyUsers(Topic topic)(Code) | | Get the users to notify
Parameters: topic - The topic ArrayList of User objects. Eachentry is an user who will receive the topic anwser notification |
removeSubscription | public void removeSubscription(int topicId, int userId)(Code) | | Remove the user's subscription of the topic
Parameters: topicId - The topic id Parameters: userId - the User id |
removeSubscriptionByTopic | public void removeSubscriptionByTopic(int topicId)(Code) | | Clean all subscriptions of some topic
Parameters: topicId - The topic id |
selectAllByForum | public List selectAllByForum(int forumId)(Code) | | Selects all topics associated to a specific forum
Parameters: forumId - The forum id to select the topics ArrayList with all topics found. Each entry is a net.jforum.Topic object |
selectAllByForumByLimit | public List selectAllByForumByLimit(int forumId, int startFrom, int count)(Code) | | Selects all topics associated to a specific forum, limiting the total number
of records returned.
Parameters: forumId - The forum id to select the topics ArrayList with all topics found. Each entry is a net.jforum.Topic object Parameters: startFrom - int Parameters: count - int |
selectByUserByLimit | public List selectByUserByLimit(int userId, int startFrom, int count)(Code) | | Selects all topics associated to a specific user and belonging to
given forums
Parameters: userId - int User ID. Parameters: startFrom - int Parameters: count - int List |
selectHottestTopics | public List selectHottestTopics(int limit)(Code) | | Selects hottest topics
Parameters: limit - The number of topics to retrieve List |
selectRaw | public Topic selectRaw(int topicId)(Code) | | Gets a topic's information from the topics table only.
No other information, like usernames, are fetched.
Parameters: topicId - The topic id to get A topic instance |
selectRecentTopics | public List selectRecentTopics(int limit)(Code) | | Selects recent topics
Parameters: limit - The number of topics to retrieve List |
setFirstPostId | public void setFirstPostId(int topicId, int postId)(Code) | | Sets the ID of the first post of the topic
Parameters: topicId - Topic ID Parameters: postId - Post ID |
setLastPostId | public void setLastPostId(int topicId, int postId)(Code) | | Sets the ID of the last post of the topic
Parameters: topicId - Topic ID Parameters: postId - Post ID |
setModerationStatus | public void setModerationStatus(int forumId, boolean status)(Code) | | Sets the moderatation flag for all topics of a given forum.
Parameters: forumId - The forum id Parameters: status - boolean |
setModerationStatusByTopic | public void setModerationStatusByTopic(int topicId, boolean status)(Code) | | Sets the moderatation flag for a given topic.
Parameters: topicId - The topic id Parameters: status - boolean |
subscribeUser | public void subscribeUser(int topicId, int userId)(Code) | | Subscribe the user for notification of new post in the topic
Parameters: topicId - The topic id Parameters: userId - The user id |
subscribeUsers | public void subscribeUsers(int topicId, List users)(Code) | | Subscribe a set of users for notification of new post in the topic
Parameters: topicId - the topic id Parameters: users - the relation of User instances to subscribe |
topicPosters | public Map topicPosters(int topicId)(Code) | | Get all unique posters of some topic
Parameters: topicId - int A Map instance with all topic posts. Key is the userid, value is an net.jforum.entities.User instance with minimumdata filled |
update | public void update(Topic topic)(Code) | | Updates a Topic.
Parameters: topic - Reference to a Topic object to update |
updateReadStatus | public void updateReadStatus(int topicId, int userId, boolean read)(Code) | | Change the topic read status
Parameters: topicId - The topic id Parameters: userId - The user id Parameters: read - true or false |
|
|