Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
29406b1d
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
29406b1d
编写于
12月 26, 2016
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Connection properties refactoring
Former-commit-id:
02591ba4
上级
8b59a355
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
24 addition
and
19 deletion
+24
-19
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
.../src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
...re/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
+2
-2
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/DriverPropertiesDialogPage.java
...ver/ui/dialogs/connection/DriverPropertiesDialogPage.java
+6
-1
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/ExasolDataSourceProvider.java
...rg/jkiss/dbeaver/ext/exasol/ExasolDataSourceProvider.java
+1
-1
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/tools/ExasolWizardPageSettings.java
...ss/dbeaver/ext/exasol/tools/ExasolWizardPageSettings.java
+2
-2
plugins/org.jkiss.dbeaver.ext.import-config/src/org/jkiss/dbeaver/ext/import_config/wizards/ImportConnectionInfo.java
...eaver/ext/import_config/wizards/ImportConnectionInfo.java
+2
-2
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/tools/PostgreWizardPageSettings.java
...eaver/ext/postgresql/tools/PostgreWizardPageSettings.java
+4
-4
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionConfiguration.java
.../dbeaver/model/connection/DBPConnectionConfiguration.java
+5
-5
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
...src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceDescriptor.java
浏览文件 @
29406b1d
...
...
@@ -777,7 +777,7 @@ public class DataSourceDescriptor
DBRShellCommand
command
=
info
.
getEvent
(
eventType
);
if
(
command
!=
null
&&
command
.
isEnabled
())
{
Map
<
String
,
Object
>
variables
=
new
HashMap
<>();
for
(
Map
.
Entry
<
Object
,
Object
>
entry
:
info
.
getProperties
().
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
info
.
getProperties
().
entrySet
())
{
variables
.
put
(
CommonUtils
.
toString
(
entry
.
getKey
()),
entry
.
getValue
());
}
variables
.
put
(
RegistryConstants
.
VARIABLE_HOST
,
info
.
getHostName
());
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/DataSourceRegistry.java
浏览文件 @
29406b1d
...
...
@@ -685,7 +685,7 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
xml
.
addAttribute
(
RegistryConstants
.
ATTR_KEEP_ALIVE
,
connectionInfo
.
getKeepAliveInterval
());
}
for
(
Map
.
Entry
<
Object
,
Object
>
entry
:
connectionInfo
.
getProperties
().
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
entry
:
connectionInfo
.
getProperties
().
entrySet
())
{
xml
.
startElement
(
RegistryConstants
.
TAG_PROPERTY
);
xml
.
addAttribute
(
RegistryConstants
.
ATTR_NAME
,
CommonUtils
.
toString
(
entry
.
getKey
()));
xml
.
addAttribute
(
RegistryConstants
.
ATTR_VALUE
,
CommonUtils
.
toString
(
entry
.
getValue
()));
...
...
@@ -997,7 +997,7 @@ public class DataSourceRegistry implements DBPDataSourceRegistry
new
DBPConnectionConfiguration
());
}
else
{
// Clean settings - they have to be loaded later by parser
curDataSource
.
getConnectionConfiguration
().
setProperties
(
Collections
.
emptyMap
());
curDataSource
.
getConnectionConfiguration
().
setProperties
(
Collections
.
<
String
,
String
>
emptyMap
());
curDataSource
.
getConnectionConfiguration
().
setHandlers
(
Collections
.<
DBWHandlerConfiguration
>
emptyList
());
curDataSource
.
clearFilters
();
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/connection/DriverPropertiesDialogPage.java
浏览文件 @
29406b1d
...
...
@@ -26,8 +26,10 @@ import org.jkiss.dbeaver.model.runtime.DBRRunnableWithProgress;
import
org.jkiss.dbeaver.registry.DataSourceDescriptor
;
import
org.jkiss.dbeaver.registry.driver.DriverDescriptor
;
import
org.jkiss.dbeaver.runtime.properties.PropertySourceCustom
;
import
org.jkiss.utils.CommonUtils
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Map
;
/**
* DriverPropertiesDialogPage
...
...
@@ -111,7 +113,10 @@ public class DriverPropertiesDialogPage extends ConnectionPageAbstract
public
void
saveSettings
(
DBPDataSourceContainer
dataSource
)
{
if
(
propertySource
!=
null
)
{
dataSource
.
getConnectionConfiguration
().
getProperties
().
putAll
(
propertySource
.
getProperties
());
final
Map
<
String
,
String
>
properties
=
dataSource
.
getConnectionConfiguration
().
getProperties
();
for
(
Map
.
Entry
<
Object
,
Object
>
entry
:
propertySource
.
getProperties
().
entrySet
())
{
properties
.
put
(
CommonUtils
.
toString
(
entry
.
getKey
()),
CommonUtils
.
toString
(
entry
.
getValue
()));
}
}
}
...
...
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/ExasolDataSourceProvider.java
浏览文件 @
29406b1d
...
...
@@ -68,7 +68,7 @@ public class ExasolDataSourceProvider extends JDBCDataSourceProvider {
if
(!
CommonUtils
.
isEmpty
(
connectionInfo
.
getHostPort
()))
{
port
=
":"
+
connectionInfo
.
getHostPort
();
}
Map
<
Object
,
Object
>
properties
=
connectionInfo
.
getProperties
();
Map
<
String
,
String
>
properties
=
connectionInfo
.
getProperties
();
StringBuilder
url
=
new
StringBuilder
(
128
);
url
.
append
(
"jdbc:exa:"
).
append
(
connectionInfo
.
getHostName
()).
append
(
port
);
...
...
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/tools/ExasolWizardPageSettings.java
浏览文件 @
29406b1d
...
...
@@ -52,9 +52,9 @@ public class ExasolWizardPageSettings<WIZARD extends AbstractToolWizard> extends
String
authUser
=
null
;
String
authPassword
=
null
;
{
Object
authValue
=
connectionInfo
.
getProperty
(
authProperty
);
String
authValue
=
connectionInfo
.
getProperty
(
authProperty
);
if
(
authValue
!=
null
)
{
String
authCredentials
=
encrypter
.
decrypt
(
authValue
.
toString
()
);
String
authCredentials
=
encrypter
.
decrypt
(
authValue
);
int
divPos
=
authCredentials
.
indexOf
(
':'
);
if
(
divPos
!=
-
1
)
{
authUser
=
authCredentials
.
substring
(
0
,
divPos
);
...
...
plugins/org.jkiss.dbeaver.ext.import-config/src/org/jkiss/dbeaver/ext/import_config/wizards/ImportConnectionInfo.java
浏览文件 @
29406b1d
...
...
@@ -38,7 +38,7 @@ public class ImportConnectionInfo {
private
String
database
;
private
String
user
;
private
String
password
;
private
Map
<
Object
,
Object
>
properties
=
new
HashMap
<>();
private
Map
<
String
,
String
>
properties
=
new
HashMap
<>();
private
Map
<
String
,
String
>
providerProperties
=
new
HashMap
<>();
private
boolean
checked
=
false
;
...
...
@@ -128,7 +128,7 @@ public class ImportConnectionInfo {
return
password
;
}
public
Map
<
Object
,
Object
>
getProperties
()
public
Map
<
String
,
String
>
getProperties
()
{
return
properties
;
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/tools/PostgreWizardPageSettings.java
浏览文件 @
29406b1d
...
...
@@ -54,9 +54,9 @@ public abstract class PostgreWizardPageSettings<WIZARD extends AbstractToolWizar
String
authUser
=
null
;
String
authPassword
=
null
;
{
Object
authValue
=
connectionInfo
.
get
Property
(
authProperty
);
String
authValue
=
connectionInfo
.
getProvider
Property
(
authProperty
);
if
(
authValue
!=
null
)
{
String
authCredentials
=
encrypter
.
decrypt
(
authValue
.
toString
()
);
String
authCredentials
=
encrypter
.
decrypt
(
authValue
);
int
divPos
=
authCredentials
.
indexOf
(
':'
);
if
(
divPos
!=
-
1
)
{
authUser
=
authCredentials
.
substring
(
0
,
divPos
);
...
...
@@ -90,7 +90,7 @@ public abstract class PostgreWizardPageSettings<WIZARD extends AbstractToolWizar
wizard
.
setToolUserPassword
(
authDialog
.
getUserPassword
());
if
(
authDialog
.
isSavePassword
())
{
try
{
connectionInfo
.
setProperty
(
connectionInfo
.
setPro
viderPro
perty
(
authProperty
,
encrypter
.
encrypt
(
wizard
.
getToolUserName
()
+
':'
+
wizard
.
getToolUserPassword
()));
}
catch
(
EncryptionException
e1
)
{
...
...
@@ -107,7 +107,7 @@ public abstract class PostgreWizardPageSettings<WIZARD extends AbstractToolWizar
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
connectionInfo
.
getProperties
().
remove
(
authProperty
);
connectionInfo
.
getPro
viderPro
perties
().
remove
(
authProperty
);
wizard
.
setToolUserName
(
connectionInfo
.
getUserName
());
wizard
.
setToolUserPassword
(
connectionInfo
.
getUserPassword
());
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/connection/DBPConnectionConfiguration.java
浏览文件 @
29406b1d
...
...
@@ -40,7 +40,7 @@ public class DBPConnectionConfiguration implements DBPObject
private
String
url
;
private
String
clientHomeId
;
@NotNull
private
final
Map
<
Object
,
Object
>
properties
;
private
final
Map
<
String
,
String
>
properties
;
@NotNull
private
final
Map
<
String
,
String
>
providerProperties
;
@NotNull
...
...
@@ -171,23 +171,23 @@ public class DBPConnectionConfiguration implements DBPObject
////////////////////////////////////////////////////
// Properties (connection properties, usually used by driver)
public
Object
getProperty
(
Object
name
)
public
String
getProperty
(
String
name
)
{
return
properties
.
get
(
name
);
}
public
void
setProperty
(
Object
name
,
Object
value
)
public
void
setProperty
(
String
name
,
String
value
)
{
properties
.
put
(
name
,
value
);
}
@NotNull
public
Map
<
Object
,
Object
>
getProperties
()
public
Map
<
String
,
String
>
getProperties
()
{
return
properties
;
}
public
void
setProperties
(
@NotNull
Map
<
Object
,
Object
>
properties
)
public
void
setProperties
(
@NotNull
Map
<
String
,
String
>
properties
)
{
this
.
properties
.
clear
();
this
.
properties
.
putAll
(
properties
);
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
浏览文件 @
29406b1d
...
...
@@ -130,7 +130,7 @@ public abstract class JDBCDataSource
}
DBPConnectionConfiguration
connectionInfo
=
container
.
getActualConnectionConfiguration
();
for
(
Map
.
Entry
<
Object
,
Object
>
prop
:
connectionInfo
.
getProperties
().
entrySet
())
{
for
(
Map
.
Entry
<
String
,
String
>
prop
:
connectionInfo
.
getProperties
().
entrySet
())
{
connectProps
.
setProperty
(
CommonUtils
.
toString
(
prop
.
getKey
()),
CommonUtils
.
toString
(
prop
.
getValue
()));
}
if
(!
CommonUtils
.
isEmpty
(
connectionInfo
.
getUserName
()))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录