Class SetCoolerMessage
java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.SetCoolerMessage
A Data Access Object to handle writing Water Cooler message threads and posts.
- Since:
- 1.0
- Version:
- 9.0
- Author:
- Luke
-
Field Summary
Fields inherited from class org.deltava.dao.DAO
_queryMax, _queryStart, _queryTimeout, WGS84_SRID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclearReport(int id) Clears content reports from a Water Cooler discussion thread.voidclearWarning(int id) Clears content warnings from all posts in a Water Cooler discussion thread.voiddelete(int id) Deletes a Message Thread and all associated posts.voiddelete(int threadID, int postID) Deletes a Message.voidmarkRead(int threadID, int userID) Marks a Message Thread as being read by a particular user.voidmoderateThread(int id, boolean doHide, boolean doLock) Moderates a Thread by updating the locked and hidden flags.voidreport(MessageThread mt, int id) Writes a content warning report for a particular Water Cooler discussion thread.voidrestickThread(int id, Instant sDate, boolean stickyChannel) Updates the sticky date on a Water Cooler Message Thread.voidsetChannel(int threadID, String newChannel) Changes the Channel for a Message Thread.voidRecalculates Thread information by querying existing Thread Posts.voidunstickThread(int id) Unsticks a Water Cooler Message Thread.voidUpdates an existing Post in the Water Cooler.voidupdateSubject(int threadID, String subj) Updates the Subject of a Message Thread.voidviewThread(int id) Marks a Message Thread as being viewed.voidWrites a vote in a Water Cooler discussion poll.voidWrites a new Post to the Water Cooler.voidWrites a new Message Thread into the database.voidwrite(ThreadUpdate upd) Writes a Discussion Thread update to the database.Methods inherited from class org.deltava.dao.DAO
commitTransaction, createTimestamp, executeIDs, executeUpdate, executeUpdate, expandDate, formatDBName, formatLocation, getNewID, getQueryCount, prepare, prepareWithoutLimits, rollbackTransaction, setQueryMax, setQueryStart, setQueryTimeout, startTransaction, toID, toID, toInstant
-
Constructor Details
-
SetCoolerMessage
Initializes the Data Access Object.- Parameters:
c- the JDBC connection to use
-
-
Method Details
-
write
Writes a new Post to the Water Cooler.- Parameters:
msg- the Message post bean- Throws:
DAOException- if a JDBC error occurs
-
update
Updates an existing Post in the Water Cooler.- Parameters:
msg- the Message post bean- Throws:
DAOException- if a JDBC error occurs
-
write
Writes a new Message Thread into the database.- Parameters:
t- the Message Thread- Throws:
DAOException- if a JDBC error occursIllegalStateException- if there are no Posts in the Thread
-
write
Writes a Discussion Thread update to the database.- Parameters:
upd- the ThreadUpdate bean- Throws:
DAOException- if a JDBC error occurs
-
markRead
Marks a Message Thread as being read by a particular user.- Parameters:
threadID- the Message Thread IDuserID- the User dataase ID- Throws:
DAOException- if a JDBC error occurs
-
viewThread
Marks a Message Thread as being viewed.- Parameters:
id- the Message Thread ID- Throws:
DAOException- if a JDBC error occurs
-
setChannel
Changes the Channel for a Message Thread.- Parameters:
threadID- the Message Thread IDnewChannel- the new Channel name- Throws:
DAOException- if a JDBC error occurs
-
updateSubject
Updates the Subject of a Message Thread.- Parameters:
threadID- the Message Thread IDsubj- the new Subject- Throws:
DAOException- if a JDBC error occurs
-
moderateThread
Moderates a Thread by updating the locked and hidden flags.- Parameters:
id- the thread IDdoHide- TRUE if the thread should be hidden, otherwise FALSEdoLock- TRUE if the thread should be locked, otherwise FALSE- Throws:
DAOException- if a JDBC error occurs
-
delete
Deletes a Message.- Parameters:
threadID- the Message Thread database IDpostID- the Post database ID- Throws:
DAOException- if a JDBC error occurs
-
delete
Deletes a Message Thread and all associated posts.- Parameters:
id- the Message Thread database ID- Throws:
DAOException- if a JDBC error occurs
-
synchThread
Recalculates Thread information by querying existing Thread Posts.- Parameters:
mt- the Message Thread- Throws:
DAOException- if a JDBC error occurs
-
unstickThread
Unsticks a Water Cooler Message Thread.- Parameters:
id- the Message Thread's database ID- Throws:
DAOException- if a JDBC error occurs
-
restickThread
Updates the sticky date on a Water Cooler Message Thread. This will unstick the thread if the date is null or in the past.- Parameters:
id- the Message Thread's database IDsDate- the new sticky datestickyChannel- TRUE if sticky in channel only, otherwise FALSE- Throws:
DAOException- if a JDBC error occurs- See Also:
-
report
Writes a content warning report for a particular Water Cooler discussion thread.- Parameters:
mt- the MessageThread beanid- the user's database ID- Throws:
DAOException- if a JDBC error occurs
-
vote
Writes a vote in a Water Cooler discussion poll.- Parameters:
vote- the PollVote bean- Throws:
DAOException- if a JDBC error occurs
-
clearWarning
Clears content warnings from all posts in a Water Cooler discussion thread.- Parameters:
id- the thread ID- Throws:
DAOException- if a JDBC error occurs
-
clearReport
Clears content reports from a Water Cooler discussion thread.- Parameters:
id- the thread ID- Throws:
DAOException- if a JDBC error occurs
-