use of org.jkiss.dbeaver.model.DBPInformationProvider in project dbeaver by serge-rider.
the class DataSourceUtils method getDataSourceAddressText.
@NotNull
public static String getDataSourceAddressText(DBPDataSourceContainer dataSourceContainer) {
DBPDataSourceProvider dataSourceProvider = dataSourceContainer.getDriver().getDataSourceProvider();
if (dataSourceProvider instanceof DBPInformationProvider) {
String objectInformation = ((DBPInformationProvider) dataSourceProvider).getObjectInformation(dataSourceContainer, DBPInformationProvider.INFO_TARGET_ADDRESS);
if (!CommonUtils.isEmpty(objectInformation)) {
return objectInformation;
}
}
DBPConnectionConfiguration cfg = dataSourceContainer.getConnectionConfiguration();
String hostText = getTargetTunnelHostName(cfg);
String hostPort = cfg.getHostPort();
if (!CommonUtils.isEmpty(hostPort)) {
return hostText + ":" + hostPort;
}
return hostText;
}
use of org.jkiss.dbeaver.model.DBPInformationProvider in project dbeaver by dbeaver.
the class DataSourceUtils method getDataSourceAddressText.
@NotNull
public static String getDataSourceAddressText(DBPDataSourceContainer dataSourceContainer) {
DBPDataSourceProvider dataSourceProvider = dataSourceContainer.getDriver().getDataSourceProvider();
if (dataSourceProvider instanceof DBPInformationProvider) {
String objectInformation = ((DBPInformationProvider) dataSourceProvider).getObjectInformation(dataSourceContainer, DBPInformationProvider.INFO_TARGET_ADDRESS);
if (!CommonUtils.isEmpty(objectInformation)) {
return objectInformation;
}
}
DBPConnectionConfiguration cfg = dataSourceContainer.getConnectionConfiguration();
String hostText = getTargetTunnelHostName(cfg);
String hostPort = cfg.getHostPort();
if (!CommonUtils.isEmpty(hostPort)) {
return hostText + ":" + hostPort;
}
return hostText;
}
Aggregations