public class ConnectionDictionary
extends java.util.Properties
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATABASE_ADAPTOR_KEY |
static java.lang.String |
PASSWORD_KEY |
static java.lang.String |
URL_KEY |
static java.lang.String |
USER_KEY |
Constructor and Description |
---|
ConnectionDictionary()
Constructor
|
Modifier and Type | Method and Description |
---|---|
static ConnectionDictionary |
defaultDictionary()
Get the connection dictionary from the file specified in the user's preferences.
|
DatabaseAdaptor |
getDatabaseAdaptor()
Get the database adaptor to use
|
static ConnectionDictionary |
getInstance()
Get the connection dictionary from the URL specified in the user's preferences.
|
static ConnectionDictionary |
getInstance(java.lang.String accountName)
Get the connection dictionary from the URL specified in the user's preferences and for the specified account.
|
static ConnectionDictionary |
getInstance(java.lang.String accountName,
java.lang.String serverName)
Get the connection dictionary from the URL specified in the user's preferences and for the specified account and server.
|
java.lang.String |
getPassword()
Get the user password for connecting
|
static ConnectionDictionary |
getPreferredInstance(java.lang.String... accountNames)
Get the available connection dictionary which is the most preferred
|
java.lang.String |
getURLSpec()
Get the connection URL
|
java.lang.String |
getUser()
Get the user name for connecting
|
boolean |
hasRequiredInfo()
Determine if the dictionary is sufficiently complete regardless whether the data is right or wrong.
|
void |
setDatabaseAdaptorClass(java.lang.Class<?> databaseAdaptorClass)
Set the database adaptor class
|
void |
setDatabaseAdaptorClass(java.lang.String className)
Set the database adaptor class
|
void |
setPassword(java.lang.String password)
Set the password
|
void |
setURLSpec(java.lang.String urlSpec)
Set the URL spec
|
void |
setUser(java.lang.String userID)
Set the user ID
|
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, size, toString, values
public static final java.lang.String USER_KEY
public static final java.lang.String PASSWORD_KEY
public static final java.lang.String URL_KEY
public static final java.lang.String DATABASE_ADAPTOR_KEY
public static ConnectionDictionary defaultDictionary()
public static ConnectionDictionary getInstance()
public static ConnectionDictionary getInstance(java.lang.String accountName)
accountName
- name of the account for which to initializae the connection dictionary (or null to use the default account if any)public static ConnectionDictionary getPreferredInstance(java.lang.String... accountNames)
accountNames
- ordered (most preferred is first) accounts to search amongpublic static ConnectionDictionary getInstance(java.lang.String accountName, java.lang.String serverName)
accountName
- name of the account for which to initializae the connection dictionary (or null to use the default account if any)serverName
- name of the database server for which to initialize the connection dictionary (or null to use the default server if any)public boolean hasRequiredInfo()
public java.lang.String getUser()
public void setUser(java.lang.String userID)
userID
- The user IDpublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the passwordpublic java.lang.String getURLSpec()
public void setURLSpec(java.lang.String urlSpec)
urlSpec
- The URL specpublic DatabaseAdaptor getDatabaseAdaptor()
public void setDatabaseAdaptorClass(java.lang.Class<?> databaseAdaptorClass)
databaseAdaptorClass
- the database adaptor class to usepublic void setDatabaseAdaptorClass(java.lang.String className)
className
- the database adaptor class name to use