Package org.heigit.ohsome.ohsomeapi
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 therun()
method using parameters provided via the console.
-
-
Field Summary
Fields Modifier and Type Field Description static String
API_VERSION
static int
DEFAULT_NUMBER_OF_CLUSTER_NODES
static int
DEFAULT_NUMBER_OF_DATA_EXTRACTION_THREADS
static int
DEFAULT_TIMEOUT_IN_MILLISECONDS
-
Constructor Summary
Constructors Constructor Description Application()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.springframework.context.ApplicationContext
getApplicationContext()
static void
main(String[] args)
Main method to run this SpringBootApplication.static void
preRun(org.springframework.boot.ApplicationArguments args)
Reads and sets the given application arguments and makes a connection to the OSHDB.void
run(org.springframework.boot.ApplicationArguments args)
-
-
-
Field Detail
-
API_VERSION
public static final String API_VERSION
-
DEFAULT_TIMEOUT_IN_MILLISECONDS
public static final int DEFAULT_TIMEOUT_IN_MILLISECONDS
- See Also:
- Constant Field Values
-
DEFAULT_NUMBER_OF_CLUSTER_NODES
public static final int DEFAULT_NUMBER_OF_CLUSTER_NODES
- See Also:
- Constant Field Values
-
DEFAULT_NUMBER_OF_DATA_EXTRACTION_THREADS
public static final int DEFAULT_NUMBER_OF_DATA_EXTRACTION_THREADS
- See Also:
- Constant Field Values
-
-
Method Detail
-
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.bigspatialdata.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 definedDatabaseAccessException
- if the access to keytables or database is not possibleSQLException
- thrown byOSHDBH2
ClassNotFoundException
- thrown byOSHDBH2
org.heigit.bigspatialdata.oshdb.util.exceptions.OSHDBKeytablesNotFoundException
- thrown byTagTranslator
IOException
- thrown byextractOSHDBMetadata
-
run
public void run(org.springframework.boot.ApplicationArguments args)
- Specified by:
run
in interfaceorg.springframework.boot.ApplicationRunner
-
-