提交 72ceb4b5 编写于 作者: S serge-rider

#2202 SSH implementations moved to separate plugins

上级 afc8b286
......@@ -428,8 +428,6 @@ fontDefinition.org.jkiss.dbeaver.sql.resultset.font.label = \u7ED3\u679C\u7F51\u
handler.socks_proxy.description = SOCKS4/SOCKS5 \u4EE3\u7406
handler.socks_proxy.label = SOCKS \u4EE3\u7406
handler.ssh_tunnel.description = SSH \u901A\u9053
handler.ssh_tunnel.label = SSH \u901A\u9053
keyword.org.jkiss.dbeaver.core.keyword.pref.db.dataformat.label = \u683C\u5F0F\u5316\u65E5\u671F\u5B57\u7B26\u4E32\u4E3A\u672C\u5730\u5316\u8BED\u8A00
keyword.org.jkiss.dbeaver.core.keyword.pref.db.general.label = \u81EA\u52A8\u63D0\u4EA4\u6E38\u6807\u56DE\u6EDA\u7ED3\u679C\u96C6lob\u811A\u672C
......
......@@ -584,8 +584,6 @@ keyword.org.jkiss.dbeaver.core.keyword.pref.ui.general.label = update http proxy
extension.org.jkiss.dbeaver.DBeaverNature.name = DBeaver Nature
handler.ssh_tunnel.description = SSH tunnel
handler.ssh_tunnel.label = SSH Tunnel
handler.socks_proxy.description = SOCKS4/SOCKS5 proxy
handler.socks_proxy.label = SOCKS Proxy
......
......@@ -3583,6 +3583,7 @@
label="%handler.socks_proxy.label"
description="%handler.socks_proxy.description"
secured="true"
order="10"
handlerClass="org.jkiss.dbeaver.model.impl.net.SocksProxyImpl"/>
</extension>
......
......@@ -42,8 +42,9 @@ public class NetworkHandlerDescriptor extends AbstractContextDescriptor implemen
private DBWHandlerType type;
private final boolean secured;
private final ObjectType handlerType;
private final int order;
public NetworkHandlerDescriptor(
NetworkHandlerDescriptor(
IConfigurationElement config)
{
super(config);
......@@ -54,6 +55,7 @@ public class NetworkHandlerDescriptor extends AbstractContextDescriptor implemen
this.type = DBWHandlerType.valueOf(config.getAttribute(RegistryConstants.ATTR_TYPE).toUpperCase(Locale.ENGLISH));
this.secured = CommonUtils.getBoolean(config.getAttribute(RegistryConstants.ATTR_SECURED), false);
this.handlerType = new ObjectType(config.getAttribute(RegistryConstants.ATTR_HANDLER_CLASS));
this.order = CommonUtils.toInt(config.getAttribute(RegistryConstants.ATTR_ORDER), 1);
}
@NotNull
......@@ -82,6 +84,10 @@ public class NetworkHandlerDescriptor extends AbstractContextDescriptor implemen
return secured;
}
public int getOrder() {
return order;
}
public boolean matches(DBPDataSourceProvider provider)
{
return appliesTo(provider);
......
......@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.Platform;
import org.jkiss.dbeaver.model.DBPDataSourceContainer;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
public class NetworkHandlerRegistry
......@@ -47,6 +48,7 @@ public class NetworkHandlerRegistry
NetworkHandlerDescriptor formatterDescriptor = new NetworkHandlerDescriptor(ext);
descriptors.add(formatterDescriptor);
}
descriptors.sort(Comparator.comparingInt(NetworkHandlerDescriptor::getOrder));
}
}
......
......@@ -375,6 +375,7 @@
label="SSL"
description="Secure socket layer"
secured="false"
order="100"
handlerClass="org.jkiss.dbeaver.ext.mysql.model.net.MySQLSSLHandlerImpl">
<objectType name="org.jkiss.dbeaver.ext.mysql.MySQLDataSourceProvider"/>
</handler>
......
......@@ -368,6 +368,7 @@
label="%handler.ssl.name"
description="%handler.ssl.description"
secured="false"
order="100"
handlerClass="org.jkiss.dbeaver.ext.postgresql.model.net.PostgreSSLHandlerImpl">
<objectType name="org.jkiss.dbeaver.ext.postgresql.PostgreDataSourceProvider"/>
</handler>
......
......@@ -9,5 +9,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Require-Bundle: org.jkiss.dbeaver.model,
org.jkiss.dbeaver.net.ssh,
com.jcraft.jsch
Bundle-Localization: OSGI-INF/l10n/bundle
......@@ -9,5 +9,6 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Require-Bundle: org.jkiss.dbeaver.model,
org.jkiss.dbeaver.net.ssh,
com.hierynomus.sshj
Bundle-Localization: OSGI-INF/l10n/bundle
......@@ -2,4 +2,5 @@ Bundle-Vendor = JKISS
Bundle-Name = DBeaver SSH tunnels
extension-point.org.jkiss.dbeaver.net.ssh.name = SSH implementations
handler.ssh_tunnel.label = SSH
handler.ssh_tunnel.label = SSH Tunnel
handler.ssh_tunnel.description = SSH tunnel
handler.ssh_tunnel.description = Tunnel SSH
handler.ssh_tunnel.label = Tunnel SSH
handler.ssh_tunnel.description = SSH \u901A\u9053
handler.ssh_tunnel.label = SSH \u901A\u9053
......@@ -12,6 +12,7 @@
label="%handler.ssh_tunnel.label"
description="%handler.ssh_tunnel.description"
secured="true"
order="1"
handlerClass="org.jkiss.dbeaver.model.net.ssh.SSHTunnelImpl"/>
</extension>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册