Class FlightReport

All Implemented Interfaces:
Serializable, Comparable<Object>, AuthoredBean, CalendarEntry, FlightData, FlightNumber, IDBean, RoutePair, ViewEntry, Cacheable
Direct Known Subclasses:
DraftFlightReport, FDRFlightReport

public class FlightReport extends Flight implements FlightData, AuthoredBean, CalendarEntry, ViewEntry
A class for dealing with PIREP data.
Since:
1.0
Version:
10.3
Author:
Luke
See Also:
  • Field Details

    • ATTR_NOTRATED

      public static final int ATTR_NOTRATED
      Flight flown without Equipment Type Rating.
      See Also:
    • ATTR_VATSIM

      public static final int ATTR_VATSIM
      Flight flown on VATSIM network.
      See Also:
    • ATTR_IVAO

      public static final int ATTR_IVAO
      Flight flown on IVAO network.
      See Also:
    • ATTR_FPI

      public static final int ATTR_FPI
      Flight flown on FPI network.
      See Also:
    • ATTR_ACARS

      public static final int ATTR_ACARS
      Flight logged using ACARS.
      See Also:
    • ATTR_ROUTEWARN

      public static final int ATTR_ROUTEWARN
      Flight flown using unknown route pair.
      See Also:
    • ATTR_TIMEWARN

      public static final int ATTR_TIMEWARN
      Flight flown with unusually high or low logged hous.
      See Also:
    • ATTR_CHECKRIDE

      public static final int ATTR_CHECKRIDE
      Flight flown as a Check Ride.
      See Also:
    • ATTR_CHARTER

      public static final int ATTR_CHARTER
      Flight flown as a Charter flight.
      See Also:
    • ATTR_HISTORIC

      public static final int ATTR_HISTORIC
      Flight flown using Historic equipment.
      See Also:
    • ATTR_ACADEMY

      public static final int ATTR_ACADEMY
      Flight Academy Training Flight.
      See Also:
    • ATTR_RANGEWARN

      public static final int ATTR_RANGEWARN
      Flight flown with excessive range for aircraft.
      See Also:
    • ATTR_REFUELWARN

      public static final int ATTR_REFUELWARN
      Flight flown with ACARS refueling detected.
      See Also:
    • ATTR_ETOPSWARN

      public static final int ATTR_ETOPSWARN
      Flight flown with non-ETOPS-rated aircraft.
      See Also:
    • ATTR_DISPATCH

      public static final int ATTR_DISPATCH
      Flight flown using a Dispatcher-generated flight plan.
      See Also:
    • ATTR_WEIGHTWARN

      public static final int ATTR_WEIGHTWARN
      Flight flown with excessive weights for Aircraft.
      See Also:
    • ATTR_XACARS

      public static final int ATTR_XACARS
      Flight logged using XACARS.
      See Also:
    • ATTR_RWYWARN

      public static final int ATTR_RWYWARN
      Flight flown using a too-short takeoff or landing runway.
      See Also:
    • ATTR_RWYSFCWARN

      public static final int ATTR_RWYSFCWARN
      Flight flown using an inappropriate runway surface.
      See Also:
    • ATTR_SIMFDR

      public static final int ATTR_SIMFDR
      Flight logged using simFDR.
      See Also:
    • ATTR_PEDGE

      public static final int ATTR_PEDGE
      Flight flown on PilotEdge network.
      See Also:
    • ATTR_AIRSPACEWARN

      public static final int ATTR_AIRSPACEWARN
      Flight flown through prohibited airspace.
      See Also:
    • ATTR_DIVERT

      public static final int ATTR_DIVERT
      Flight diverted to alternate airport.
      See Also:
    • ATTR_POSCON

      public static final int ATTR_POSCON
      Flight flown on POSCON network.
      See Also:
    • ATTR_SIMBRIEF

      public static final int ATTR_SIMBRIEF
      Flight planned using SimBrief.
      See Also:
    • ATTR_WARN_MASK

      public static final int ATTR_WARN_MASK
      Attribute mask for all warnings.
      See Also:
    • ATTR_ONLINE_MASK

      public static final int ATTR_ONLINE_MASK
      Attribute mask for VATSIM/IVAO/FPI online flights.
      See Also:
    • ATTR_FDR_MASK

      public static final int ATTR_FDR_MASK
      Attribute mask for ACARS/XACARS/simFDR flights.
      See Also:
    • MIN_ACARS_CLIENT

      public static final int MIN_ACARS_CLIENT
      Minimum ACARS client version for inclusion in statistics aggregation.
      See Also:
  • Constructor Details

  • Method Details

    • getRank

      public Rank getRank()
      Returns the Pilot's rank at the time of the Flight.
      Returns:
      the Pilot's rank
      See Also:
    • getLength

      public int getLength()
      Returns the length of the fllight in hours multiplied by ten. This is done to avoid rounding errors when using a floating point number.
      Specified by:
      getLength in class Flight
      Returns:
      the length of the flight in hours multiplied by ten
      See Also:
    • getDuration

      public Duration getDuration()
      Description copied from class: Flight
      A method to return the exact length of the flight.
      Specified by:
      getDuration in class Flight
      Returns:
      a Duration
    • getFDR

      public Recorder getFDR()
      Description copied from interface: FlightData
      Returns the Flight Data recorder used for this flight.
      Specified by:
      getFDR in interface FlightData
      Returns:
      a Recorder enum or null if none/unknown
    • getRemarks

      public String getRemarks()
      Returns the remarks for this Flight Report.
      Returns:
      the remarks
      See Also:
    • getRoute

      public String getRoute()
      Returns the filed Flight Route.
      Returns:
      the route
      See Also:
    • getComments

      public String getComments()
      Returns the disposition comments for this Flight Report.
      Returns:
      the disposition comments
      See Also:
    • getCaptEQType

      public Collection<String> getCaptEQType()
      Returns if this flight counts towards promotion in a particular equipment type program.
      Returns:
      the equipment type program name(s), or an empty Collection if this flight does not count
    • getStatusUpdates

      public Collection<FlightHistoryEntry> getStatusUpdates()
      Returns the flight status history.
      Returns:
      a Collection of FlightHistoryEntry beans
    • getDate

      public Instant getDate()
      Description copied from interface: FlightData
      Returns the date of the flight.
      Specified by:
      getDate in interface CalendarEntry
      Specified by:
      getDate in interface FlightData
      Returns:
      the date/time
    • getSubmittedOn

      public Instant getSubmittedOn()
      The date/time this Flight Report was submitted for approval.
      Returns:
      the submission date/time of this PIREP, null if never submitted.
      See Also:
    • getDisposedOn

      public Instant getDisposedOn()
      The date/time this Flight Report was disposed on. (approved or rejected)
      Returns:
      the approval/rejected date/time of this PIREP, null if not disposed of
      See Also:
    • getDatabaseID

      public int getDatabaseID(DatabaseID idType)
      Sets the database row ID of a relatied database row. This row may be present in the PILOTS, ASSIGNMENTS, ACARS_PIREPS or EVENTS table. This is typically used by a DAO
      Parameters:
      idType - the datbase row ID type
      Returns:
      the database row ID, or 0 if not found
      Throws:
      NullPointerException - if idType is null
      See Also:
    • hasDatabaseID

      public boolean hasDatabaseID(DatabaseID idType)
      Returns whether this Flight has a related database row ID.
      Parameters:
      idType - the database row ID type
      Returns:
      TRUE if the database row ID is not zero, otherwise FALSE
      Throws:
      NullPointerException - if idType is null
      See Also:
    • getAuthorID

      public int getAuthorID()
      Description copied from interface: AuthoredBean
      Returns the Author of this bean.
      Specified by:
      getAuthorID in interface AuthoredBean
      Returns:
      the author's database ID
      See Also:
    • getSimulator

      public Simulator getSimulator()
      Description copied from interface: FlightData
      Returns the Simulator used for this flight.
      Specified by:
      getSimulator in interface FlightData
      Returns:
      a Simulator
    • getAttributes

      public int getAttributes()
      Returns the attributes for this Flight Report.
      Returns:
      a bit-mask containing this Flight Report's attributes
      See Also:
    • getStatus

      public FlightStatus getStatus()
      Returns the status of this Flight Report.
      Returns:
      the status of this PIREP
      See Also:
    • getNetwork

      public OnlineNetwork getNetwork()
      Description copied from interface: FlightData
      Returns the OnlineNetwork the flight is operated on.
      Specified by:
      getNetwork in interface FlightData
      Returns:
      an OnlineNetwork or null if offline
    • getPassengers

      public int getPassengers()
      Returns the number of passengers carried on this flight.
      Returns:
      the number of passengers
      See Also:
    • getLoadFactor

      public double getLoadFactor()
      Returns the load factor for this flight.
      Returns:
      the load factor from 0 to 1
      See Also:
    • hasAttribute

      public boolean hasAttribute(int attrMask)
      Returns the presence of a particular flight attribute.
      Parameters:
      attrMask - the attribute to check
      Returns:
      TRUE if the attribute is present
      See Also:
    • setNetwork

      public void setNetwork(OnlineNetwork network)
      Updates the Online Network used on this Flight.
      Parameters:
      network - an OnlineNetwork enum
      See Also:
    • setRank

      public void setRank(Rank rank)
      Updates the rank of the Pilot filing this report.
      Parameters:
      rank - the rank
      See Also:
    • setRemarks

      public void setRemarks(String remarks)
      Sets the remarks for this Flight Report.
      Parameters:
      remarks - the remarks
      See Also:
    • setRoute

      public void setRoute(String rt)
      Updates the filed Flight Route.
      Parameters:
      rt - the route
      See Also:
    • setComments

      public void setComments(String comments)
      Sets the disposition comments for this Flight Report.
      Parameters:
      comments - the disposition comments
      See Also:
    • setCaptEQType

      public void setCaptEQType(Collection<String> eqTypes)
      Sets if this Flight counts towards promotion in a particular equipment program.
      Parameters:
      eqTypes - a Collection of equipment program names
      See Also:
    • setCaptEQType

      public void setCaptEQType(String eqType)
      Sets if this Flight counts towards promotion in a particular equipment program.
      Parameters:
      eqType - an equipment program names
      See Also:
    • addStatusUpdate

      public void addStatusUpdate(FlightHistoryEntry upd)
      Adds a status update to this Flight Report.
      Parameters:
      upd - a FlightHistoryEntry
    • addStatusUpdate

      public void addStatusUpdate(int authorID, HistoryType type, String msg)
      Creates a new status update and adds it to the Flight Report.
      Parameters:
      authorID - the Author's database ID
      type - the HistoryType
      msg - the status message
    • setID

      public void setID(int id)
      Updates the database ID, and the database ID of any associated status updates.
      Overrides:
      setID in class DatabaseBean
      Parameters:
      id - The primary key of the entry in the database that corresponds to this object.
      See Also:
    • setLeg

      public final void setLeg(int leg)
      Sets the Flight Leg. Overrides the superclass implementation to check for zero values.
      Overrides:
      setLeg in class Flight
      Parameters:
      leg - the Flight Leg
      See Also:
    • setLength

      public void setLength(int length)
      Sets the length of this Flight, in hours multiplied by 10.
      Parameters:
      length - the length of the flight, in hours multiplied by 10.
    • setStatus

      public void setStatus(FlightStatus status)
      Sets the status of this Flight Report.
      Parameters:
      status - the new FlightStatus for this Flight Report
      See Also:
    • setAttributes

      public void setAttributes(int attrs)
      Sets the attributes for this Flight Report.
      Parameters:
      attrs - the new attributes
      See Also:
    • setAttribute

      public void setAttribute(int attrMask, boolean isSet)
      Set/Clear a particular attribute for this Flight Report.
      Parameters:
      attrMask - the Attribute Mask to set
      isSet - TRUE if attribute should be set, FALSE if attribute should be cleared
      See Also:
    • setSimulator

      public void setSimulator(Simulator sim)
      Updates the Simulator used for this flight.
      Parameters:
      sim - the Simulator
      See Also:
    • setDate

      public void setDate(Instant dt)
      Updates the date that this Flight was flown on.
      Parameters:
      dt - when this flight was flown. The time component is undefined.
      See Also:
    • setSubmittedOn

      public void setSubmittedOn(Instant sd)
      Updates the date/time this Flight Report was submitted on.
      Parameters:
      sd - this Flight Report was submitted for approval.
      See Also:
    • setDisposedOn

      public void setDisposedOn(Instant dd)
      Updates the date/time this Flight Report was approved or rejected on.
      Parameters:
      dd - when this Flight Report was approved or rejected.
      See Also:
    • setPassengers

      public void setPassengers(int ps)
      Updates the number of passengers carried on this flight.
      Parameters:
      ps - the number of passengers
      See Also:
    • setLoadFactor

      public void setLoadFactor(double lf)
      Updates the load factor for this flight.
      Parameters:
      lf - the load factor
      See Also:
    • setDatabaseID

      public void setDatabaseID(DatabaseID idType, int id)
      Sets the database row ID of a relatied database row. This row may be present in the PILOTS , ASSIGNMENTS , ACARS_PIREPS or EVENTS table. This is typically used by a DAO.
      Parameters:
      idType - the row ID type
      id - the database row ID
      Throws:
      IllegalArgumentException - if the id is negative
      See Also:
    • setAuthorID

      public void setAuthorID(int id)
      Description copied from interface: AuthoredBean
      Updates the author of this bean.
      Specified by:
      setAuthorID in interface AuthoredBean
      Parameters:
      id - the author's database ID.
      See Also:
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class Flight
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none