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, CalendarEntry, ComboAlias, FeedbackBean, IDBean, TimeSpan, ViewEntry, Cacheable
public class Tour
extends DatabaseDocumentBean
implements Auditable, ComboAlias, ViewEntry, FeedbackBean, TimeSpan
A bean to store Flight Tour data.
- Since:
- 10.0
- Version:
- 12.4
- Author:
- Luke
- See Also:
-
Field Summary
Fields inherited from class DatabaseBlobBean
_buffer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFeedback(Feedback tf) Adds a feedback element to the bean.voidAdds a Flight leg to this Tour.voidaddNetwork(OnlineNetwork net) Adds a valid Online Network to this Tour.voidAdds a Pilot's Tour progress ID to this Tour.voidClears the list of Flights.voidClears the list of Online Networks.booleanReturns whether ACARS flights are required for this Tour.booleanReturns whether the Tour is active.booleanReturns 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.getDate()Returns this entry's date for ordering in the Calendar.The end date/time of this span.Returns the feedback for this bean.intReturns the number of Flight legs in this Tour.Returns the ordered list of Flights for this Tour.intReturns the leg number for a given Flight.booleanReturns whether the equipment used for a flight must match the equipment in the Tour definition.booleanReturns 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.The start date/time of this span.Returns the status of the Tour.booleanisActiveOn(Instant dt) Returns wether the Tour is active and in effect on a given date.booleanReturns whether this object is within multiple web applications.booleanlegMatches(FlightData f, Flight leg) Checks whether a Flight matches a particular Tour leg.voidsetACARSOnly(boolean acarsOnly) Updates whether ACARS flights are required for this Tour.voidsetActive(boolean isActive) Updates whether the Tour is active.voidsetAllowOffline(boolean allowOffline) Updates whether offline flights are permitted for this Tour.voidsetEndTime(Instant dt) Updates the End date for this Tour.voidsetFlightCount(int cnt) Updates the number of Flight legs in this Tour.voidsetMatchEquipment(boolean matchEQ) Updates whether the equipment used for a flight must match the equipment in the Tour definition.voidsetMatchLeg(boolean matchLeg) Returns whether the flight number and leg used for a flight must match the flight and leg in the Tour definition.voidUpdates the Tour name.voidUpdates the Virtual Airline that owns this Tour.voidsetStartTime(Instant dt) Updates the Start date for this Tour.voidsetStatus(TourStatus st) Updates the status of the Tour.toString()Methods inherited from class DatabaseDocumentBean
getBuffer, getContentType, getExtension, getIsPDF, getSize, getText, load, setForcePDF, setForceSizeModifier and TypeMethodDescriptionbyte[]Returns the file buffer.Returns the document's MIME type.Returns the document's file extension.booleangetIsPDF()Returns if the briefing format is PDF.intgetSize()Returns the size of the image/file data.getText()Returns a text representation of the document.voidLoads a text document from a string.voidsetForcePDF(boolean isPDF) Forces the object type.voidsetForceSize(int size) Forces the object size.Methods inherited from class DatabaseBlobBean
clear, getInputStream, isLoaded, load, loadModifier and TypeMethodDescriptionvoidclear()Clears the buffer.Returns the content of the buffer.booleanisLoaded()Returns whether the buffer has been populated.voidload(byte[] buffer) Replaces the buffer data.voidload(InputStream is) Loads the contents of a stream into the buffer.Methods inherited from class DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateIDModifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.intbooleangetHexID()Returns the hexadecimal database ID of this object.intgetID()Returns the database ID of this object.inthashCode()voidsetID(int id) Update the database row ID of this bean.static voidvalidateID(int oldID, int newID) Validates a database ID.static voidvalidateID(int oldID, int newID, boolean allowZero) Validates a database ID.Methods inherited from interface Auditable
getAuditTypeModifier and TypeMethodDescriptiondefault StringReturns the audit type for this auditable object.Methods inherited from interface FeedbackBean
hasFeedbackModifier and TypeMethodDescriptiondefault booleanhasFeedback(int authorID) Returns whether feedback has been provided by a particular user.Methods inherited from interface TimeSpan
getDuration, hasTimes, validateDates
-
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:FeedbackBeanReturns the feedback for this bean.- Specified by:
getFeedbackin interfaceFeedbackBean- Returns:
- a Collection of Feedback beans
-
getDate
Description copied from interface:CalendarEntryReturns this entry's date for ordering in the Calendar.- Specified by:
getDatein interfaceCalendarEntry- Returns:
- the date/time
-
getStartTime
Description copied from interface:TimeSpanThe start date/time of this span.- Specified by:
getStartTimein interfaceTimeSpan- Returns:
- the start date/time
-
getEndTime
Description copied from interface:TimeSpanThe end date/time of this span.- Specified by:
getEndTimein interfaceTimeSpan- Returns:
- the end date/time
-
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:AuditableReturns 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:
isCrossAppin 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
-
setStartTime
Updates the Start date for this Tour.- Parameters:
dt- the start date/time- Throws:
NullPointerException- if dt is null
-
setEndTime
Updates the End date for this Tour.- Parameters:
dt- the end date/time- Throws:
NullPointerException- if dt is null
-
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:FeedbackBeanAdds a feedback element to the bean.- Specified by:
addFeedbackin 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:ComboAliasReturns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboNamein interfaceComboAlias- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAliasReturns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAliasin interfaceComboAlias- Returns:
- The alias for this entry
-
getAuditID
Description copied from interface:AuditableReturns the object ID for this auditable object.- Specified by:
getAuditIDin interfaceAuditable- Returns:
- the ID
-
toString
-
getRowClassName
Description copied from interface:ViewEntryReturns the CSS class for this object if rendered in a view table.- Specified by:
getRowClassNamein interfaceViewEntry- Returns:
- the CSS class name, or NULL if none
-