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 the
run()
method using parameters
provided via the console.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.context.ApplicationContext
static void
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 Details
-
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
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 definedDatabaseAccessException
- if the access to keytables or database is not possibleSQLException
- 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 interfaceorg.springframework.boot.ApplicationRunner
-