Class Tour
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.DatabaseBlobBean
org.deltava.beans.DatabaseDocumentBean
org.deltava.beans.stats.Tour
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Object>
,Auditable
,ComboAlias
,FeedbackBean
,IDBean
,ViewEntry
,Cacheable
public class Tour
extends DatabaseDocumentBean
implements Auditable, ComboAlias, ViewEntry, FeedbackBean
A bean to store Flight Tour data.
- Since:
- 10.0
- Version:
- 11.6
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class org.deltava.beans.DatabaseBlobBean
_buffer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeedback
(Feedback tf) Adds a feedback element to the bean.void
Adds a Flight leg to this Tour.void
addNetwork
(OnlineNetwork net) Adds a valid Online Network to this Tour.void
Adds a Pilot's Tour progress ID to this Tour.void
Clears the list of Flights.void
Clears the list of Online Networks.boolean
Returns whether ACARS flights are required for this Tour.boolean
Returns whether the Tour is active.boolean
Returns whether offline flights are permitted for this Tour.Returns the object ID for this auditable object.Returns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.Returns the IDs of the Pilots that have completed this Tour.Returns the Tour end date.Returns the feedback for this bean.int
Returns the number of Flight legs in this Tour.Returns the ordered list of Flights for this Tour.int
Returns the leg number for a given Flight.boolean
Returns whether the equipment used for a flight must match the equipment in the Tour definition.boolean
Returns whether the flight number and leg used for a flight must match the flight and leg in the Tour definition.getName()
Returns the Tour name.Returns the Online Networks eligibile for use in this Tour.getOwner()
Returns the Virtual Airline that owns this Tour.Returns the IDs of Pilots that have completed at least one Flight in this Tour.Returns the CSS class for this object if rendered in a view table.Returns the Tour start date.Returns the status of the Tour.boolean
isActiveOn
(Instant dt) Returns wether the Tour is active and in effect on a given date.boolean
Returns whether this object is within multiple web applications.boolean
legMatches
(FlightData f, Flight leg) Checks whether a Flight matches a particular Tour leg.void
setACARSOnly
(boolean acarsOnly) Updates whether ACARS flights are required for this Tour.void
setActive
(boolean isActive) Updates whether the Tour is active.void
setAllowOffline
(boolean allowOffline) Updates whether offline flights are permitted for this Tour.void
setEndDate
(Instant dt) Updates the End date for this Tour.void
setFlightCount
(int cnt) Updates the number of Flight legs in this Tour.void
setMatchEquipment
(boolean matchEQ) Updates whether the equipment used for a flight must match the equipment in the Tour definition.void
setMatchLeg
(boolean matchLeg) Returns whether the flight number and leg used for a flight must match the flight and leg in the Tour definition.void
Updates the Tour name.void
Updates the Virtual Airline that owns this Tour.void
setStartDate
(Instant dt) Updates the Start date for this Tour.void
setStatus
(TourStatus st) Updates the status of the Tour.toString()
Methods inherited from class org.deltava.beans.DatabaseDocumentBean
getBuffer, getContentType, getExtension, getIsPDF, getSize, getText, load, setForcePDF, setForceSize
Methods inherited from class org.deltava.beans.DatabaseBlobBean
clear, getInputStream, isLoaded, load, load
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.deltava.beans.Auditable
getAuditType
Methods inherited from interface org.deltava.beans.FeedbackBean
hasFeedback
-
Constructor Details
-
Tour
-
-
Method Details
-
getName
-
getActive
public boolean getActive()Returns whether the Tour is active.- Returns:
- TRUE if active, otherwise FALSE
-
getStatus
-
getACARSOnly
public boolean getACARSOnly()Returns whether ACARS flights are required for this Tour.- Returns:
- TRUE if ACARS required, otherwise FALSE
-
getAllowOffline
public boolean getAllowOffline()Returns whether offline flights are permitted for this Tour.- Returns:
- TRUE if offline flights are permitted, otherwise FALSE
-
getMatchEquipment
public boolean getMatchEquipment()Returns whether the equipment used for a flight must match the equipment in the Tour definition.- Returns:
- TRUE if equipment type must match, otherwise FALSE
-
getMatchLeg
public boolean getMatchLeg()Returns whether the flight number and leg used for a flight must match the flight and leg in the Tour definition.- Returns:
- TRUE if flight number and leg must match, otherwise FALSE
-
getNetworks
Returns the Online Networks eligibile for use in this Tour.- Returns:
- a Collection of OnlineNetworks
-
getFeedback
Description copied from interface:FeedbackBean
Returns the feedback for this bean.- Specified by:
getFeedback
in interfaceFeedbackBean
- Returns:
- a Collection of Feedback beans
-
getStartDate
-
getEndDate
-
getOwner
Returns the Virtual Airline that owns this Tour.- Returns:
- an AirlineInformation
-
isActiveOn
Returns wether the Tour is active and in effect on a given date.- Parameters:
dt
- the date/time, or null for now- Returns:
- TRUE if the Tour is active and the date is within the start/end dates
-
getFlights
Returns the ordered list of Flights for this Tour.- Returns:
- a List of ScheduleEntry beans
-
getFlightCount
public int getFlightCount()Returns the number of Flight legs in this Tour.- Returns:
- the number of legs
-
getLegIndex
Returns the leg number for a given Flight.- Parameters:
f
- a Flight- Returns:
- the leg number, or zero if not matched
-
getCompletionIDs
Returns the IDs of the Pilots that have completed this Tour.- Returns:
- a Collection of Pilot database IDs
-
getProgress
Returns the IDs of Pilots that have completed at least one Flight in this Tour.- Returns:
- a Collection of TourProgress beans
-
clearFlights
public void clearFlights()Clears the list of Flights. -
clearNetworks
public void clearNetworks()Clears the list of Online Networks. -
isCrossApp
public boolean isCrossApp()Description copied from interface:Auditable
Returns whether this object is within multiple web applications. Objects where this is false will need additional data appended to the audit ID to prevent information leakage across applications where the audit IDs are identical between apps.- Specified by:
isCrossApp
in interfaceAuditable
- Returns:
- TRUE if cross-application, otherwise FALSE
-
setName
-
setStatus
Updates the status of the Tour.- Parameters:
st
- the TourStatus
-
setActive
public void setActive(boolean isActive) Updates whether the Tour is active.- Parameters:
isActive
- TRUE if acrtive, otherwise FALSE
-
setACARSOnly
public void setACARSOnly(boolean acarsOnly) Updates whether ACARS flights are required for this Tour.- Parameters:
acarsOnly
- TRUE if ACARS required, otherwise FALSE
-
setAllowOffline
public void setAllowOffline(boolean allowOffline) Updates whether offline flights are permitted for this Tour.- Parameters:
allowOffline
- TRUE if offline flights permitted, otherwise FALSE
-
setMatchEquipment
public void setMatchEquipment(boolean matchEQ) Updates whether the equipment used for a flight must match the equipment in the Tour definition.- Parameters:
matchEQ
- TRUE if equipment type must match, otherwise FALSE
-
setMatchLeg
public void setMatchLeg(boolean matchLeg) Returns whether the flight number and leg used for a flight must match the flight and leg in the Tour definition.- Parameters:
matchLeg
- TRUE if flight number and leg must match, otherwise FALSE
-
addNetwork
Adds a valid Online Network to this Tour.- Parameters:
net
- an OnlineNetwork
-
setStartDate
Updates the Start date for this Tour.- Parameters:
dt
- the start date/time- Throws:
NullPointerException
- if dt is nullIllegalArgumentException
- if the start date is after the end date
-
setEndDate
Updates the End date for this Tour.- Parameters:
dt
- the end date/time- Throws:
NullPointerException
- if dt is nullIllegalArgumentException
- if the end date is before the start date
-
addFlight
Adds a Flight leg to this Tour.- Parameters:
se
- a ScheduleEntry
-
setFlightCount
public void setFlightCount(int cnt) Updates the number of Flight legs in this Tour.- Parameters:
cnt
- the number of legs- Throws:
IllegalStateException
- if flights have already been added to this Tour
-
setOwner
Updates the Virtual Airline that owns this Tour.- Parameters:
ai
- an AirlineInformation beans
-
addProgress
Adds a Pilot's Tour progress ID to this Tour.- Parameters:
tp
- a TourProgress bean
-
addFeedback
Description copied from interface:FeedbackBean
Adds a feedback element to the bean.- Specified by:
addFeedback
in interfaceFeedbackBean
- Parameters:
tf
- a Feedback object
-
legMatches
Checks whether a Flight matches a particular Tour leg.- Parameters:
f
- the Flight to checkleg
- the Tour leg- Returns:
- TRUE if the flight numbers and route pairs match, otherwise FALSE
-
getComboName
Description copied from interface:ComboAlias
Returns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboName
in interfaceComboAlias
- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAlias
Returns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAlias
in interfaceComboAlias
- Returns:
- The alias for this entry
-
getAuditID
Description copied from interface:Auditable
Returns the object ID for this auditable object.- Specified by:
getAuditID
in interfaceAuditable
- Returns:
- the ID
-
toString
-
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
-