Class Application

java.lang.Object
org.heigit.ohsome.ohsomeapi.Application
All Implemented Interfaces:
org.springframework.boot.ApplicationRunner

@SpringBootApplication @ComponentScan("org.heigit.ohsome.ohsomeapi") public class Application extends Object implements org.springframework.boot.ApplicationRunner
Main class, which is used to run this Spring boot application. Establishes a connection to the database on startup in the run() method using parameters provided via the console.
  • Field Details

    • API_VERSION

      public static final String API_VERSION
    • DEFAULT_TIMEOUT_IN_MILLISECONDS

      public static final int DEFAULT_TIMEOUT_IN_MILLISECONDS
      See Also:
    • DEFAULT_NUMBER_OF_CLUSTER_NODES

      public static final int DEFAULT_NUMBER_OF_CLUSTER_NODES
      See Also:
    • DEFAULT_NUMBER_OF_DATA_EXTRACTION_THREADS

      public static final int DEFAULT_NUMBER_OF_DATA_EXTRACTION_THREADS
      See Also:
  • Constructor Details

    • Application

      public Application()
  • Method Details

    • getApplicationContext

      public static org.springframework.context.ApplicationContext getApplicationContext()
    • main

      public static void main(String[] args)
      Main method to run this SpringBootApplication.
      Throws:
      RuntimeException - if database and keytables are not defined in the '-DdbFilePathProperty=' parameter of 'mvn test'.
    • preRun

      public static void preRun(org.springframework.boot.ApplicationArguments args) throws ClassNotFoundException, SQLException, org.heigit.ohsome.oshdb.util.exceptions.OSHDBKeytablesNotFoundException, IOException
      Reads and sets the given application arguments and makes a connection to the OSHDB.
      Parameters:
      args - Application arguments given over the commandline on startup
      Throws:
      RuntimeException - if a class with a specific name could not be found, or if the database parameter is not defined
      DatabaseAccessException - if the access to keytables or database is not possible
      SQLException - thrown by #OSHDBH2(String) OSHDBH2
      ClassNotFoundException - thrown by #OSHDBH2(String) OSHDBH2
      org.heigit.ohsome.oshdb.util.exceptions.OSHDBKeytablesNotFoundException - thrown by #TagTranslator(java.sql.Connection) TagTranslator
      IOException - thrown by #extractOSHDBMetadata() extractOSHDBMetadata
    • run

      public void run(org.springframework.boot.ApplicationArguments args)
      Specified by:
      run in interface org.springframework.boot.ApplicationRunner