Class SetSELCAL

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

public class SetSELCAL extends DAO
A Data Access Object to write aircraft SELCAL data.
Since:
1.0
Version:
9.0
Author:
Luke
  • Constructor Details

    • SetSELCAL

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

    • write

      public void write(SelectCall sc) throws DAOException
      Adds or updates an aircraft SELCAL code.
      Parameters:
      sc - the SelectCall bean
      Throws:
      DAOException - if a JDBC error occurs
    • reserve

      public void reserve(String code, int pilotID) throws DAOException
      Reserves an aircraft SELCAL code for a particular Pilot.
      Parameters:
      code - the SELCAL code
      pilotID - the database ID of the Pilot
      Throws:
      DAOException - if a JDBC error occurs
    • free

      public void free(String code) throws DAOException
      Releases an aircraft SELCAL code reservation.
      Parameters:
      code - the SELCAL code
      Throws:
      DAOException - if a JDBC error occurs
    • delete

      public void delete(String code) throws DAOException
      Deletes an aircraft SELCAL code from the database.
      Parameters:
      code - the SELCAL code
      Throws:
      DAOException - if a JDBC error occurs
      NullPointerException - if code is null
    • free

      public int free(int days) throws DAOException
      Frees aircraft SELCAL codes reserved for a set interval.
      Parameters:
      days - the interval in days
      Returns:
      the number of codes freed up
      Throws:
      DAOException - if a JDBC error occurs