mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-1512: Add absolute connection limit properties for MySQL/PostgreSQL.
This commit is contained in:
@@ -50,6 +50,12 @@ public class PostgreSQLEnvironment extends JDBCEnvironment {
|
||||
*/
|
||||
private static final int DEFAULT_PORT = 5432;
|
||||
|
||||
/**
|
||||
* The default value for the maximum number of connections to be
|
||||
* allowed to the Guacamole server overall.
|
||||
*/
|
||||
private final int ABSOLUTE_MAX_CONNECTIONS = 0;
|
||||
|
||||
/**
|
||||
* The default value for the default maximum number of connections to be
|
||||
* allowed per user to any one connection. Note that, as long as the
|
||||
@@ -163,6 +169,13 @@ public class PostgreSQLEnvironment extends JDBCEnvironment {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAbsoluteMaxConnections() throws GuacamoleException {
|
||||
return getProperty(PostgreSQLGuacamoleProperties.POSTGRESQL_ABSOLUTE_MAX_CONNECTIONS,
|
||||
ABSOLUTE_MAX_CONNECTIONS
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultMaxConnections() throws GuacamoleException {
|
||||
return getProperty(
|
||||
|
@@ -124,6 +124,19 @@ public class PostgreSQLGuacamoleProperties {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The maximum number of concurrent connections to allow overall. Zero
|
||||
* denotes unlimited.
|
||||
*/
|
||||
public static final IntegerGuacamoleProperty
|
||||
POSTGRESQL_ABSOLUTE_MAX_CONNECTIONS =
|
||||
new IntegerGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "postgresql-absolute-max-connections"; }
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The maximum number of concurrent connections to allow to any one
|
||||
* connection. Zero denotes unlimited.
|
||||
|
Reference in New Issue
Block a user