Class PilotWriteDAO

java.lang.Object
org.deltava.dao.DAO
org.deltava.dao.PilotWriteDAO
Direct Known Subclasses:
SetApplicant, SetPilot, SetPilotLogin, SetPilotMerge, SetPilotPush

public abstract class PilotWriteDAO extends DAO
A Data Access Object to support writing Pilot objects to the database.
Since:
1.0
Version:
10.3
Author:
Luke
  • Constructor Details

    • PilotWriteDAO

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

    • writeRoles

      protected void writeRoles(int id, Collection<Role> roles) throws SQLException
      Writes a Pilot's security roles to the database.
      Parameters:
      id - the Pilot's database ID
      roles - a Collection of security role names
      Throws:
      SQLException - if a JDBC error occurs
    • writeRatings

      protected void writeRatings(int id, Collection<String> ratings, String db, boolean doClear) throws SQLException
      Writes a Pilot's equipment type ratings to the database.
      Parameters:
      id - the Pilot's database ID
      ratings - a Collection of aircraft types
      db - the database to write to
      doClear - TRUE if existing ratings should be cleared, otherwise FALSE
      Throws:
      SQLException - if a JDBC error occurs
    • writeExternalIDs

      protected void writeExternalIDs(int id, Map<ExternalID, String> addrs, String db, boolean doClear) throws SQLException
      Writes a Pilot's external IDs to the database.
      Parameters:
      id - the Pilot's database ID
      addrs - a Map of IM addresses, keyed by type
      db - the database to write to
      doClear - TRUE if existing ratings should be cleared, otherwise FALSE
      Throws:
      SQLException - if a JDBC error occurs
    • writeAlias

      protected void writeAlias(int id, String... aliases) throws SQLException
      Writes a Pilot's alias to the AUTH_ALIAS table if present.
      Parameters:
      id - the Pilot's database ID
      aliases - an array of aliases
      Throws:
      SQLException - if a JDBC error occurs
    • setStatus

      public void setStatus(int id, PilotStatus status) throws DAOException
      Updates a Pilots' status in the database.
      Parameters:
      id - the pilot database ID
      status - the PilotStatus
      Throws:
      DAOException - if a JDBC error occurs