[FIX] Поддержка нового формата подключения PostgreSQL

This commit is contained in:
Zaxar163 2020-04-05 10:20:35 +03:00
parent 43a43ec30d
commit 3ed166f8e7
4 changed files with 9 additions and 10 deletions

2
.gitignore vendored
View File

@ -107,6 +107,6 @@ buildnumber
*.directory
cmd.bat
cmd.sh
project/target
## PVS Studio
.PVS-Studio/
project/target

View File

@ -21,8 +21,8 @@ public final class PostgreSQLSourceConfig implements AutoCloseable {
private String poolName;
// Config
private String address;
private int port;
private String[] addresses;
private int[] ports;
private String username;
private String password;
private String database;
@ -43,8 +43,8 @@ public final class PostgreSQLSourceConfig implements AutoCloseable {
PGSimpleDataSource postgresqlSource = new PGSimpleDataSource();
// Set credentials
postgresqlSource.setServerNames(new String[] {address}); //TODO support multinode PostgreSQL DB
postgresqlSource.setPortNumbers(new int[] {port});
postgresqlSource.setServerNames(addresses);
postgresqlSource.setPortNumbers(ports);
postgresqlSource.setUser(username);
postgresqlSource.setPassword(password);
postgresqlSource.setDatabaseName(database);

View File

@ -10,6 +10,7 @@ import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.Set;
// TODO refactor
@SuppressWarnings("unused")
public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
private SSLServerSocketFactory ssf;
@ -18,9 +19,6 @@ public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
public LauncherNettyServer nettyServer;
// API
private Set<Socket> sockets;
private transient final LaunchServer server;
public NettyServerSocketHandler(LaunchServer server) {
@ -29,7 +27,8 @@ public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
@Override
public void close() {
//TODO: Close Impl
nettyServer.close();
nettyServer.service.channels.close();
}
@Override

View File

@ -2,7 +2,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
id 'maven-publish'
id 'signing'
id 'org.openjfx.javafxplugin' version '0.0.7' apply false
id 'org.openjfx.javafxplugin' version '0.0.8' apply false
}
group = 'pro.gravit.launcher'
version = '5.1.3'