Class GetCachedRoutes

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

public class GetCachedRoutes extends DAO
A Data Access Object to load cached external routes from the database.
Since:
2.6
Version:
11.1
Author:
Luke
  • Constructor Details

    • GetCachedRoutes

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

    • getAverageAge

      public int getAverageAge(RoutePair rp) throws DAOException
      Retrieves the average age of cached routes between two airports.
      Parameters:
      rp - the RoutePair
      Returns:
      the average age in days, or -1 if none found
      Throws:
      DAOException - if a JDBC error occurs
    • getRoutes

      public Collection<? extends FlightRoute> getRoutes(RoutePair rp, boolean includeInternal) throws DAOException
      Loads all the cached routes between two airports.
      Parameters:
      rp - the RoutePair
      includeInternal - TRUE to include internal routes, otherwise FALSE
      Returns:
      a Collection of FlightRoute beans
      Throws:
      DAOException - if a JDBC error occurs