Class ConnectionEntry
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.acars.ACARSLogEntry
org.deltava.beans.acars.ConnectionEntry
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,ClientVersion
,AuthoredBean
,CalendarEntry
,IDBean
,RemoteAddressBean
,TimeSpan
,Cacheable
- Direct Known Subclasses:
DispatchConnectionEntry
A bean to store an ACARS Connection record.
- Since:
- 1.0
- Version:
- 11.2
- Author:
- Luke
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Compares two connections by comparing their date/times.int
Returns the Author of this bean.boolean
Returns whether data compression is enabled.long
Returns this connection's ID.getDate()
Returns this entry's date for ordering in the Calendar.boolean
Returns if this is a Dispatch connection.Returns the end date/time of this connection.Returns the flight information for the flight.Returns the flight phase.int
Returns the number of text messages sent by this connection.int
Returns the database ID of the user who made this connection.Returns the start date/time of this connection.Returns control statistics.long
getTime()
Returns the length of the connection.Returns voice statistics.getUser()
Returns the Pilot bean for the connection's authenticated user.Returns the UserData bean for the connection's authenticated user.boolean
Returns if this is a Hidden connection.boolean
getVoice()
Returns whether voice is enabled.void
setAuthorID
(int id) Updates the Database ID of the user who created this connection.void
setCompressed
(boolean isCompressed) Marks this connection as compressed.void
setConnectionID
(long id) Updates the ACARS connection ID.void
setEndTime
(Instant dt) Returns the date/time the connection was ended.void
setFlightInfo
(FlightInfo info) Sets the flight information for this connection.void
setFlightPhase
(FlightPhase phase) Sets the flight phasevoid
setMessageCount
(int msgs) Updates the number of text messages sent by this connection.void
setStartTime
(Instant dt) Returns the date/time the connection was started.void
setStatistics
(ConnectionStats tcp, ConnectionStats udp) Updates connection statistics.void
Updates the Pilot bean for the user who created this connection.void
setUserData
(UserData ud) Updates the UserData record for the user who created this connection.void
setUserHidden
(boolean isHidden) Marks this connection as a Hidden connection.void
setVoice
(boolean isVoice) Marks this connection as voice-enabled.Methods inherited from class org.deltava.beans.acars.ACARSLogEntry
getAddressInfo, getBeta, getClientBuild, getClientType, getRemoteAddr, getRemoteHost, getVersion, setAddressInfo, setBeta, setClientBuild, setRemoteAddr, setRemoteHost, setVersion
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateID
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.deltava.beans.acars.ClientVersion
isBeta
Methods inherited from interface org.deltava.beans.RemoteAddressBean
getIsResolved
Methods inherited from interface org.deltava.beans.TimeSpan
getDuration, hasTimes
-
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
Returns the start date/time of this connection.- Specified by:
getStartTime
in interfaceTimeSpan
- Specified by:
getStartTime
in classACARSLogEntry
- Returns:
- the date/time
- See Also:
-
getEndTime
Returns the end date/time of this connection.- Specified by:
getEndTime
in interfaceTimeSpan
- 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
Description copied from interface:CalendarEntry
Returns this entry's date for ordering in the Calendar.- Specified by:
getDate
in interfaceCalendarEntry
- 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 interfaceAuthoredBean
- Returns:
- the author's database ID
- See Also:
-
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
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
Returns the flight information for the flight.- Returns:
- a FlightInformation bean
-
getFlightPhase
-
getTCPStatistics
Returns control statistics.- Returns:
- a ConnectionStats bean
-
getUDPStatistics
-
getMessageCount
public int getMessageCount()Returns the number of text messages sent by this connection.- Returns:
- the number of messages
- See Also:
-
setStatistics
Updates connection statistics.- Parameters:
tcp
- TCP statisticsudp
- 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
Returns the date/time the connection was started.- Parameters:
dt
- the date/time- See Also:
-
setEndTime
Returns the date/time the connection was ended.- Parameters:
dt
- the date/time- See Also:
-
setFlightInfo
Sets the flight information for this connection.- Parameters:
info
- the flight information- See Also:
-
setFlightPhase
Sets the flight phase- Parameters:
phase
- the FlightPhase- See Also:
-
setUser
Updates the Pilot bean for the user who created this connection.- Parameters:
usr
- the Pilot bean- See Also:
-
setUserData
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 interfaceAuthoredBean
- Parameters:
id
- the database ID- Throws:
IllegalStateException
- if setUser() has already been calledIllegalArgumentException
- if id is zero or negative- See Also:
-
compareTo
Compares two connections by comparing their date/times.- Specified by:
compareTo
in interfaceComparable<Object>
- Overrides:
compareTo
in classDatabaseBean
-