Class GetInactivity


public class GetInactivity extends PilotReadDAO
A Data Access Object to read Inactivity purge entries. This DAO extends PilotReadDAO since it is used to query pilots who may not have an Inactivity purge table entry, but are eligible for one.
Since:
1.0
Version:
9.0
Author:
Luke
  • Constructor Details

    • GetInactivity

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

    • getInactivity

      public InactivityPurge getInactivity(int pilotID) throws DAOException
      Returns inactivity data for a particular Pilot.
      Parameters:
      pilotID - the Pilot's database ID
      Returns:
      an InactivityPurge bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getPurgeable

      public Collection<InactivityPurge> getPurgeable() throws DAOException
      Returns purge entries for all pilots who are eligible to be purged.
      Returns:
      a Collection of InactivityPurge beans
      Throws:
      DAOException - if a JDBC error occurs
    • getInactivePilots

      public Collection<Integer> getInactivePilots(int days) throws DAOException
      Returns the IDs of Pilots who have not logged in for a certain number of days.
      Parameters:
      days - the number of days
      Returns:
      a Collection of database IDs
      Throws:
      DAOException - if a JDBC error occurs
    • getRepeatInactive

      public Collection<Integer> getRepeatInactive(int loginDays, int activityDays, int minPosts) throws DAOException
      Returns the IDs of Pilots who have not participated in the period prior to the Inactivity warning.
      Parameters:
      loginDays - the number of days since their last login
      activityDays - the number of days to check for Flight Reports, Cooler posts or Examinations
      minPosts - the minimum number of Cooler posts
      Returns:
      a Collection of database IDs
      Throws:
      DAOException - if a JDBC error occurs