Class 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:
  • Constructor Details

    • Tour

      public Tour(String name)
      Creates the bean.
      Parameters:
      name - the name
  • Method Details

    • getName

      public String getName()
      Returns the Tour name.
      Returns:
      the name
    • getActive

      public boolean getActive()
      Returns whether the Tour is active.
      Returns:
      TRUE if active, otherwise FALSE
    • getStatus

      public TourStatus getStatus()
      Returns the status of the Tour.
      Returns:
      the TourStatus
    • 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

      public Collection<OnlineNetwork> getNetworks()
      Returns the Online Networks eligibile for use in this Tour.
      Returns:
      a Collection of OnlineNetworks
    • getFeedback

      public Collection<Feedback> getFeedback()
      Description copied from interface: FeedbackBean
      Returns the feedback for this bean.
      Specified by:
      getFeedback in interface FeedbackBean
      Returns:
      a Collection of Feedback beans
    • getStartDate

      public Instant getStartDate()
      Returns the Tour start date.
      Returns:
      the start date/time
    • getEndDate

      public Instant getEndDate()
      Returns the Tour end date.
      Returns:
      the end date/time
    • getOwner

      public AirlineInformation getOwner()
      Returns the Virtual Airline that owns this Tour.
      Returns:
      an AirlineInformation
    • isActiveOn

      public boolean isActiveOn(Instant dt)
      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

      public List<ScheduleEntry> 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

      public int getLegIndex(FlightData f)
      Returns the leg number for a given Flight.
      Parameters:
      f - a Flight
      Returns:
      the leg number, or zero if not matched
    • getCompletionIDs

      public Collection<Integer> getCompletionIDs()
      Returns the IDs of the Pilots that have completed this Tour.
      Returns:
      a Collection of Pilot database IDs
    • getProgress

      public Collection<TourProgress> 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 interface Auditable
      Returns:
      TRUE if cross-application, otherwise FALSE
    • setName

      public void setName(String name)
      Updates the Tour name.
      Parameters:
      name - the name
    • setStatus

      public void setStatus(TourStatus st)
      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

      public void addNetwork(OnlineNetwork net)
      Adds a valid Online Network to this Tour.
      Parameters:
      net - an OnlineNetwork
    • setStartDate

      public void setStartDate(Instant dt)
      Updates the Start date for this Tour.
      Parameters:
      dt - the start date/time
      Throws:
      NullPointerException - if dt is null
      IllegalArgumentException - if the start date is after the end date
    • setEndDate

      public void setEndDate(Instant dt)
      Updates the End date for this Tour.
      Parameters:
      dt - the end date/time
      Throws:
      NullPointerException - if dt is null
      IllegalArgumentException - if the end date is before the start date
    • addFlight

      public void addFlight(ScheduleEntry se)
      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

      public void setOwner(AirlineInformation ai)
      Updates the Virtual Airline that owns this Tour.
      Parameters:
      ai - an AirlineInformation beans
    • addProgress

      public void addProgress(TourProgress tp)
      Adds a Pilot's Tour progress ID to this Tour.
      Parameters:
      tp - a TourProgress bean
    • addFeedback

      public void addFeedback(Feedback tf)
      Description copied from interface: FeedbackBean
      Adds a feedback element to the bean.
      Specified by:
      addFeedback in interface FeedbackBean
      Parameters:
      tf - a Feedback object
    • legMatches

      public boolean legMatches(FlightData f, Flight leg)
      Checks whether a Flight matches a particular Tour leg.
      Parameters:
      f - the Flight to check
      leg - the Tour leg
      Returns:
      TRUE if the flight numbers and route pairs match, otherwise FALSE
    • getComboName

      public String getComboName()
      Description copied from interface: ComboAlias
      Returns the visible name to use in the HTML <OPTION> element.
      Specified by:
      getComboName in interface ComboAlias
      Returns:
      The visible name for this entry
    • getComboAlias

      public String getComboAlias()
      Description copied from interface: ComboAlias
      Returns the alias to use in the HTML <OPTION> element.
      Specified by:
      getComboAlias in interface ComboAlias
      Returns:
      The alias for this entry
    • getAuditID

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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