Class FlightReport
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.Flight
org.deltava.beans.flight.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:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.deltava.beans.schedule.RoutePair
RoutePair.RoutePairImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Flight Academy Training Flight.static final int
Flight logged using ACARS.static final int
Flight flown through prohibited airspace.static final int
Flight flown as a Charter flight.static final int
Flight flown as a Check Ride.static final int
Flight flown using a Dispatcher-generated flight plan.static final int
Flight diverted to alternate airport.static final int
Flight flown with non-ETOPS-rated aircraft.static final int
Attribute mask for ACARS/XACARS/simFDR flights.static final int
Flight flown on FPI network.static final int
Flight flown using Historic equipment.static final int
Flight flown on IVAO network.static final int
Flight flown without Equipment Type Rating.static final int
Attribute mask for VATSIM/IVAO/FPI online flights.static final int
Flight flown on PilotEdge network.static final int
Flight flown on POSCON network.static final int
Flight flown with excessive range for aircraft.static final int
Flight flown with ACARS refueling detected.static final int
Flight flown using unknown route pair.static final int
Flight flown using an inappropriate runway surface.static final int
Flight flown using a too-short takeoff or landing runway.static final int
Flight planned using SimBrief.static final int
Flight logged using simFDR.static final int
Flight flown with unusually high or low logged hous.static final int
Flight flown on VATSIM network.static final int
Attribute mask for all warnings.static final int
Flight flown with excessive weights for Aircraft.static final int
Flight logged using XACARS.static final int
Minimum ACARS client version for inclusion in statistics aggregation. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new Flight Report from an existing Flight entry (like an Assignment or ScheduleEntry).FlightReport
(Airline a, int flightNumber, int leg) Creates a new Flight Report object with a given flight. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStatusUpdate
(int authorID, HistoryType type, String msg) Creates a new status update and adds it to the Flight Report.void
Adds a status update to this Flight Report.int
int
Returns the attributes for this Flight Report.int
Returns the Author of this bean.Returns if this flight counts towards promotion in a particular equipment type program.Returns the disposition comments for this Flight Report.int
getDatabaseID
(DatabaseID idType) Sets the database row ID of a relatied database row.getDate()
Returns the date of the flight.The date/time this Flight Report was disposed on.A method to return the exact length of the flight.getFDR()
Returns the Flight Data recorder used for this flight.int
Returns the length of the fllight in hours multiplied by ten.double
Returns the load factor for this flight.Returns the OnlineNetwork the flight is operated on.int
Returns the number of passengers carried on this flight.getRank()
Returns the Pilot's rank at the time of the Flight.Returns the remarks for this Flight Report.getRoute()
Returns the filed Flight Route.Returns the CSS class for this object if rendered in a view table.Returns the Simulator used for this flight.Returns the status of this Flight Report.Returns the flight status history.The date/time this Flight Report was submitted for approval.boolean
hasAttribute
(int attrMask) Returns the presence of a particular flight attribute.boolean
hasDatabaseID
(DatabaseID idType) Returns whether this Flight has a related database row ID.void
setAttribute
(int attrMask, boolean isSet) Set/Clear a particular attribute for this Flight Report.void
setAttributes
(int attrs) Sets the attributes for this Flight Report.void
setAuthorID
(int id) Updates the author of this bean.void
setCaptEQType
(String eqType) Sets if this Flight counts towards promotion in a particular equipment program.void
setCaptEQType
(Collection<String> eqTypes) Sets if this Flight counts towards promotion in a particular equipment program.void
setComments
(String comments) Sets the disposition comments for this Flight Report.void
setDatabaseID
(DatabaseID idType, int id) Sets the database row ID of a relatied database row.void
Updates the date that this Flight was flown on.void
setDisposedOn
(Instant dd) Updates the date/time this Flight Report was approved or rejected on.void
setID
(int id) Updates the database ID, and the database ID of any associated status updates.final void
setLeg
(int leg) Sets the Flight Leg.void
setLength
(int length) Sets the length of this Flight, in hours multiplied by 10.void
setLoadFactor
(double lf) Updates the load factor for this flight.void
setNetwork
(OnlineNetwork network) Updates the Online Network used on this Flight.void
setPassengers
(int ps) Updates the number of passengers carried on this flight.void
Updates the rank of the Pilot filing this report.void
setRemarks
(String remarks) Sets the remarks for this Flight Report.void
Updates the filed Flight Route.void
setSimulator
(Simulator sim) Updates the Simulator used for this flight.void
setStatus
(FlightStatus status) Sets the status of this Flight Report.void
Updates the date/time this Flight Report was submitted on.Methods inherited from class org.deltava.beans.Flight
equals, getAirline, getAirportA, getAirportD, getCallsign, getDistance, getEquipmentType, getFlightCode, getFlightNumber, getLeg, getLegCode, getShortCode, hashCode, setAirline, setAirportA, setAirportD, setEquipmentType, setFlightNumber, toString
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, getHexID, getID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.flight.FlightData
getEquipmentType
Methods inherited from interface org.deltava.beans.FlightNumber
getAirline, getFlightNumber, getLeg
Methods inherited from interface org.deltava.beans.schedule.RoutePair
createKey, getAirportA, getAirportD, getAirports, getDistance, getFlightType, includes, isPopulated, matches
-
Field Details
-
ATTR_NOTRATED
public static final int ATTR_NOTRATEDFlight flown without Equipment Type Rating.- See Also:
-
ATTR_VATSIM
public static final int ATTR_VATSIMFlight flown on VATSIM network.- See Also:
-
ATTR_IVAO
public static final int ATTR_IVAOFlight flown on IVAO network.- See Also:
-
ATTR_FPI
public static final int ATTR_FPIFlight flown on FPI network.- See Also:
-
ATTR_ACARS
public static final int ATTR_ACARSFlight logged using ACARS.- See Also:
-
ATTR_ROUTEWARN
public static final int ATTR_ROUTEWARNFlight flown using unknown route pair.- See Also:
-
ATTR_TIMEWARN
public static final int ATTR_TIMEWARNFlight flown with unusually high or low logged hous.- See Also:
-
ATTR_CHECKRIDE
public static final int ATTR_CHECKRIDEFlight flown as a Check Ride.- See Also:
-
ATTR_CHARTER
public static final int ATTR_CHARTERFlight flown as a Charter flight.- See Also:
-
ATTR_HISTORIC
public static final int ATTR_HISTORICFlight flown using Historic equipment.- See Also:
-
ATTR_ACADEMY
public static final int ATTR_ACADEMYFlight Academy Training Flight.- See Also:
-
ATTR_RANGEWARN
public static final int ATTR_RANGEWARNFlight flown with excessive range for aircraft.- See Also:
-
ATTR_REFUELWARN
public static final int ATTR_REFUELWARNFlight flown with ACARS refueling detected.- See Also:
-
ATTR_ETOPSWARN
public static final int ATTR_ETOPSWARNFlight flown with non-ETOPS-rated aircraft.- See Also:
-
ATTR_DISPATCH
public static final int ATTR_DISPATCHFlight flown using a Dispatcher-generated flight plan.- See Also:
-
ATTR_WEIGHTWARN
public static final int ATTR_WEIGHTWARNFlight flown with excessive weights for Aircraft.- See Also:
-
ATTR_XACARS
public static final int ATTR_XACARSFlight logged using XACARS.- See Also:
-
ATTR_RWYWARN
public static final int ATTR_RWYWARNFlight flown using a too-short takeoff or landing runway.- See Also:
-
ATTR_RWYSFCWARN
public static final int ATTR_RWYSFCWARNFlight flown using an inappropriate runway surface.- See Also:
-
ATTR_SIMFDR
public static final int ATTR_SIMFDRFlight logged using simFDR.- See Also:
-
ATTR_PEDGE
public static final int ATTR_PEDGEFlight flown on PilotEdge network.- See Also:
-
ATTR_AIRSPACEWARN
public static final int ATTR_AIRSPACEWARNFlight flown through prohibited airspace.- See Also:
-
ATTR_DIVERT
public static final int ATTR_DIVERTFlight diverted to alternate airport.- See Also:
-
ATTR_POSCON
public static final int ATTR_POSCONFlight flown on POSCON network.- See Also:
-
ATTR_SIMBRIEF
public static final int ATTR_SIMBRIEFFlight planned using SimBrief.- See Also:
-
ATTR_WARN_MASK
public static final int ATTR_WARN_MASKAttribute mask for all warnings.- See Also:
-
ATTR_ONLINE_MASK
public static final int ATTR_ONLINE_MASKAttribute mask for VATSIM/IVAO/FPI online flights.- See Also:
-
ATTR_FDR_MASK
public static final int ATTR_FDR_MASKAttribute mask for ACARS/XACARS/simFDR flights.- See Also:
-
MIN_ACARS_CLIENT
public static final int MIN_ACARS_CLIENTMinimum ACARS client version for inclusion in statistics aggregation.- See Also:
-
-
Constructor Details
-
FlightReport
Creates a new Flight Report object with a given flight.- Parameters:
a
- the AirlineflightNumber
- the Flight Numberleg
- the Leg Number- Throws:
NullPointerException
- if the Airline Code is nullIllegalArgumentException
- if the Flight Report is zero or negativeIllegalArgumentException
- if the Leg is less than 1 or greater than 5- See Also:
-
FlightReport
Creates a new Flight Report from an existing Flight entry (like an Assignment or ScheduleEntry).- Parameters:
f
- the existing Flight
-
-
Method Details
-
getRank
Returns the Pilot's rank at the time of the Flight.- Returns:
- the Pilot's rank
- See Also:
-
getLength
-
getDuration
Description copied from class:Flight
A method to return the exact length of the flight.- Specified by:
getDuration
in classFlight
- Returns:
- a Duration
-
getFDR
Description copied from interface:FlightData
Returns the Flight Data recorder used for this flight.- Specified by:
getFDR
in interfaceFlightData
- Returns:
- a Recorder enum or null if none/unknown
-
getRemarks
Returns the remarks for this Flight Report.- Returns:
- the remarks
- See Also:
-
getRoute
-
getComments
Returns the disposition comments for this Flight Report.- Returns:
- the disposition comments
- See Also:
-
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
Returns the flight status history.- Returns:
- a Collection of FlightHistoryEntry beans
-
getDate
Description copied from interface:FlightData
Returns the date of the flight.- Specified by:
getDate
in interfaceCalendarEntry
- Specified by:
getDate
in interfaceFlightData
- Returns:
- the date/time
-
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
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
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
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 interfaceAuthoredBean
- Returns:
- the author's database ID
- See Also:
-
getSimulator
Description copied from interface:FlightData
Returns the Simulator used for this flight.- Specified by:
getSimulator
in interfaceFlightData
- 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
Returns the status of this Flight Report.- Returns:
- the status of this PIREP
- See Also:
-
getNetwork
Description copied from interface:FlightData
Returns the OnlineNetwork the flight is operated on.- Specified by:
getNetwork
in interfaceFlightData
- 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
Updates the Online Network used on this Flight.- Parameters:
network
- an OnlineNetwork enum- See Also:
-
setRank
Updates the rank of the Pilot filing this report.- Parameters:
rank
- the rank- See Also:
-
setRemarks
Sets the remarks for this Flight Report.- Parameters:
remarks
- the remarks- See Also:
-
setRoute
Updates the filed Flight Route.- Parameters:
rt
- the route- See Also:
-
setComments
Sets the disposition comments for this Flight Report.- Parameters:
comments
- the disposition comments- See Also:
-
setCaptEQType
Sets if this Flight counts towards promotion in a particular equipment program.- Parameters:
eqTypes
- a Collection of equipment program names- See Also:
-
setCaptEQType
Sets if this Flight counts towards promotion in a particular equipment program.- Parameters:
eqType
- an equipment program names- See Also:
-
addStatusUpdate
Adds a status update to this Flight Report.- Parameters:
upd
- a FlightHistoryEntry
-
addStatusUpdate
Creates a new status update and adds it to the Flight Report.- Parameters:
authorID
- the Author's database IDtype
- the HistoryTypemsg
- 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 classDatabaseBean
- Parameters:
id
- The primary key of the entry in the database that corresponds to this object.- See Also:
-
setLeg
-
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
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 setisSet
- TRUE if attribute should be set, FALSE if attribute should be cleared- See Also:
-
setSimulator
Updates the Simulator used for this flight.- Parameters:
sim
- the Simulator- See Also:
-
setDate
Updates the date that this Flight was flown on.- Parameters:
dt
- when this flight was flown. The time component is undefined.- See Also:
-
setSubmittedOn
Updates the date/time this Flight Report was submitted on.- Parameters:
sd
- this Flight Report was submitted for approval.- See Also:
-
setDisposedOn
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
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 typeid
- 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 interfaceAuthoredBean
- Parameters:
id
- the author's database ID.- See Also:
-
compareTo
-
getRowClassName
Description copied from interface:ViewEntry
Returns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-