mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUAC-1512: Add absolute connection limit properties for MySQL/PostgreSQL.
This commit is contained in:
@@ -51,6 +51,12 @@ public class MySQLEnvironment extends JDBCEnvironment {
|
||||
*/
|
||||
private static final int DEFAULT_PORT = 3306;
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -164,6 +170,13 @@ public class MySQLEnvironment extends JDBCEnvironment {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAbsoluteMaxConnections() throws GuacamoleException {
|
||||
return getProperty(MySQLGuacamoleProperties.MYSQL_ABSOLUTE_MAX_CONNECTIONS,
|
||||
ABSOLUTE_MAX_CONNECTIONS
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultMaxConnections() throws GuacamoleException {
|
||||
return getProperty(
|
||||
|
@@ -115,6 +115,19 @@ public class MySQLGuacamoleProperties {
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* The maximum number of concurrent connections to allow overall. Zero
|
||||
* denotes unlimited.
|
||||
*/
|
||||
public static final IntegerGuacamoleProperty
|
||||
MYSQL_ABSOLUTE_MAX_CONNECTIONS =
|
||||
new IntegerGuacamoleProperty() {
|
||||
|
||||
@Override
|
||||
public String getName() { return "mysql-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