Class Event

All Implemented Interfaces:
Serializable, Comparable<Object>, CalendarEntry, ComboAlias, FeedbackBean, IDBean, TimeSpan, Cacheable

public class Event extends ImageBean implements ComboAlias, TimeSpan, FeedbackBean
A class to store Online Event information.
Since:
1.0
Version:
11.6
Author:
Luke
See Also:
  • Constructor Details

    • Event

      public Event(String name)
      Creates a new Online Event.
      Parameters:
      name - the event name
      See Also:
  • Method Details

    • getName

      public String getName()
      Returns the Online Event name.
      Returns:
      the event name
    • 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
    • getImageType

      public ImageType getImageType()
      Description copied from class: ImageBean
      Returns the database image type.
      Specified by:
      getImageType in class ImageBean
      Returns:
      an ImageType
    • getBriefing

      public Briefing getBriefing()
      Returns the Online Event pilot briefing.
      Returns:
      the briefing
    • getStatus

      public Status getStatus()
      Returns the status of this Online Event.
      Returns:
      the Status
      See Also:
    • getOwner

      public AirlineInformation getOwner()
      Returns the Airline that owns this Online Event.
      Returns:
      an AirlineInformation bean
      See Also:
    • getAirlines

      public Collection<AirlineInformation> getAirlines()
      Returns the Airlines participating in this Online Event.
      Returns:
      a Collection of AirlineInformation beans
      See Also:
    • getNetwork

      public OnlineNetwork getNetwork()
      Returns the Online Network for this Event.
      Returns:
      the network code
      See Also:
    • getStartTime

      public Instant getStartTime()
      Description copied from interface: TimeSpan
      The start date/time of this span.
      Specified by:
      getStartTime in interface TimeSpan
      Returns:
      the start date/time
    • getDate

      public Instant getDate()
      Description copied from interface: CalendarEntry
      Returns this entry's date for ordering in the Calendar.
      Specified by:
      getDate in interface CalendarEntry
      Returns:
      the date/time
    • getEndTime

      public Instant getEndTime()
      Description copied from interface: TimeSpan
      The end date/time of this span.
      Specified by:
      getEndTime in interface TimeSpan
      Returns:
      the end date/time
    • getSignupDeadline

      public Instant getSignupDeadline()
      Returns the final date/time for pilots to sign up for this Event.
      Returns:
      the date/time signups close
      See Also:
    • getCanSignup

      public boolean getCanSignup()
      Returns whether Pilots may sign up for this Event.
      Returns:
      TRUE if signups are permitted, otherwise FALSE
      See Also:
    • getSignupURL

      public String getSignupURL()
      Returns the external URL used to sign up at.
      Returns:
      the signup URL
      See Also:
    • getCharts

      public Collection<Chart> getCharts()
      Returns the Charts available for this Online Event.
      Returns:
      a Collection of Chart beans
      See Also:
    • getContactAddrs

      public Collection<String> getContactAddrs()
      Returns the e-mail contact addresses for this Online Event.
      Returns:
      a Collection of email addresses
      See Also:
    • getEquipmentTypes

      public Collection<String> getEquipmentTypes()
      Returns the available equipment types for this Online Event.
      Returns:
      a Collection of equipment names
      See Also:
    • getSignups

      public Collection<Signup> getSignups()
      Returns the signups for this Online Event.
      Returns:
      a Collection of Signup beans
      See Also:
    • 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
    • getDispatchRoutes

      public Collection<DispatchRoute> getDispatchRoutes()
      Returns the Dispatch Routes for this Online Event.
      Returns:
      a Collection of DispatchRoute beans
      See Also:
    • getRoutes

      public Collection<Route> getRoutes()
      Returns the Routes for this Online Event.
      Returns:
      a Collection of Route beans
      See Also:
    • getRoute

      public Route getRoute(int routeID)
      Retrieves a specifc route for this Online Event.
      Parameters:
      routeID - the Route ID
      Returns:
      a Route bean, or null if not found
    • getActiveRoutes

      public Collection<Route> getActiveRoutes()
      Returns the active Routes for this Online Event.
      Returns:
      a Collection of Route beans
      See Also:
    • getAirports

      public Collection<Airport> getAirports()
      Returns the Airports available for this Online Event, from the available Routes.
      Returns:
      a Collection of Airport beans
      See Also:
    • getFeaturedAirports

      public Collection<Airport> getFeaturedAirports()
      Returns any featured Airports for this Online Event.
      Returns:
      a Collection of Airport beans
      See Also:
    • getSignup

      public Signup getSignup(int pilotID)
      Returns a Signup for a particular Pilot.
      Parameters:
      pilotID - the pilot's database ID
      Returns:
      a Signup bean, or null if not found
      See Also:
    • getAssignments

      public Collection<AssignmentInfo> getAssignments()
      Returns all Flight Assignments for this Online Event.
      Returns:
      a Collection of AssignmentInfo beans
      See Also:
    • isSignedUp

      public boolean isSignedUp(int pilotID)
      Returns whether a Pilot is signed up for this Online Event.
      Parameters:
      pilotID - the Pilot's database ID
      Returns:
      TRUE if the Pilot has signed up, otherwise FALSE
      See Also:
    • isDestination

      public boolean isDestination(Airport a)
      Returns if an Airport is a destination of any of the Routes.
      Parameters:
      a - the Airport bean
      Returns:
      TRUE if a destination for any Route, otherwise FALSE
      See Also:
    • isOrigin

      public boolean isOrigin(Airport a)
      Returns if an Airport is an origin of any of the Routes.
      Parameters:
      a - the Airport bean
      Returns:
      TRUE if an origin for any Route, otherwise FALSE
      Throws:
      NullPointerException - if a is null
      See Also:
    • setBriefing

      public void setBriefing(Briefing b)
      Updates the briefing for this Online Event.
      Parameters:
      b - the Briefing bean
      See Also:
    • setName

      public void setName(String name)
      Updates the Online Event name.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
      See Also:
    • addEquipmentType

      public void addEquipmentType(String eqType)
      Adds an available equipment type for this event.
      Parameters:
      eqType - the equipment code
      See Also:
    • setStartTime

      public void setStartTime(Instant dt)
      Updates this start time of this Online Event. If no signup deadline is currently set, it will default to one hour before the start time.
      Parameters:
      dt - the start date/time
      See Also:
    • setEndTime

      public void setEndTime(Instant dt)
      Updates the end time for this Online Event.
      Parameters:
      dt - the end date/time
      Throws:
      IllegalArgumentException - if dt is before the start time
      NullPointerException - if the start time is null
      See Also:
    • setSignupDeadline

      public void setSignupDeadline(Instant dt)
      Updates the signup deadline for this Online Event.
      Parameters:
      dt - the signup deadline date/time
      Throws:
      IllegalArgumentException - if dt is before the start time
      NullPointerException - if the start time is null
      See Also:
    • setNetwork

      public void setNetwork(OnlineNetwork net)
      Updates the Network used for this Online Event.
      Parameters:
      net - the network
      Throws:
      IllegalArgumentException - if id is negative or invalid
      See Also:
    • setStatus

      public void setStatus(Status status)
      Updates the status of this Online Event.
      Parameters:
      status - the Status, if not CANCELED then OPEN
      See Also:
    • setCanSignup

      public void setCanSignup(boolean doSignup)
      Updates the signup available flag for this Online Event.
      Parameters:
      doSignup - TRUE if signups are enabled, otherwise FALSE
      See Also:
    • setSignupURL

      public void setSignupURL(String url)
      Updates the external URL used to sign up for this Online Event.
      Parameters:
      url - the signup URL
      See Also:
    • setOwner

      public void setOwner(AirlineInformation ai)
      Sets the Airline that owns this Online Event.
      Parameters:
      ai - the owning Airline's AirlineInformation bean
      See Also:
    • addAirline

      public void addAirline(AirlineInformation ai)
      Adds a participatig Airline to this Online Event.
      Parameters:
      ai - the participating airline's AirlineInformation bean
      See Also:
    • addSignup

      public void addSignup(Signup s)
      Adds a Signup to this Online Event.
      Parameters:
      s - a Signup bean
      See Also:
    • addRoute

      public void addRoute(Route r)
      Adds a Flight Route to this Online Event.
      Parameters:
      r - a Route bean
      See Also:
    • addRoute

      public void addRoute(DispatchRoute dr)
      Adds a Dispatch Route to this Online Event.
      Parameters:
      dr - a DispatchRoute bean
      See Also:
    • addAssignment

      public void addAssignment(AssignmentInfo ai)
      Adds a Flight Assignment to this Online Event.
      Parameters:
      ai - an AssignmentInfo bean
      See Also:
    • addChart

      public void addChart(Chart c)
      Adds an available Chart to this Online Event.
      Parameters:
      c - the Chart bean
      See Also:
    • addCharts

      public void addCharts(Collection<Chart> charts)
      Adds a number of Charts to this Online Event.
      Parameters:
      charts - a Collection of Chart beans
      See Also:
    • addFeedback

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

      public void addContactAddr(String addr)
      Adds a contact address to this Online Event.
      Parameters:
      addr - the e-mail address
      See Also:
    • addFeaturedAirport

      public void addFeaturedAirport(Airport a)
      Adds a featured Airport to this Online Event.
      Parameters:
      a - an Airport
      See Also:
    • compareTo

      public int compareTo(Object o2)
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class DatabaseBean