Class GetWeather

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

public class GetWeather extends DAO
A Data Access Object to load weather data from the database.
Since:
2.7
Version:
9.0
Author:
Luke
  • Constructor Details

    • GetWeather

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

    • get

      Retrieves an arbitrary weather data object from the database.
      Parameters:
      t - the WeatherDataBean Type
      code - the observation station code
      Returns:
      a WeatherDataBean, or null if none found
      Throws:
      DAOException - if a JDBC error occurs
    • getMETAR

      public METAR getMETAR(ICAOAirport a) throws DAOException
      Retrieves the METAR for a particular Airport.
      Parameters:
      a - the ICAOAirport
      Returns:
      a METAR object, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getMETAR

      public METAR getMETAR(GeoLocation loc, int distance) throws DAOException
      Returns the closest METAR to a given point within a specific radius.
      Parameters:
      loc - the GeoLocation
      distance - the maximum distance in miles
      Returns:
      a METAR or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getMETAR

      public METAR getMETAR(String code) throws DAOException
      Retrieves the METAR for a particular observation station.
      Parameters:
      code - the observation station code
      Returns:
      a METAR object, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getTAF

      public TAF getTAF(String code) throws DAOException
      Retrieves the TAF for a particular observation station.
      Parameters:
      code - the observation station code
      Returns:
      a TAF object, or null if not found
      Throws:
      DAOException - if a JDBC error occurs
    • getILSAirports

      public Collection<Airport> getILSAirports(ILSCategory ilscat) throws DAOException
      Returns Airports with ILS conditions.
      Parameters:
      ilscat - the ILSCategory
      Returns:
      a Collection of Airport beans
      Throws:
      DAOException - if a JDBC error occurs