Class GetACARSRoute

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

public class GetACARSRoute extends DAO
A Data Access Object to load stored ACARS dispatch routes.
Since:
2.0
Version:
9.0
Author:
Luke
  • Constructor Details

    • GetACARSRoute

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

    • getRoute

      public DispatchRoute getRoute(int id) throws DAOException
      Loads a saved route from the database.
      Parameters:
      id - the route ID
      Returns:
      a RoutePlan bean, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getAuthorIDs

      public Collection<Integer> getAuthorIDs() throws DAOException
      Returns the database IDs of all dispatchers who have saved a Route.
      Returns:
      a Collection of Database IDs
      Throws:
      DAOException - if a JDBC error occurs
    • getAll

      public Collection<DispatchRoute> getAll(boolean activeOnly, boolean loadWP) throws DAOException
      Loads all saved routes from the database.
      Parameters:
      activeOnly - TRUE if only active routes hould be loaded, otherwise FALSE
      loadWP - TRUE if waypoints should be loaded, otherwise FALSE
      Returns:
      a Collection of RoutePlan beans
      Throws:
      DAOException - if a JDBC error occurs
    • getAirports

      public Collection<Airport> getAirports() throws DAOException
      Loads Airports from all saved routes in the database.
      Returns:
      a Collection of Airport beans
      Throws:
      DAOException - if a JDBC error occurs
    • getByAuthor

      public Collection<DispatchRoute> getByAuthor(int authorID) throws DAOException
      Loads all saved routes from a particular Dispatcher.
      Parameters:
      authorID - the Dispatcher database ID
      Returns:
      a Collection of RoutePlan beans
      Throws:
      DAOException - if a JDBC error occurs
    • getRoutes

      public Collection<DispatchRoute> getRoutes(RoutePair rp, boolean activeOnly) throws DAOException
      Loads all saved routes between two Airports.
      Parameters:
      rp - the RoutePair - either airport can be null
      activeOnly - TRUE if only active routes should be returned, otherwise FALSE
      Returns:
      a Collection of RoutePlan beans
      Throws:
      DAOException - if a JDBC error occurs
    • hasDuplicate

      public int hasDuplicate(RoutePair rp, String route) throws DAOException
      Searches for duplicate routes between two Airports.
      Parameters:
      rp - the RoutePair
      route - the route waypoints, separated by spaces
      Returns:
      the route database ID, or zero if no duplicate found
      Throws:
      DAOException - if a JDBC error occurs