public interface Datasource extends ConnectionProviderIdentificator, DatasourceDaoIdentifier
Modifier and Type | Field and Description |
---|---|
static SettingDefinitionGroup |
ADVANCED_GROUP |
static SettingDefinitionGroup |
BASE_GROUP |
CONNECTION_PROVIDER_IDENTIFIER
DATASOURCE_DAO_IDENTIFIER, IDEPENDET_IDENTIFIER
Modifier and Type | Method and Description |
---|---|
boolean |
checkIfSchemaExists(Map<String,Object> settings)
Check if the schema exists.
|
boolean |
checkIfSchemaExists(Properties current,
Map<String,Object> newSettings)
Check if the schema exists.
|
void |
checkPostCreation(Properties properties) |
boolean |
checkSchemaCreation(Map<String,Object> settings)
Check if it is possible to create the schema (e.g. test if the privilege
are sufficient).
|
void |
clear(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).
|
void |
execute(String[] sql,
Map<String,Object> settings) |
void |
executePostCreateSchema(Map<String,Object> databaseSettings) |
DatasourceCallback |
getCallback() |
Set<SettingDefinition<?,?>> |
getChangableSettingDefinitions(Properties current) |
Properties |
getDatasourceProperties(Map<String,Object> settings)
Create the datasource properties used by the
ConnectionProvider
to connect. |
Properties |
getDatasourceProperties(Properties current,
Map<String,Object> newSettings)
Create the datasource properties used by the
ConnectionProvider
to connect. |
String |
getDialectName() |
Set<SettingDefinition<?,?>> |
getSettingDefinitions() |
boolean |
isPostCreateSchema() |
boolean |
needsSchema() |
void |
prepare(Map<String,Object> settings)
Called right before a schema is created.
|
boolean |
supportsClear() |
String[] |
updateSchema(Map<String,Object> settings)
Creates an update schema for the supplied settings.
|
void |
validateConnection(Map<String,Object> settings)
Check if a connection is possible.
|
void |
validateConnection(Properties current,
Map<String,Object> newSettings)
Check if a connection is still possible with the newSettings settings.
|
void |
validatePrerequisites(Map<String,Object> settings)
Validate if all prerequisites (e.g. datasource version) are met.
|
void |
validatePrerequisites(Properties current,
Map<String,Object> newSettings)
Used to validate prerequisites after the connections settings newSettings
in the admin interface.
|
void |
validateSchema(Map<String,Object> settings)
Validate the existing schema.
|
void |
validateSchema(Properties current,
Map<String,Object> newSettings)
Validate the existing schema.
|
getConnectionProviderIdentifier
getDatasourceDaoIdentifier
static final SettingDefinitionGroup BASE_GROUP
static final SettingDefinitionGroup ADVANCED_GROUP
String getDialectName()
Set<SettingDefinition<?,?>> getSettingDefinitions()
Set<SettingDefinition<?,?>> getChangableSettingDefinitions(Properties current)
current
- the current settingsvoid validateConnection(Map<String,Object> settings)
settings
- the settings to connectvoid validateConnection(Properties current, Map<String,Object> newSettings)
current
- the current datasource settingsnewSettings
- the newSettings settingsvoid validatePrerequisites(Map<String,Object> settings)
validateConnection()
succeeded.settings
- the settings to connectvoid validatePrerequisites(Properties current, Map<String,Object> newSettings)
current
- the current datasource settingsnewSettings
- the newSettings settingsboolean needsSchema()
void validateSchema(Map<String,Object> settings)
needsSchema()
and
checkIfSchemaExists()
return
true
.settings
- the settings to connectvoid validateSchema(Properties current, Map<String,Object> newSettings)
needsSchema()
and
checkIfSchemaExists()
return true
.current
- the current datasource settingsnewSettings
- the newSettings settingsboolean checkIfSchemaExists(Map<String,Object> settings)
true
even if parts are
missing. Will only be called if needsSchema()
returns true
.settings
- the settings to connectboolean checkIfSchemaExists(Properties current, Map<String,Object> newSettings)
true
even if parts are
missing. Will only be called if needsSchema()
returns true
.current
- the current datasource settingsnewSettings
- the newSettings settingsboolean checkSchemaCreation(Map<String,Object> settings)
needsSchema()
returns true
.settings
- the settings to connectString[] createSchema(Map<String,Object> settings)
needsSchema()
and
checkSchemaCreation()
return
true
. If checkIfSchemaExists()
returned true
,
dropSchema()
will be called first.settings
- the settings to connectString[] dropSchema(Map<String,Object> settings)
needsSchema()
and
checkIfSchemaExists()
return
true
.settings
- the settings to connectString[] updateSchema(Map<String,Object> settings)
needsSchema()
and
checkSchemaCreation()
return
true
. If checkIfSchemaExists()
returned true
,
dropSchema()
will be called first.settings
- the settings to connectvoid clear(Properties settings)
supportsClear()
returns true
.settings
- the settings to connectboolean supportsClear()
true
Properties getDatasourceProperties(Map<String,Object> settings)
ConnectionProvider
to connect.settings
- the settings to connectProperties getDatasourceProperties(Properties current, Map<String,Object> newSettings)
ConnectionProvider
to connect.current
- the current datasource settingsnewSettings
- the newSettings settingsDatasourceCallback getCallback()
void prepare(Map<String,Object> settings)
settings
- the settings to connectboolean isPostCreateSchema()
void checkPostCreation(Properties properties)
Copyright © 2012-2015 52north.org. All Rights Reserved.