mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 08:31:07 +03:00
[FIX] Поддержка нового формата подключения PostgreSQL
This commit is contained in:
parent
43a43ec30d
commit
3ed166f8e7
4 changed files with 9 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -107,6 +107,6 @@ buildnumber
|
||||||
*.directory
|
*.directory
|
||||||
cmd.bat
|
cmd.bat
|
||||||
cmd.sh
|
cmd.sh
|
||||||
|
project/target
|
||||||
## PVS Studio
|
## PVS Studio
|
||||||
.PVS-Studio/
|
.PVS-Studio/
|
||||||
project/target
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ public final class PostgreSQLSourceConfig implements AutoCloseable {
|
||||||
private String poolName;
|
private String poolName;
|
||||||
|
|
||||||
// Config
|
// Config
|
||||||
private String address;
|
private String[] addresses;
|
||||||
private int port;
|
private int[] ports;
|
||||||
private String username;
|
private String username;
|
||||||
private String password;
|
private String password;
|
||||||
private String database;
|
private String database;
|
||||||
|
@ -43,8 +43,8 @@ public synchronized Connection getConnection() throws SQLException {
|
||||||
PGSimpleDataSource postgresqlSource = new PGSimpleDataSource();
|
PGSimpleDataSource postgresqlSource = new PGSimpleDataSource();
|
||||||
|
|
||||||
// Set credentials
|
// Set credentials
|
||||||
postgresqlSource.setServerNames(new String[] {address}); //TODO support multinode PostgreSQL DB
|
postgresqlSource.setServerNames(addresses);
|
||||||
postgresqlSource.setPortNumbers(new int[] {port});
|
postgresqlSource.setPortNumbers(ports);
|
||||||
postgresqlSource.setUser(username);
|
postgresqlSource.setUser(username);
|
||||||
postgresqlSource.setPassword(password);
|
postgresqlSource.setPassword(password);
|
||||||
postgresqlSource.setDatabaseName(database);
|
postgresqlSource.setDatabaseName(database);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
// TODO refactor
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
|
public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
|
||||||
private SSLServerSocketFactory ssf;
|
private SSLServerSocketFactory ssf;
|
||||||
|
@ -18,9 +19,6 @@ public final class NettyServerSocketHandler implements Runnable, AutoCloseable {
|
||||||
|
|
||||||
public LauncherNettyServer nettyServer;
|
public LauncherNettyServer nettyServer;
|
||||||
|
|
||||||
// API
|
|
||||||
private Set<Socket> sockets;
|
|
||||||
|
|
||||||
private transient final LaunchServer server;
|
private transient final LaunchServer server;
|
||||||
|
|
||||||
public NettyServerSocketHandler(LaunchServer server) {
|
public NettyServerSocketHandler(LaunchServer server) {
|
||||||
|
@ -29,7 +27,8 @@ public NettyServerSocketHandler(LaunchServer server) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
//TODO: Close Impl
|
nettyServer.close();
|
||||||
|
nettyServer.service.channels.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
|
id 'com.github.johnrengelman.shadow' version '5.2.0' apply false
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
id 'signing'
|
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'
|
group = 'pro.gravit.launcher'
|
||||||
version = '5.1.3'
|
version = '5.1.3'
|
||||||
|
|
Loading…
Reference in a new issue