Class ConnectedUser
java.lang.Object
org.deltava.beans.servinfo.NetworkUser
org.deltava.beans.servinfo.ConnectedUser
- All Implemented Interfaces:
Serializable, Comparable<NetworkUser>, GeoLocation, MapEntry, MarkerMapEntry, ViewEntry
- Direct Known Subclasses:
Controller, Pilot
A bean to store information about users connected to an FSD server.
- Since:
- 3.4
- Version:
- 10.3
- Author:
- Luke
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class NetworkUser
NetworkUser.Type -
Field Summary
FieldsFields inherited from interface GeoLocation
ALL, DEGREE_FEET, DEGREE_MILES, FEET_MILES, LAT_DIRECTIONS, LATITUDE, LON_DIRECTIONS, LONGITUDE, RADIAN_MILESModifier and TypeFieldDescriptionstatic final intFormat the Longitude and Latitude.static final doubleSize of a degree in feet.static final doubleSize of a degree in miles.static final intSize of a mile in feet.static final String[]Latitude directions.static final intFormat the Latitude only.static final String[]Longitude directions.static final intFormat the Longitude only.static final intRadius of the Earth in miles.Fields inherited from interface MapEntry
BLUE, BROWN, COLORS, GREEN, GREY, ORANGE, PURPLE, RED, WHITE, YELLOWModifier and TypeFieldDescriptionstatic final StringBlue Google Maps icon, displayed as $static/img/maps/point_blue.pngstatic final StringBrown Google Maps icon, displayed as $static/img/maps/point_brown.pngstatic final String[]All Google Maps icon colors.static final StringGreen Google Maps icon, displayed as $static/img/maps/point_green.pngstatic final StringGrey Google Maps icon, displayed as $static/img/maps/point_grey.pngstatic final StringOrange Google Maps icon, displayed as $static/img/maps/point_orange.pngstatic final StringPurple Google Maps icon, displayed as $static/img/maps/point_purple.pngstatic final StringRed Google Maps icon, displayed as $static/img/maps/point_red.pngstatic final StringWhite Google Maps icon, displayed as $static/img/maps/point_white.pngstatic final StringYellow Google Maps icon, displayed as $static/img/maps/point_yellow.png -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the user's callsign.final doubleReturns the latitude of this location.Returns the date/time of the user's connection.final doubleReturns the longitude of this location.Returns the User's current position.Returns the FSD Server this user is connected to.booleanReturns if the User has a location set.voidsetCallsign(String cs) Updates the user's callsign.voidsetLoginTime(Instant dt) Updates the date/time of the user's last connection.voidsetPosition(double lat, double lon) Updates the User's position.voidUpdates the FSD Server this user is connected to.Methods inherited from class NetworkUser
compareTo, equals, getFirstName, getID, getLastName, getName, getNetwork, getPilotID, getRating, getRowClassName, getType, hashCode, setFirstName, setLastName, setName, setPilotID, setRating, toStringModifier and TypeMethodDescriptionintcompareTo(NetworkUser usr2) booleanReturns the user's first name.intgetID()Returns the user's network ID.Returns the user's last name.getName()Returns the user's full name.Returns the Online Network for this user.intReturns the Database ID of this network user.Returns the Controller's rating.Returns the CSS class for this object if rendered in a view table.abstract NetworkUser.TypegetType()Returns the user type.inthashCode()voidsetFirstName(String fName) Updates the user's first name.voidsetLastName(String lName) Updates the user's last name.voidUpdates the network user's name, stripping off the home airport.voidsetPilotID(int id) Updates the database ID of this User.voidSets the Users's rating.toString()Methods inherited from interface GeoLocation
distanceFeet, distanceToModifier and TypeMethodDescriptiondefault intCalculates the distance between two points in feet.default intCalculates the distance between two GeoLocations.Methods inherited from interface MapEntry
getInfoBoxModifier and TypeMethodDescriptionReturns the text to display in this marker's infobox if displayed in a Google Map.Methods inherited from interface MarkerMapEntry
getIconColorModifier and TypeMethodDescriptionReturns the icon color for this entry if displayed in a Google Map.
-
Field Details
-
_position
The user's position, or null if not set.
-
-
Constructor Details
-
ConnectedUser
Initializes the user.- Parameters:
id- the network IDnet- the OnlineNetwork
-
-
Method Details
-
getCallsign
-
getLatitude
public final double getLatitude()Description copied from interface:GeoLocationReturns the latitude of this location.- Specified by:
getLatitudein interfaceGeoLocation- Returns:
- the latitude in degrees
-
getLongitude
public final double getLongitude()Description copied from interface:GeoLocationReturns the longitude of this location.- Specified by:
getLongitudein interfaceGeoLocation- Returns:
- the longitude in degrees
-
hasLocation
public boolean hasLocation()Returns if the User has a location set.- Returns:
- TRUE if a location has been set, otherwise FALSE
-
getLoginTime
Returns the date/time of the user's connection.- Returns:
- the login date/time
-
getPosition
Returns the User's current position.- Returns:
- a GeoPosition bean containing latitude and longitude
- See Also:
-
getServer
Returns the FSD Server this user is connected to.- Returns:
- the server name
- See Also:
-
setPosition
public void setPosition(double lat, double lon) Updates the User's position. This has a ServInfo hack where latitudes of -290 to -350 are mapped to latitudes in the Northern Hemisphere.- Parameters:
lat- the latitude in degreeslon- the longitude in degrees- See Also:
-
setLoginTime
Updates the date/time of the user's last connection.- Parameters:
dt- the connection date/time
-
setCallsign
Updates the user's callsign.- Parameters:
cs- the callsign- Throws:
NullPointerException- if cs is null- See Also:
-
setServer
Updates the FSD Server this user is connected to.- Parameters:
srv- the server name- Throws:
NullPointerException- if srv is null- See Also:
-