|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stratelia.webactiv.forums.forumsManager.ejb.ForumsDAO
public class ForumsDAO
Class managing database accesses for forums.
Method Summary | |
---|---|
static void |
addLastVisit(Connection con,
String userId,
int messageId)
Adds an access date to the message corresponding to the message id by the user. |
static void |
addModerator(Connection con,
ForumPK forumPK,
String userId)
Adds the role of moderator to the user on the forum corresponding to the primary key. |
static int |
createForum(Connection con,
ForumPK forumPK,
String forumName,
String forumDescription,
String forumCreator,
int forumParent,
String categoryId)
Creates a forum. |
static int |
createMessage(Connection con,
String messageTitle,
String messageAuthor,
Date messageDate,
int forumId,
int messageParent,
String status)
Creates a message. |
static void |
deleteForum(Connection con,
ForumPK forumPK)
Deletes the forum corresponding to the primary key. |
static void |
deleteMessage(Connection con,
MessagePK messagePK)
Deletes the message corresponding to the primary key. |
static void |
deleteVisit(Connection con,
String userId,
int messageId)
Deletes the access date of the user to the message corresponding to the message id. |
static Collection<String> |
getAllMessageSons(Connection con,
MessagePK messagePK)
|
static int |
getAuthorNbMessages(Connection con,
String userId,
String status)
|
static Forum |
getForum(Connection con,
ForumPK forumPK)
|
static String |
getForumCreatorId(Connection con,
int forumId)
|
static ForumDetail |
getForumDetail(Connection con,
ForumPK forumPK)
|
static String |
getForumInstanceId(Connection con,
int forumId)
|
static String |
getForumName(Connection con,
int forumId)
|
static int |
getForumParentId(Connection con,
int forumId)
|
static Collection<Forum> |
getForumsByKeys(Connection con,
Collection<ForumPK> forumPKs)
|
static ArrayList<String> |
getForumsIds(Connection con,
ForumPK forumPK)
|
static List<Forum> |
getForumsList(Connection con,
ForumPK forumPK)
|
static List<Forum> |
getForumsListByCategory(Connection con,
ForumPK forumPK,
String categoryId)
|
static List<String> |
getForumSonsIds(Connection con,
ForumPK forumPK)
|
static Message |
getLastMessage(Connection con,
ForumPK forumPK,
List<String> messageParentIds,
String status)
|
static Message |
getLastMessage(Connection con,
ForumPK forumPK,
String status)
|
static Collection<String> |
getLastMessageRSS(Connection con,
String instanceId)
|
static ArrayList<Message> |
getLastThreads(Connection con,
ForumPK[] forumPKs,
int count)
|
static Date |
getLastVisit(Connection con,
String userId,
int messageId)
|
static Date |
getLastVisit(Connection con,
String userId,
List<String> messageIds)
|
static Message |
getMessage(Connection con,
MessagePK messagePK)
|
static List |
getMessageInfos(Connection con,
MessagePK messagePK)
|
static int |
getMessageParentId(Connection con,
int messageId)
|
static Collection<Message> |
getMessagesByKeys(Connection con,
Collection<MessagePK> messagePKs)
|
static List<String> |
getMessagesIds(Connection con,
ForumPK forumPK)
|
static List<String> |
getMessagesIds(Connection con,
ForumPK forumPK,
int messageParentId)
|
static ArrayList<Message> |
getMessagesList(Connection con,
ForumPK forumPK)
|
static Collection<String> |
getMessageSons(Connection con,
MessagePK messagePK)
|
static String |
getMessageTitle(Connection con,
int messageId)
|
static List<Moderator> |
getModerators(Connection con,
int forumId)
|
static int |
getNbMessages(Connection con,
int forumId,
String type,
String status)
|
static int |
getNbResponses(Connection con,
int forumId,
int messageId,
String status)
|
static Collection<Message> |
getNotAnsweredLastThreads(Connection con,
ForumPK[] forumPKs,
int count)
|
static List<String> |
getSubjectsIds(Connection con,
ForumPK forumPK)
|
static Message |
getThread(Connection con,
MessagePK messagePK)
|
static Collection<Message> |
getThreadsByKeys(Connection con,
Collection<MessagePK> messagePKs)
|
static boolean |
isForumActive(Connection con,
int forumId)
|
static boolean |
isModerator(Connection con,
ForumPK forumPK,
String userId)
|
static void |
lockForum(Connection con,
ForumPK forumPK,
int level)
Locks the forum corresponding to the primary key. |
static void |
moveMessage(Connection con,
MessagePK messagePK,
ForumPK forumPK)
Moves the message corresponding to the message primary key from a previous forum to the one corresponding to the forum primary key. |
static void |
removeAllModerators(Connection con,
ForumPK forumPK)
Removes the role of moderator to all users on the forum corresponding to the primary key. |
static void |
removeModerator(Connection con,
ForumPK forumPK,
String userId)
Removes the role of moderator to the user on the forum corresponding to the primary key. |
static Collection<ForumDetail> |
selectByForumPKs(Connection con,
Collection<ForumPK> forumPKs)
|
static int |
unlockForum(Connection con,
ForumPK forumPK,
int level)
Unlocks the forum corresponding to the primary key. |
static void |
updateForum(Connection con,
ForumPK forumPK,
String forumName,
String forumDescription,
int forumParent,
String categoryId)
Updates the forum corresponding to the primary key. |
static void |
updateMessage(Connection con,
MessagePK messagePK,
String title,
String status)
Updates the message corresponding to the primary key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Collection<ForumDetail> selectByForumPKs(Connection con, Collection<ForumPK> forumPKs) throws SQLException
con
- The connection to the database.forumPKs
- The list of forums primary keys.
SQLException
- An SQL exception.public static Collection<Forum> getForumsByKeys(Connection con, Collection<ForumPK> forumPKs) throws SQLException
con
- The connection to the database.forumPKs
- The list of forums primary keys.
SQLException
- An SQL exception.public static Collection<Message> getMessagesByKeys(Connection con, Collection<MessagePK> messagePKs) throws SQLException
con
- The connection to the database.messagePKs
- The list of messages primary keys.
SQLException
- An SQL exception.public static Collection<Message> getThreadsByKeys(Connection con, Collection<MessagePK> messagePKs) throws SQLException
con
- The connection to the database.messagePKs
- The list of messages primary keys.
SQLException
- An SQL exception.public static List<Forum> getForumsList(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static ArrayList<String> getForumsIds(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static List<Forum> getForumsListByCategory(Connection con, ForumPK forumPK, String categoryId) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.categoryId
- The id of the category.
SQLException
- An SQL exception.public static List<String> getForumSonsIds(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static Forum getForum(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static String getForumName(Connection con, int forumId) throws SQLException
con
- The connection to the database.forumId
- The id of the forum.
SQLException
- An SQL exception.public static boolean isForumActive(Connection con, int forumId) throws SQLException
con
- The connection to the database.forumId
- The id of the forum.
SQLException
- An SQL exception.public static int getForumParentId(Connection con, int forumId) throws SQLException
con
- The connection to the database.forumId
- The id of the forum.
SQLException
- An SQL exception.public static String getForumInstanceId(Connection con, int forumId) throws SQLException
con
- The connection to the database.forumId
- The id of the forum.
SQLException
- An SQL exception.public static String getForumCreatorId(Connection con, int forumId) throws SQLException
con
- The connection to the database.forumId
- The id of the forum.
SQLException
- An SQL exception.public static void lockForum(Connection con, ForumPK forumPK, int level) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.level
- The lock level.
SQLException
- An SQL exception.public static int unlockForum(Connection con, ForumPK forumPK, int level) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.level
- The lock level.
SQLException
- An SQL exception.public static int createForum(Connection con, ForumPK forumPK, String forumName, String forumDescription, String forumCreator, int forumParent, String categoryId) throws SQLException, com.stratelia.webactiv.util.exception.UtilException
con
- The connection to the database.forumPK
- The primary key of the forum.forumName
- The name of the forum.forumDescription
- The description of the forum.forumCreator
- The creator of the forum.forumParent
- The id of the forum's parent forum.categoryId
- The id of the category.
SQLException
- An SQL exception.
com.stratelia.webactiv.util.exception.UtilException
public static void updateForum(Connection con, ForumPK forumPK, String forumName, String forumDescription, int forumParent, String categoryId) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.forumName
- The name of the forum.forumDescription
- The description of the forum.forumParent
- The id of the forum's parent forum.categoryId
- The id of the category.
SQLException
- An SQL exception.public static void deleteForum(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static ArrayList<Message> getMessagesList(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static List<String> getMessagesIds(Connection con, ForumPK forumPK, int messageParentId) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.messageParentId
- The id of the message's parent message.
SQLException
- An SQL exception.public static List<String> getMessagesIds(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static List<String> getSubjectsIds(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static int getNbMessages(Connection con, int forumId, String type, String status) throws SQLException
con
- The connection to the database.forumId
- The id of the forum.type
- The type of the searched messages.
SQLException
- An SQL exception.public static int getAuthorNbMessages(Connection con, String userId, String status) throws SQLException
con
- The connection to the database.userId
- The user's id.
SQLException
- An SQL exception.public static int getNbResponses(Connection con, int forumId, int messageId, String status)
con
- The connection to the database.forumId
- The id of the forum.messageId
- The id of the message.
public static Message getLastMessage(Connection con, ForumPK forumPK, String status) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static ArrayList<Message> getLastThreads(Connection con, ForumPK[] forumPKs, int count) throws SQLException
con
- The connection to the database.forumPKs
- The list of forums primary keys.count
- The maximum number of returned threads.
SQLException
- An SQL exception.public static Collection<Message> getNotAnsweredLastThreads(Connection con, ForumPK[] forumPKs, int count) throws SQLException
con
- The connection to the database.forumPKs
- The list of forums primary keys.count
- The maximum number of returned threads.
SQLException
- An SQL exception.public static Collection<String> getLastMessageRSS(Connection con, String instanceId) throws SQLException
con
- The connection to the database.instanceId
- The id of the forums instance.
SQLException
- An SQL exception.public static Message getLastMessage(Connection con, ForumPK forumPK, List<String> messageParentIds, String status) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.messageParentIds
- The ids of the parent messages.
SQLException
- An SQL exception.public static List getMessageInfos(Connection con, MessagePK messagePK) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.
SQLException
- An SQL exception.public static Message getMessage(Connection con, MessagePK messagePK) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.
SQLException
- An SQL exception.public static String getMessageTitle(Connection con, int messageId) throws SQLException
con
- The connection to the database.messageId
- The id of the message.
SQLException
- An SQL exception.public static int getMessageParentId(Connection con, int messageId) throws SQLException
con
- The connection to the database.messageId
- The id of the message.
SQLException
- An SQL exception.public static Message getThread(Connection con, MessagePK messagePK) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.
SQLException
- An SQL exception.public static int createMessage(Connection con, String messageTitle, String messageAuthor, Date messageDate, int forumId, int messageParent, String status) throws SQLException, com.stratelia.webactiv.util.exception.UtilException
con
- The connection to the database.messageTitle
- The title of the message.messageAuthor
- The author of the message.messageDate
- The date of creation of the message.forumId
- The id of the parent forum.messageParent
- The id of the parent message.
SQLException
- An SQL exception.
com.stratelia.webactiv.util.exception.UtilException
public static void updateMessage(Connection con, MessagePK messagePK, String title, String status) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.title
- The title of the message.
SQLException
- An SQL exception.public static void deleteMessage(Connection con, MessagePK messagePK) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.
SQLException
- An SQL exception.public static Collection<String> getMessageSons(Connection con, MessagePK messagePK) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.
SQLException
- An SQL exception.public static boolean isModerator(Connection con, ForumPK forumPK, String userId) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.userId
- The user's id.
SQLException
- An SQL exception.public static void addModerator(Connection con, ForumPK forumPK, String userId) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.userId
- The user's id.
SQLException
- An SQL exception.public static void removeModerator(Connection con, ForumPK forumPK, String userId) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.userId
- The user's id.
SQLException
- An SQL exception.public static void removeAllModerators(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static List<Moderator> getModerators(Connection con, int forumId) throws SQLException
SQLException
public static void moveMessage(Connection con, MessagePK messagePK, ForumPK forumPK) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static Collection<String> getAllMessageSons(Connection con, MessagePK messagePK) throws SQLException
con
- The connection to the database.messagePK
- The primary key of the message.
SQLException
- An SQL exception.public static ForumDetail getForumDetail(Connection con, ForumPK forumPK) throws SQLException
con
- The connection to the database.forumPK
- The primary key of the forum.
SQLException
- An SQL exception.public static Date getLastVisit(Connection con, String userId, int messageId) throws SQLException
con
- The connection to the database.userId
- The user's id.messageId
- The id of the message.
SQLException
- An SQL exception.public static Date getLastVisit(Connection con, String userId, List<String> messageIds) throws SQLException
con
- The connection to the database.userId
- The user's id.messageIds
- The list of ids of the messages.
SQLException
- An SQL exception.public static void addLastVisit(Connection con, String userId, int messageId) throws SQLException
con
- The connection to the database.userId
- The user's id.messageId
- The id of the message.
SQLException
- An SQL exception.public static void deleteVisit(Connection con, String userId, int messageId) throws SQLException
con
- The connection to the database.userId
- The user's id.messageId
- The id of the message.
SQLException
- An SQL exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |