public class DatabaseConnection
extends java.lang.Object
DatabaseConnectionDialog
.
Modifier and Type | Field and Description |
---|---|
protected Configuration |
config
Cache for the settings (driver parameters, expert settings, etc.).
|
protected DatabaseManager |
dbManager
The application specific database manager.
|
static java.lang.String |
PARAM_DB_ADMIN
The name of the administrative user (
String ). |
static java.lang.String |
PARAM_DB_ADMIN_PASSWORD
The password for the administrative user (
String ). |
static java.lang.String |
PARAM_DB_CONNECT_AS
The user role to connect (e.g.
|
static java.lang.String |
PARAM_DB_CREATE
Create the database from the scratch (true|false) (
String )? |
static java.lang.String |
PARAM_DB_ENCRYPTION
Encrypt the database files (
boolean )? |
static java.lang.String |
PARAM_DB_ENCRYPTION_ALGO
Algorithm used for encryption (e.g.
|
static java.lang.String |
PARAM_DB_ENCRYPTION_KEY
(Secret) key used for encryption (
String ). |
static java.lang.String |
PARAM_DB_HOST
The ip address or the name of the host (
String ). |
static java.lang.String |
PARAM_DB_NAME
The name of the target database (
String ). |
static java.lang.String |
PARAM_DB_ORACLE_REMARKS
Oracle only: read table remarks (default: off, due to performance) (
boolean )? |
static java.lang.String |
PARAM_DB_PORT
The port number for the host access (
String ). |
static java.lang.String |
PARAM_DB_SAVE_ADMIN_PASSWORD
Save the password for the administrative user (
boolean )? |
static java.lang.String |
PARAM_DB_SAVE_USER_PASSWORD
Save the password for the user (
boolean )? |
static java.lang.String |
PARAM_DB_SCHEMAS
Application schemas can be mapped to database schemas (
Configuration ). |
static java.lang.String |
PARAM_DB_SERVICE
The service for the target database (e.g.
|
static java.lang.String |
PARAM_DB_SID
The SID of the target database (e.g.
|
static java.lang.String |
PARAM_DB_USE_SSL
Encrypt transferred data with SSL (
boolean )? |
static java.lang.String |
PARAM_DB_USER
The name of the default user (
String ). |
static java.lang.String |
PARAM_DB_USER_PASSWORD
The password for the default user (
String ). |
static java.lang.String |
VAR_CONNECTION_ID
Configuration variable name (
String ). |
static java.lang.String |
VAR_CONNECTION_NAME
Configuration variable name (
String ). |
static java.lang.String |
VAR_CONNECTOR_TYPE
Configuration variable name (
String ). |
static java.lang.String |
VAR_EXPERT_AUTO_RECONNECT
Configuration variable name (
boolean ). |
static java.lang.String |
VAR_EXPERT_DISPLAY_BEFORE
Configuration variable name (
boolean ). |
static java.lang.String |
VAR_EXPERT_KEEP_ALIVE
Configuration variable name (
boolean ). |
static java.lang.String |
VAR_EXPERT_KEEP_ALIVE_PING
Configuration variable name (
boolean ). |
static java.lang.String |
VAR_EXPERT_KEEP_ALIVE_QUERY
Configuration variable name (
boolean ). |
static java.lang.String |
VAR_EXPERT_KEEP_ALIVE_SECONDS
Configuration variable name (
int ). |
static java.lang.String |
VAR_EXPERT_MAX_WAIT
Configuration variable name (
boolean ). |
static java.lang.String |
VAR_EXPERT_MAX_WAIT_SECONDS
Configuration variable name (
int ). |
static java.lang.String |
VAR_READONLY
Configuration variable name (
boolean ). |
Constructor and Description |
---|
DatabaseConnection()
Constructor method for i18n purposes only.
|
DatabaseConnection(java.lang.String id,
Configuration config,
DatabaseManager dbmanager)
Constructor method setting the container.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
checkUniqueName(java.lang.String name,
java.util.Vector<DatabaseConnection> connections)
Checks if the given connection name is unique over all connections.
|
boolean |
checkUniqueName(java.util.Vector<DatabaseConnection> connections)
Checks if the name for the given connection is unique over all connections.
|
java.lang.String |
getAdminPassword(java.lang.String fallback)
Provides the admin password.
|
boolean |
getAutoReconnect(boolean fallback)
Provides the expert setting if to reconnect to dead peers.
|
Configuration |
getCache()
Provides access to the internal cache with properties.
|
java.lang.String |
getConnectorType(java.lang.String fallback)
Provides the connector class.
|
DatabaseManager |
getDatabaseManager()
Provides access to the database manager.
|
boolean |
getDisplayBefore(boolean fallback)
Provides the expert setting if settings shall be displayed before connection is established.
|
java.lang.String |
getHost(java.lang.String fallback)
Provides the host name.
|
java.lang.String |
getID(java.lang.String fallback)
Provides the unique connection identifier.
|
boolean |
getKeepAlive(boolean fallback)
Provides the expert setting if connection is kept alive automatically.
|
boolean |
getKeepAlivePing(boolean fallback)
Provides the expert setting if connection is kept alive with ping.
|
boolean |
getKeepAliveQuery(boolean fallback)
Provides the expert setting if connection is kept alive with query.
|
int |
getKeepAliveSeconds(int fallback)
Provides the keep alive interval.
|
boolean |
getMaxWait(boolean fallback)
Provides the expert setting if to wait for connect.
|
int |
getMaxWaitSeconds(int fallback)
Provides the maximum number of seconds to wait for connect.
|
java.lang.String |
getName(java.lang.String fallback)
Provides the connection name.
|
boolean |
getSaveAdminPassword(boolean save)
Provides the info if the admin password should be remembered.
|
boolean |
getSaveUserPassword(boolean save)
Provides the info if the user password should be remembered.
|
java.lang.String |
getSchemaMapping(java.lang.String schema)
Provides the database schema name the given application schema shall be mapped to.
|
java.lang.String |
getUserPassword(java.lang.String fallback)
Provides the user password.
|
boolean |
getUseSSL(boolean fallback)
Provides the communication encryption with SSL (Secure Sockets Layer).
|
boolean |
isAvailable()
Convenience method to get the info if the underlying connector is available.
|
boolean |
isCacheEmpty()
Provides the info if the internal cache is empty.
|
boolean |
isReadOnly(boolean fallback)
Provides the info if connection parameters are read-only.
|
java.lang.String |
isValid(java.util.Vector<DatabaseConnection> connections,
LicenseChecker checker)
Provides the info if this connection is configured properly and can therefore be used.
|
void |
setAdminPassword(java.lang.String password)
Sets the admin password.
|
void |
setConnectorType(java.lang.String value)
Sets the connector class.
|
void |
setDisplayBefore(boolean value)
Enabled/disables the expert setting if settings shall be displayed before connection is established.
|
void |
setHost(java.lang.String value)
Sets the host name.
|
void |
setName(java.lang.String value)
Sets the connection name.
|
void |
setReadOnly(boolean value)
Sets the info if connection parameters are read-only.
|
void |
setSaveAdminPassword(boolean save)
Sets the info if the admin password should be remembered.
|
void |
setSaveUserPassword(boolean save)
Sets the info if the user password should be remembered.
|
void |
setUserPassword(java.lang.String password)
Sets the user password.
|
void |
setUseSSL(boolean value)
Enabled/disables the communication encryption with SSL (Secure Sockets Layer).
|
java.lang.String |
toString()
Provides the characteristic textual representation of this connection (identifier).
|
public static final java.lang.String VAR_CONNECTION_ID
String
).public static final java.lang.String VAR_CONNECTION_NAME
String
).public static final java.lang.String VAR_CONNECTOR_TYPE
String
).public static final java.lang.String VAR_READONLY
boolean
).public static final java.lang.String VAR_EXPERT_MAX_WAIT
boolean
).public static final java.lang.String VAR_EXPERT_MAX_WAIT_SECONDS
int
).public static final java.lang.String VAR_EXPERT_AUTO_RECONNECT
boolean
).public static final java.lang.String VAR_EXPERT_KEEP_ALIVE
boolean
).public static final java.lang.String VAR_EXPERT_KEEP_ALIVE_SECONDS
int
).public static final java.lang.String VAR_EXPERT_KEEP_ALIVE_PING
boolean
).public static final java.lang.String VAR_EXPERT_KEEP_ALIVE_QUERY
boolean
).public static final java.lang.String VAR_EXPERT_DISPLAY_BEFORE
boolean
).public static final java.lang.String PARAM_DB_NAME
String
).public static final java.lang.String PARAM_DB_ADMIN
String
).public static final java.lang.String PARAM_DB_ADMIN_PASSWORD
String
).public static final java.lang.String PARAM_DB_SAVE_ADMIN_PASSWORD
boolean
)?public static final java.lang.String PARAM_DB_USER
String
).public static final java.lang.String PARAM_DB_USER_PASSWORD
String
).public static final java.lang.String PARAM_DB_SAVE_USER_PASSWORD
boolean
)?public static final java.lang.String PARAM_DB_CREATE
String
)?public static final java.lang.String PARAM_DB_ENCRYPTION
boolean
)?public static final java.lang.String PARAM_DB_ENCRYPTION_ALGO
String
).public static final java.lang.String PARAM_DB_ENCRYPTION_KEY
String
).public static final java.lang.String PARAM_DB_HOST
String
).public static final java.lang.String PARAM_DB_PORT
String
).public static final java.lang.String PARAM_DB_SID
String
).public static final java.lang.String PARAM_DB_SCHEMAS
Configuration
).public static final java.lang.String PARAM_DB_USE_SSL
boolean
)?public static final java.lang.String PARAM_DB_SERVICE
String
).public static final java.lang.String PARAM_DB_CONNECT_AS
String
).public static final java.lang.String PARAM_DB_ORACLE_REMARKS
boolean
)?protected Configuration config
protected DatabaseManager dbManager
public DatabaseConnection() throws java.lang.InstantiationException
I18NExtractor
).
java.lang.InstantiationException
- Error indicationpublic DatabaseConnection(java.lang.String id, Configuration config, DatabaseManager dbmanager)
id
- The unique connection identifierconfig
- The container, empty is OKdbmanager
- The application specific database managerjava.lang.NullPointerException
- If parameter is null
public java.lang.String getID(java.lang.String fallback)
fallback
- The default valuenull
public java.lang.String getName(java.lang.String fallback)
fallback
- The default valuenull
public void setName(java.lang.String value)
value
- The connection name, removed if null
public java.lang.String getConnectorType(java.lang.String fallback)
fallback
- The default valuenull
public void setConnectorType(java.lang.String value)
value
- The connector class, removed if null
public boolean isReadOnly(boolean fallback)
fallback
- The default valuepublic void setReadOnly(boolean value)
value
- Read-only?public boolean getMaxWait(boolean fallback)
fallback
- The default valuepublic int getMaxWaitSeconds(int fallback)
fallback
- The default valuepublic boolean getAutoReconnect(boolean fallback)
fallback
- The default valuepublic boolean getKeepAlive(boolean fallback)
fallback
- The default valuepublic int getKeepAliveSeconds(int fallback)
fallback
- The default valuepublic boolean getKeepAlivePing(boolean fallback)
fallback
- The default valuepublic boolean getKeepAliveQuery(boolean fallback)
fallback
- The default valuepublic void setDisplayBefore(boolean value)
value
- The valuepublic boolean getDisplayBefore(boolean fallback)
fallback
- The default valuepublic java.lang.String getUserPassword(java.lang.String fallback)
fallback
- The default valuenull
public void setUserPassword(java.lang.String password)
password
- The user passwordpublic java.lang.String getAdminPassword(java.lang.String fallback)
fallback
- The default valuenull
public void setAdminPassword(java.lang.String password)
password
- The admin passwordpublic boolean getSaveUserPassword(boolean save)
save
- The default valuepublic void setSaveUserPassword(boolean save)
save
- Remember?public boolean getSaveAdminPassword(boolean save)
save
- The default valuepublic void setSaveAdminPassword(boolean save)
save
- Remember?public Configuration getCache()
public boolean isCacheEmpty()
public boolean isAvailable()
public DatabaseManager getDatabaseManager()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSchemaMapping(java.lang.String schema)
schema
- The database schema like LIMADATAschema
if not availablepublic void setUseSSL(boolean value)
value
- The valuepublic boolean getUseSSL(boolean fallback)
fallback
- The default valuepublic boolean checkUniqueName(java.util.Vector<DatabaseConnection> connections)
connections
- The other connectionsjava.lang.NullPointerException
- If a parameter is null
public static boolean checkUniqueName(java.lang.String name, java.util.Vector<DatabaseConnection> connections)
name
- The name to checkconnections
- The other connectionsjava.lang.NullPointerException
- If a parameter is null
public java.lang.String isValid(java.util.Vector<DatabaseConnection> connections, LicenseChecker checker)
connections
- The other connections (optional)checker
- The license checker (optional)public java.lang.String getHost(java.lang.String fallback)
fallback
- The default valuenull
public void setHost(java.lang.String value)
value
- The host name, removed if null
Copyright © 2005-2023 Leisenfels GmbH. All rights reserved.