Package org.n52.iceland.ds
Interface Datasource
- All Superinterfaces:
Serializable
- Since:
- 1.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SettingDefinitionGroupstatic final SettingDefinitionGroup -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIfSchemaExists(Map<String, Object> settings) Check if the schema exists.booleancheckIfSchemaExists(Properties current, Map<String, Object> newSettings) Check if the schema exists.voidcheckPostCreation(Properties properties) booleancheckSchemaCreation(Map<String, Object> settings) Check if it is possible to create the schema (e.g.voidclear(Properties settings) Clear the contents of the datasource.String[]createSchema(Map<String, Object> settings) Create the schema for the supplied settings.String[]dropSchema(Map<String, Object> settings) Drop the present schema (or parts of it).voidvoidexecutePostCreateSchema(Map<String, Object> databaseSettings) Set<SettingDefinition<?>> getChangableSettingDefinitions(Properties current) getDatasourceProperties(Map<String, Object> settings) Create the datasource properties used by theConnectionProviderto connect.getDatasourceProperties(Properties current, Map<String, Object> newSettings) Create the datasource properties used by theConnectionProviderto connect.Set<SettingDefinition<?>> booleanbooleanparseDatasourceProperties(Properties current) Parse datasource properties to mapvoidCalled right before a schema is created.booleanString[]updateSchema(Map<String, Object> settings) Creates an update schema for the supplied settings.voidvalidateConnection(Map<String, Object> settings) Check if a connection is possible.voidvalidateConnection(Properties current, Map<String, Object> newSettings) Check if a connection is still possible with the newSettings settings.voidvalidatePrerequisites(Map<String, Object> settings) Validate if all prerequisites (e.g.voidvalidatePrerequisites(Properties current, Map<String, Object> newSettings) Used to validate prerequisites after the connections settings newSettings in the admin interface.voidvalidateSchema(Map<String, Object> settings) Validate the existing schema.voidvalidateSchema(Properties current, Map<String, Object> newSettings) Validate the existing schema.
-
Field Details
-
BASE_GROUP
-
ADVANCED_GROUP
-
-
Method Details
-
getDialectName
String getDialectName()- Returns:
- the representive name of this dialect
-
getSettingDefinitions
Set<SettingDefinition<?>> getSettingDefinitions()- Returns:
- the settings needed to connect
-
getChangableSettingDefinitions
- Parameters:
current- the current settings- Returns:
- the settings that can be newSettings without schema without reinstallation
-
parseDatasourceProperties
Parse datasource properties to map- Parameters:
current- Current datasource properties- Returns:
- Map with String key and Object value
-
validateConnection
Check if a connection is possible.- Parameters:
settings- the settings to connect
-
validateConnection
Check if a connection is still possible with the newSettings settings.- Parameters:
current- the current datasource settingsnewSettings- the newSettings settings
-
validatePrerequisites
Validate if all prerequisites (e.g. datasource version) are met. Will only be called ifvalidateConnection()succeeded.- Parameters:
settings- the settings to connect
-
validatePrerequisites
Used to validate prerequisites after the connections settings newSettings in the admin interface.- Parameters:
current- the current datasource settingsnewSettings- the newSettings settings
-
needsSchema
boolean needsSchema()- Returns:
- if this datasource needs some kind of schema
-
validateSchema
Validate the existing schema. Will only be called ifneedsSchema()andcheckIfSchemaExists()returntrue.- Parameters:
settings- the settings to connect
-
validateSchema
Validate the existing schema. Will only be called ifneedsSchema()andcheckIfSchemaExists()returntrue.- Parameters:
current- the current datasource settingsnewSettings- the newSettings settings
-
checkIfSchemaExists
Check if the schema exists. Should returntrueeven if parts are missing. Will only be called ifneedsSchema()returnstrue.- Parameters:
settings- the settings to connect- Returns:
- if the schema (or parts of it) exists
-
checkIfSchemaExists
Check if the schema exists. Should returntrueeven if parts are missing. Will only be called ifneedsSchema()returnstrue.- Parameters:
current- the current datasource settingsnewSettings- the newSettings settings- Returns:
- if the schema (or parts of it) exists
-
checkSchemaCreation
Check if it is possible to create the schema (e.g. test if the privilege are sufficient). Will only be called ifneedsSchema()returnstrue.- Parameters:
settings- the settings to connect- Returns:
- if the creation if the schema is possible
-
createSchema
Create the schema for the supplied settings. Will only be called ifneedsSchema()andcheckSchemaCreation()returntrue. IfcheckIfSchemaExists()returnedtrue,dropSchema()will be called first.- Parameters:
settings- the settings to connect- Returns:
- an array of DDL statements
-
dropSchema
Drop the present schema (or parts of it). Will only be called ifneedsSchema()andcheckIfSchemaExists()returntrue.- Parameters:
settings- the settings to connect- Returns:
- an array of DDL statements
-
updateSchema
Creates an update schema for the supplied settings. Will only be called ifneedsSchema()andcheckSchemaCreation()returntrue. IfcheckIfSchemaExists()returnedtrue,dropSchema()will be called first.- Parameters:
settings- the settings to connect- Returns:
- an array of DDL statements
-
execute
-
clear
Clear the contents of the datasource. Only called ifsupportsClear()returnstrue.- Parameters:
settings- the settings to connect
-
supportsClear
boolean supportsClear()- Returns:
true
-
getDatasourceProperties
Create the datasource properties used by theConnectionProviderto connect.- Parameters:
settings- the settings to connect- Returns:
- the datasource properties
-
getDatasourceProperties
Create the datasource properties used by theConnectionProviderto connect.- Parameters:
current- the current datasource settingsnewSettings- the newSettings settings- Returns:
- the new datasource properties
-
getCallback
DatasourceCallback getCallback()- Returns:
- the callback used at instantiation time of the connection provider
-
prepare
Called right before a schema is created.- Parameters:
settings- the settings to connect
-
isPostCreateSchema
boolean isPostCreateSchema() -
executePostCreateSchema
-
checkPostCreation
-
getSpringProfiles
-