Class ConnectionEntry

All Implemented Interfaces:
Serializable, Comparable<Object>, ClientVersion, AuthoredBean, CalendarEntry, IDBean, RemoteAddressBean, TimeSpan, Cacheable
Direct Known Subclasses:
DispatchConnectionEntry

public class ConnectionEntry extends ACARSLogEntry implements TimeSpan
A bean to store an ACARS Connection record.
Since:
1.0
Version:
11.2
Author:
Luke
See Also:
  • Constructor Details

    • ConnectionEntry

      public ConnectionEntry(long id)
      Creates a new ACARS Connection entry.
      Parameters:
      id - the connection id
      Throws:
      IllegalArgumentException - if id is zero or negative
  • Method Details

    • getStartTime

      public Instant getStartTime()
      Returns the start date/time of this connection.
      Specified by:
      getStartTime in interface TimeSpan
      Specified by:
      getStartTime in class ACARSLogEntry
      Returns:
      the date/time
      See Also:
    • getEndTime

      public Instant getEndTime()
      Returns the end date/time of this connection.
      Specified by:
      getEndTime in interface TimeSpan
      Returns:
      the date/time
      See Also:
    • getTime

      public long getTime()
      Returns the length of the connection.
      Returns:
      the length of the connection in seconds, or -1 if endTime is null
    • 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
    • getConnectionID

      public long getConnectionID()
      Returns this connection's ID.
      Returns:
      the connection ID
      See Also:
    • getPilotID

      public int getPilotID()
      Returns the database ID of the user who made this connection. This may be set to 0 if the user was never authenticated. If a Pilot bean has been passed in, this will return the Database ID of that bean.
      Returns:
      the database ID
      See Also:
    • getAuthorID

      public int getAuthorID()
      Description copied from interface: AuthoredBean
      Returns the Author of this bean.
      Specified by:
      getAuthorID in interface AuthoredBean
      Returns:
      the author's database ID
      See Also:
    • getUser

      public Pilot getUser()
      Returns the Pilot bean for the connection's authenticated user. This may not be set.
      Returns:
      the Pilot who made this connection
      See Also:
    • getUserData

      public UserData getUserData()
      Returns the UserData bean for the connection's authenticated user. This may not be set.
      Returns:
      the UserData object
      See Also:
    • getDispatch

      public boolean getDispatch()
      Returns if this is a Dispatch connection.
      Returns:
      FALSE
    • getUserHidden

      public boolean getUserHidden()
      Returns if this is a Hidden connection.
      Returns:
      TRUE if this is a Hidden connection, otherwise FALSE
      See Also:
    • getVoice

      public boolean getVoice()
      Returns whether voice is enabled.
      Returns:
      TRUE if voice enabled, otherwise FALSE
      See Also:
    • getCompressed

      public boolean getCompressed()
      Returns whether data compression is enabled.
      Returns:
      TRUE if data compression enabled, otherwise FALSE
      See Also:
    • getFlightInfo

      public FlightInfo getFlightInfo()
      Returns the flight information for the flight.
      Returns:
      a FlightInformation bean
    • getFlightPhase

      public FlightPhase getFlightPhase()
      Returns the flight phase.
      Returns:
      the FlightPhase
      See Also:
    • getTCPStatistics

      public ConnectionStats getTCPStatistics()
      Returns control statistics.
      Returns:
      a ConnectionStats bean
    • getUDPStatistics

      public ConnectionStats getUDPStatistics()
      Returns voice statistics.
      Returns:
      a ConnectionStats bean
    • getMessageCount

      public int getMessageCount()
      Returns the number of text messages sent by this connection.
      Returns:
      the number of messages
      See Also:
    • setStatistics

      public void setStatistics(ConnectionStats tcp, ConnectionStats udp)
      Updates connection statistics.
      Parameters:
      tcp - TCP statistics
      udp - UDP statistics
    • setConnectionID

      public void setConnectionID(long id)
      Updates the ACARS connection ID.
      Parameters:
      id - the connection ID
      Throws:
      IllegalArgumentException - if id is negative
      See Also:
    • setStartTime

      public void setStartTime(Instant dt)
      Returns the date/time the connection was started.
      Parameters:
      dt - the date/time
      See Also:
    • setEndTime

      public void setEndTime(Instant dt)
      Returns the date/time the connection was ended.
      Parameters:
      dt - the date/time
      See Also:
    • setFlightInfo

      public void setFlightInfo(FlightInfo info)
      Sets the flight information for this connection.
      Parameters:
      info - the flight information
      See Also:
    • setFlightPhase

      public void setFlightPhase(FlightPhase phase)
      Sets the flight phase
      Parameters:
      phase - the FlightPhase
      See Also:
    • setUser

      public void setUser(Pilot usr)
      Updates the Pilot bean for the user who created this connection.
      Parameters:
      usr - the Pilot bean
      See Also:
    • setUserData

      public void setUserData(UserData ud)
      Updates the UserData record for the user who created this connection.
      Parameters:
      ud - the UserData bean
      See Also:
    • setUserHidden

      public void setUserHidden(boolean isHidden)
      Marks this connection as a Hidden connection.
      Parameters:
      isHidden - TRUE if this is a hidden connection, otherwise FALSE
      See Also:
    • setVoice

      public void setVoice(boolean isVoice)
      Marks this connection as voice-enabled.
      Parameters:
      isVoice - TRUE if voice enabled, otherwise FALSE
      See Also:
    • setCompressed

      public void setCompressed(boolean isCompressed)
      Marks this connection as compressed.
      Parameters:
      isCompressed - TRUE if data compression enabled, otherwise FALSE
      See Also:
    • setMessageCount

      public void setMessageCount(int msgs)
      Updates the number of text messages sent by this connection.
      Parameters:
      msgs - the number of messages
      See Also:
    • setAuthorID

      public void setAuthorID(int id)
      Updates the Database ID of the user who created this connection.
      Specified by:
      setAuthorID in interface AuthoredBean
      Parameters:
      id - the database ID
      Throws:
      IllegalStateException - if setUser() has already been called
      IllegalArgumentException - if id is zero or negative
      See Also:
    • compareTo

      public int compareTo(Object o2)
      Compares two connections by comparing their date/times.
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class DatabaseBean