Class GetCoolerThreads

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

public class GetCoolerThreads extends DAO
A Data Access Object to retrieve Water Cooler threads and thread notifications.
Since:
1.0
Version:
11.1
Author:
Luke
  • Constructor Details

    • GetCoolerThreads

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

    • getByChannel

      public List<MessageThread> getByChannel(String channelName, boolean showImgs) throws DAOException
      Get all Water Cooler threads from a particular Channel.
      Parameters:
      channelName - the Channle name
      showImgs - TRUE if screen shot threads should be included, otherwise FALSE
      Returns:
      a List of MessageThread beans
      Throws:
      DAOException - if a JDBC error occurs
    • getScreenShots

      public List<MessageThread> getScreenShots() throws DAOException
      Returns all Screen Shot message threads.
      Returns:
      a List of MessageThread beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByAuthor

      public List<MessageThread> getByAuthor(int userID, boolean showImgs) throws DAOException
      Get all Water Cooler threads from a particular Author.
      Parameters:
      userID - the Author's database ID
      showImgs - TRUE if screen shot threads should be included, otherwise FALSE
      Returns:
      a List of MessageThread beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByNotification

      public List<MessageThread> getByNotification(int userID) throws DAOException
      Get all Water Cooler threads where a particular user has signed up for notifications.
      Parameters:
      userID - the User's database ID
      Returns:
      a List of MessageThread beans
      Throws:
      DAOException - if a JDBC error occurs
    • getSince

      public List<MessageThread> getSince(Instant sd, boolean showImgs) throws DAOException
      Returns all Water Cooler threads updated since a particular date.
      Parameters:
      sd - the date/time
      showImgs - TRUE if screen shot threads should be included, otherwise FALSE
      Returns:
      a List of MessageThreads
      Throws:
      DAOException - if a JDBC error occurs
    • getThread

      public MessageThread getThread(int id) throws DAOException
      Retrieves a particular discussion thread with posts and warnings.
      Parameters:
      id - the thread ID
      Returns:
      a MessageThread bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
      See Also:
    • getThread

      public MessageThread getThread(int id, boolean loadPosts) throws DAOException
      Retrieves a particular discussion thread.
      Parameters:
      id - the thread ID
      loadPosts - TRUE if posts/warnings should be loaded, otherwise FALSE
      Returns:
      a MessageThread bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getNotifications

      public ThreadNotifications getNotifications(int id) throws DAOException
      Returns thread notifications for a particular message thread.
      Parameters:
      id - the message thread database ID
      Returns:
      a ThreadNotifications bean
      Throws:
      DAOException - if a JDBC error occurs
    • search

      public List<MessageThread> search(SearchCriteria criteria) throws DAOException
      Returns all Message Threads matching particular search criteria.
      Parameters:
      criteria - the search criteria
      Returns:
      a List of MessageThreads
      Throws:
      DAOException - if a JDBC error occurs
    • getByID

      protected List<MessageThread> getByID(Collection<Integer> IDs) throws DAOException
      Loads a number of message threads based on their ID.
      Parameters:
      IDs - a Collection of database IDs
      Returns:
      a List of MessageThread beans
      Throws:
      DAOException - if a JDBC error occurs