Class NetworkInfo

java.lang.Object
org.deltava.beans.servinfo.NetworkInfo
All Implemented Interfaces:
Serializable, Cacheable

public class NetworkInfo extends Object implements Cacheable
A bean to store aggregated network information.
Since:
1.0
Version:
10.0
Author:
Luke
See Also:
  • Constructor Details

    • NetworkInfo

      public NetworkInfo(OnlineNetwork net)
      Initializes this bean for a particular network.
      Parameters:
      net - the network
      See Also:
  • Method Details

    • getVersion

      public int getVersion()
      Returns the ServInfo data format version.
      Returns:
      the data format version, usually 7 for legacy ServInfo
      See Also:
    • getNetwork

      public OnlineNetwork getNetwork()
      Returns the network.
      Returns:
      the network
    • getValidDate

      public Instant getValidDate()
      Returns the effective date of this data.
      Returns:
      the date/time the data was generated
      See Also:
    • getControllers

      public Collection<Controller> getControllers()
      Returns the active Controllers on this network.
      Returns:
      a Collection of Controller beans
      See Also:
    • getServers

      public Collection<Server> getServers()
      Returns the FSD servers on this network.
      Returns:
      a Collection of Server beans
    • getControllers

      public Collection<Controller> getControllers(GeoLocation gl)
      Returns all Controllers within a specific distance of a particular point.
      Parameters:
      gl - the location
      Returns:
      a Collection of Controller beans
      See Also:
    • hasPilotIDs

      public boolean hasPilotIDs()
      Returns whether the internal database IDs for Pilots and Controllers have been loaded.
      Returns:
      TRUE if loaded, otherwise FALSE
      See Also:
    • getPilots

      public Collection<Pilot> getPilots()
      Returns the active Pilots on this network.
      Returns:
      a Collection of Pilot beans
      See Also:
    • get

      public NetworkUser get(int networkID)
      Returns the entry for a particular network user, if online.
      Parameters:
      networkID - the user's network ID
      Returns:
      a NetworkUser bean, or null if not found
    • setPilotIDs

      public void setPilotIDs(Map<String,Integer> idMap)
      Assigns Pilot IDs to online Pilots and Controllers that have user accounts.
      Parameters:
      idMap - a Map of Integers, keyed by network ID with the database ID as the value.
    • setVersion

      public void setVersion(int version)
      Updates the ServInfo data format revision.
      Parameters:
      version - the data format, typically 7
      See Also:
    • setValidDate

      public void setValidDate(Instant d)
      Updates the validity date of this data.
      Parameters:
      d - the date/time this data was generated
      See Also:
    • add

      public void add(Controller c)
      Adds a Controller entry to the data.
      Parameters:
      c - the Controller bean
      See Also:
    • add

      public void add(Pilot p)
      Adds a Pilot entry to the data.
      Parameters:
      p - the Pilot bean
      See Also:
    • add

      public void add(Server srv)
      Adds a server entry to the data.
      Parameters:
      srv - the Server bean
      See Also:
    • getPilot

      public Pilot getPilot(String callsign)
      Returns a specific online Pilot entry.
      Parameters:
      callsign - the callsign
      Returns:
      a Pilot bean, or null if the callsign was not found
      See Also:
    • getController

      public Controller getController(String callsign)
      Returns a specific online Controller entry.
      Parameters:
      callsign - the callsign
      Returns:
      a Controller bean, or null if the callsign was not found
      See Also:
    • getControllerByFrequency

      public Controller getControllerByFrequency(String freq, GeoLocation loc)
      Returns a controller by Frequency.
      Parameters:
      freq - the frequency
      loc - the location to sort, if multiple results found
      Returns:
      a Controller bean, or null if the frequency was not found
    • merge

      public void merge(Collection<RadioPosition> positions)
      Merges a Collection of radio positions to determine controller locations.
      Parameters:
      positions - a Collection of RadioPosition beans
    • clone

      public NetworkInfo clone()
      Overrides:
      clone in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • cacheKey

      public Object cacheKey()
      Description copied from interface: Cacheable
      Returns the cache key for this object. Caches call this method when adding the object.
      Specified by:
      cacheKey in interface Cacheable
      Returns:
      the cache key for the object