Class SetOnlineTrack

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

public class SetOnlineTrack extends DAO
A Data Access Object to write VATSIM/IVAO/PilotEdge Online tracks.
Since:
2.4
Version:
9.0
Author:
Luke
  • Constructor Details

    • SetOnlineTrack

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

    • writeTrack

      public int writeTrack(int userID, OnlineNetwork net, Airport aD, Airport aA, String route) throws DAOException
      Writes a new Online Track record to the shared database.
      Parameters:
      userID - the Pilot's database ID
      net - the OnlineNetwork used
      aD - the departure Airport
      aA - the arrival Airport
      route - the filed route
      Returns:
      the newly written track ID
      Throws:
      DAOException - if a JDBC error occurs
    • writePosition

      public void writePosition(PositionData pd) throws DAOException
      Writes a Position record to the shared database.
      Parameters:
      pd - a PositionData bean
      Throws:
      DAOException - if a JDBC error occurs
    • writePull

      public void writePull(OnlineNetwork net, Instant fetchTime) throws DAOException
      Records a ServInfo info pull.
      Parameters:
      net - the OnlineNetwork
      fetchTime - the fetch date/time in UTC
      Throws:
      DAOException - if a JDBC error occurs
    • purgeRaw

      public void purgeRaw(int rawFlightID) throws DAOException
      Purges raw data from the database.
      Parameters:
      rawFlightID - the flight ID of the raw flight data
      Throws:
      DAOException - if a JDBC error occurs
    • purgeAll

      public int purgeAll(int hours) throws DAOException
      Purges all raw flight records started prior to a particular time.
      Parameters:
      hours - the number of hours ago
      Returns:
      the number of flights purged
      Throws:
      DAOException - if a JDBC error occurs
    • purge

      public void purge(int pirepID) throws DAOException
      Purges linked data from the database.
      Parameters:
      pirepID - the flight report ID
      Throws:
      DAOException - if a JDBC error occurs
    • write

      public void write(int pirepID, Collection<PositionData> pds, String dbName) throws DAOException
      Writes position records to the database and links them to a Flight Report.
      Parameters:
      pirepID - the Flight Report database ID
      pds - a Collection of PositionData beans
      dbName - the database name
      Throws:
      DAOException - if a JDBC error occurs