Class GetRawSchedule

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

public class GetRawSchedule extends DAO
A Data Access Object to load raw schedule entries.
Since:
8.0
Version:
11.2
Author:
Luke
  • Constructor Details

    • GetRawSchedule

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

    • getSources

      public Collection<ScheduleSourceInfo> getSources(boolean isLoaded, String db) throws DAOException
      Returns all raw schedule sources.
      Parameters:
      isLoaded - TRUE to only include loaded sources, otherwise FALSE
      db - the database name
      Returns:
      a Collection of ScheduleSourceInfo beans
      Throws:
      DAOException - if a JDBC error occurs
    • getSourceAirlines

      public Map<ScheduleSource, Collection<Airline>> getSourceAirlines() throws DAOException
      Returns the mapping of Airlines to Schedule sources.
      Returns:
      a Map of Collections of Airlines, keyed by ScheduleSource
      Throws:
      DAOException - if a JDBC error occurs
    • get

      public RawScheduleEntry get(ScheduleSource src, int line) throws DAOException
      Loads an individual raw schedule entry.
      Parameters:
      src - the ScheduleSource
      line - the source line number
      Returns:
      a RawScheduleEntry, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getAirlines

      public Collection<Airline> getAirlines(ScheduleSource src, Airport a) throws DAOException
      Returns the Airlines that service a particular Airport in a schedule source.
      Parameters:
      src - the ScheduleSource or null for all
      a - the Airport
      Returns:
      a Collection of Airline beans
      Throws:
      DAOException - if a JDBC error occurs
    • getDays

      public Collection<DayOfWeek> getDays(ScheduleSource src, Airport a, boolean isDestination) throws DAOException
      Returns the days of the week an Airport has flights from a particular schedule source.
      Parameters:
      src - the ScheduleSource, or null for all
      a - the Airport
      isDestination - TRUE if selecting arriving flights, otherwise FALSE
      Returns:
      a Collection of DayOfWeek enums
      Throws:
      DAOException - if a JDBC error occurs
    • list

      public List<RawScheduleEntry> list(ScheduleSource src, Airport aD, Airport aA) throws DAOException
      Lists all raw schedule entries between two Airports from a particular schedule source.
      Parameters:
      src - a ScheduleSource
      aD - the departure Airport, or null for all
      aA - the arrival Airport, or null for all
      Returns:
      a List of RawScheduleEntry beans
      Throws:
      DAOException - if a JDBC error occurs
    • load

      public List<RawScheduleEntry> load(ScheduleSource src, LocalDate ld) throws DAOException
      Loads all raw schedule entries for a particular day of the week.
      Parameters:
      src - the ScheduleSource
      ld - the schedule effective date, or null for all
      Returns:
      a Collection of RawScheduleEntry beans
      Throws:
      DAOException - if a JDBC error occurs