Class GetStatistics

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

public class GetStatistics extends DAO
A Data Access Object to retrieve Airline statistics.
Since:
1.0
Version:
11.1
Author:
Luke
  • Constructor Details

    • GetStatistics

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

    • getAirlineTotals

      public AirlineTotals getAirlineTotals() throws DAOException
      Returns Airline Totals. This method is synchronized across all instances because of the expense of the database queries.
      Returns:
      the AirlineTotals for this airline
      Throws:
      DAOException - if a JDBC error occurs
    • getActivePilots

      public int getActivePilots(String dbName) throws DAOException
      Returns the number of active Pilots in an Airline.
      Parameters:
      dbName - the database name
      Returns:
      the number of Active/On Leave pilots
      Throws:
      DAOException - if a JDBC error occurs
    • getMembershipQuantiles

      public Map<Integer,Instant> getMembershipQuantiles(int splitInto) throws DAOException
      Returns membership data by percentiles.
      Parameters:
      splitInto - the number of segments to divide into
      Returns:
      a Map of percentile and joining date.
      Throws:
      DAOException - if a JDBC error occurs
    • getJoinStats

      public Collection<MembershipTotals> getJoinStats() throws DAOException
      Returns membership Join date statistics.
      Returns:
      a Collection of MembershipTotals beans
      Throws:
      DAOException - if a JDBC error occurs
    • getCoolerStatistics

      public Map<Integer,Long> getCoolerStatistics(Collection<Integer> ids) throws DAOException
      Returns Water Cooler posting statistics for a number of users.
      Parameters:
      ids - a Collection of database IDs
      Returns:
      a Map of post counts, indexed by database ID
      Throws:
      DAOException - if a JDBC error occurs
    • getCoolerStatistics

      public long getCoolerStatistics(int days) throws DAOException
      Retrieves Water Cooler post counts.
      Parameters:
      days - the number of days in the past to count
      Returns:
      the number of posts in the specified interval
      Throws:
      DAOException - if a JDBC error occurs