Class SystemData

java.lang.Object
org.deltava.util.system.SystemData
All Implemented Interfaces:
Serializable

public final class SystemData extends Object implements Serializable
A singleton object containing all of the configuration data for the application. This object is internally synchronized to allow thread-safe read and write access to the configuration data.
Since:
1.0
Version:
11.3
Author:
Luke
See Also:
  • Field Details

  • Method Details

    • init

      public static void init(String loaderClassName, boolean clearData)
      Initializes SystemData object.
      Parameters:
      loaderClassName - the data loader class name
      clearData - TRUE if existing data should be cleared, otherwise FALSE
    • init

      public static void init()
      Initializes the System data with the default loader.
      See Also:
    • has

      public static boolean has(String propertyName)
      Returns whether a particular property exists.
      Parameters:
      propertyName - the property name
      Returns:
      TRUE if the property exists, otherwise FALSE
    • getObject

      public static Object getObject(String propertyName)
      Returns a property value.
      Parameters:
      propertyName - the property name
      Returns:
      the property
    • getBoolean

      public static boolean getBoolean(String propertyName)
      Returns a boolean property value.
      Parameters:
      propertyName - the property name
      Returns:
      TRUE if the object is a boolean value and TRUE, otherwise FALSE
    • getInt

      public static int getInt(String propertyName, int defValue)
      Returns an integer property value.
      Parameters:
      propertyName - the property name
      defValue - the default value
      Returns:
      the property value, or the default if not an integer
    • getInt

      public static int getInt(String propertyName)
      Returns an integer property value.
      Parameters:
      propertyName - the property name
      Returns:
      the property value, or 0 if not an integer
    • getLong

      public static long getLong(String propertyName, long defValue)
      Returns a long integer property value.
      Parameters:
      propertyName - the property name
      defValue - the default value
      Returns:
      the property value, or defValue if not a long
    • getDouble

      public static double getDouble(String propertyName, double defValue)
      Returns a floating point property value.
      Parameters:
      propertyName - the property name
      defValue - the default value
      Returns:
      the property value, or defValue if not a double
    • get

      public static String get(String propertyName)
      Returns a property value.
      Parameters:
      propertyName - the property name
      Returns:
      the property value, or null if not found
    • add

      public static void add(String pName, Object value)
      Adds a property.
      Parameters:
      pName - the property name
      value - the property value
    • getAirport

      public static Airport getAirport(String airportCode)
      Returns an Airport object.
      Parameters:
      airportCode - the Airport code (IATA or ICAO)
      Returns:
      the Airport bean, or null if not found
      Throws:
      IllegalStateException - if the "airports" property has not been added
      See Also:
    • getAirports

      public static Map<String,Airport> getAirports()
      Returns all Airports.
      Returns:
      a Map of Airports, indexed by ICAO/IATA code.
      See Also:
    • getAirline

      public static Airline getAirline(String airlineCode)
      Returns an Airline object.
      Parameters:
      airlineCode - the Airline code
      Returns:
      the Airline bean, or null if not found
      Throws:
      IllegalStateException - if the "airlines" property has not been added
    • getAirlines

      public static Collection<Airline> getAirlines()
      Returns all airlines for the current web application.
      Returns:
      a Collection of Airline beans
    • getApp

      public static AirlineInformation getApp(String airlineCode)
      Returns an Airline Information object, which is data about other virtual airlines on this server.
      Parameters:
      airlineCode - the airline code, or null if the current airline
      Returns:
      the AirlineInformation bean, or null if not found
      Throws:
      IllegalStateException - if the "apps" property has not been added
    • getApps

      public static Collection<AirlineInformation> getApps()
      Returns information about all virtual airlines on this server. The current virtual airline will be the first member of this collection.
      Returns:
      a Collection of AirlineInformation beans
    • getJDBCPool

      public static org.gvagroup.pool.ConnectionPool<Connection> getJDBCPool()
    • getJedisPool

      public static org.gvagroup.pool.JedisPool getJedisPool()