Class SetCoolerMessage

java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.SetCoolerMessage

public class SetCoolerMessage extends DAO
A Data Access Object to handle writing Water Cooler message threads and posts.
Since:
1.0
Version:
9.0
Author:
Luke
  • Constructor Details

    • SetCoolerMessage

      public SetCoolerMessage(Connection c)
      Initializes the Data Access Object.
      Parameters:
      c - the JDBC connection to use
  • Method Details

    • write

      public void write(Message msg) throws DAOException
      Writes a new Post to the Water Cooler.
      Parameters:
      msg - the Message post bean
      Throws:
      DAOException - if a JDBC error occurs
    • update

      public void update(Message msg) throws DAOException
      Updates an existing Post in the Water Cooler.
      Parameters:
      msg - the Message post bean
      Throws:
      DAOException - if a JDBC error occurs
    • write

      public void write(MessageThread t) throws DAOException
      Writes a new Message Thread into the database.
      Parameters:
      t - the Message Thread
      Throws:
      DAOException - if a JDBC error occurs
      IllegalStateException - if there are no Posts in the Thread
    • write

      public void write(ThreadUpdate upd) throws DAOException
      Writes a Discussion Thread update to the database.
      Parameters:
      upd - the ThreadUpdate bean
      Throws:
      DAOException - if a JDBC error occurs
    • markRead

      public void markRead(int threadID, int userID) throws DAOException
      Marks a Message Thread as being read by a particular user.
      Parameters:
      threadID - the Message Thread ID
      userID - the User dataase ID
      Throws:
      DAOException - if a JDBC error occurs
    • viewThread

      public void viewThread(int id) throws DAOException
      Marks a Message Thread as being viewed.
      Parameters:
      id - the Message Thread ID
      Throws:
      DAOException - if a JDBC error occurs
    • setChannel

      public void setChannel(int threadID, String newChannel) throws DAOException
      Changes the Channel for a Message Thread.
      Parameters:
      threadID - the Message Thread ID
      newChannel - the new Channel name
      Throws:
      DAOException - if a JDBC error occurs
    • updateSubject

      public void updateSubject(int threadID, String subj) throws DAOException
      Updates the Subject of a Message Thread.
      Parameters:
      threadID - the Message Thread ID
      subj - the new Subject
      Throws:
      DAOException - if a JDBC error occurs
    • moderateThread

      public void moderateThread(int id, boolean doHide, boolean doLock) throws DAOException
      Moderates a Thread by updating the locked and hidden flags.
      Parameters:
      id - the thread ID
      doHide - TRUE if the thread should be hidden, otherwise FALSE
      doLock - TRUE if the thread should be locked, otherwise FALSE
      Throws:
      DAOException - if a JDBC error occurs
    • delete

      public void delete(int threadID, int postID) throws DAOException
      Deletes a Message.
      Parameters:
      threadID - the Message Thread database ID
      postID - the Post database ID
      Throws:
      DAOException - if a JDBC error occurs
    • delete

      public void delete(int id) throws DAOException
      Deletes a Message Thread and all associated posts.
      Parameters:
      id - the Message Thread database ID
      Throws:
      DAOException - if a JDBC error occurs
    • synchThread

      public void synchThread(MessageThread mt) throws DAOException
      Recalculates Thread information by querying existing Thread Posts.
      Parameters:
      mt - the Message Thread
      Throws:
      DAOException - if a JDBC error occurs
    • unstickThread

      public void unstickThread(int id) throws DAOException
      Unsticks a Water Cooler Message Thread.
      Parameters:
      id - the Message Thread's database ID
      Throws:
      DAOException - if a JDBC error occurs
    • restickThread

      public void restickThread(int id, Instant sDate, boolean stickyChannel) throws DAOException
      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 ID
      sDate - the new sticky date
      stickyChannel - TRUE if sticky in channel only, otherwise FALSE
      Throws:
      DAOException - if a JDBC error occurs
      See Also:
    • report

      public void report(MessageThread mt, int id) throws DAOException
      Writes a content warning report for a particular Water Cooler discussion thread.
      Parameters:
      mt - the MessageThread bean
      id - the user's database ID
      Throws:
      DAOException - if a JDBC error occurs
    • vote

      public void vote(PollVote vote) throws DAOException
      Writes a vote in a Water Cooler discussion poll.
      Parameters:
      vote - the PollVote bean
      Throws:
      DAOException - if a JDBC error occurs
    • clearWarning

      public void clearWarning(int id) throws DAOException
      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

      public void clearReport(int id) throws DAOException
      Clears content reports from a Water Cooler discussion thread.
      Parameters:
      id - the thread ID
      Throws:
      DAOException - if a JDBC error occurs