GUAC-1373: Injected JDBCEnvironment should be private.

This commit is contained in:
Michael Jumper
2015-11-12 12:44:40 -08:00
parent 7298cb7bb7
commit a774686311

View File

@@ -50,9 +50,10 @@ public class ConfigurableGuacamoleTunnelService
extends AbstractGuacamoleTunnelService { extends AbstractGuacamoleTunnelService {
/** /**
* The configuration for the current JDBC environment. * The Guacamole server environment.
*/ */
@Inject JDBCEnvironment jdbcEnvironment; @Inject
private JDBCEnvironment environment;
/** /**
* Set of all currently-active user/connection pairs (seats). * Set of all currently-active user/connection pairs (seats).
@@ -150,12 +151,12 @@ public class ConfigurableGuacamoleTunnelService
// Determine per-user limits on this connection // Determine per-user limits on this connection
Integer connectionMaxConnectionsPerUser = connection.getModel().getMaxConnectionsPerUser(); Integer connectionMaxConnectionsPerUser = connection.getModel().getMaxConnectionsPerUser();
if (connectionMaxConnectionsPerUser == null) if (connectionMaxConnectionsPerUser == null)
connectionMaxConnectionsPerUser = jdbcEnvironment.getDefaultMaxConnectionsPerUser(); connectionMaxConnectionsPerUser = environment.getDefaultMaxConnectionsPerUser();
// Determine overall limits on this connection // Determine overall limits on this connection
Integer connectionMaxConnections = connection.getModel().getMaxConnections(); Integer connectionMaxConnections = connection.getModel().getMaxConnections();
if (connectionMaxConnections == null) if (connectionMaxConnections == null)
connectionMaxConnections = jdbcEnvironment.getDefaultMaxConnections(); connectionMaxConnections = environment.getDefaultMaxConnections();
// Attempt to aquire connection according to per-user limits // Attempt to aquire connection according to per-user limits
Seat seat = new Seat(username, connection.getIdentifier()); Seat seat = new Seat(username, connection.getIdentifier());
@@ -202,12 +203,12 @@ public class ConfigurableGuacamoleTunnelService
// Determine per-user limits on this connection group // Determine per-user limits on this connection group
Integer connectionGroupMaxConnectionsPerUser = connectionGroup.getModel().getMaxConnectionsPerUser(); Integer connectionGroupMaxConnectionsPerUser = connectionGroup.getModel().getMaxConnectionsPerUser();
if (connectionGroupMaxConnectionsPerUser == null) if (connectionGroupMaxConnectionsPerUser == null)
connectionGroupMaxConnectionsPerUser = jdbcEnvironment.getDefaultMaxGroupConnectionsPerUser(); connectionGroupMaxConnectionsPerUser = environment.getDefaultMaxGroupConnectionsPerUser();
// Determine overall limits on this connection group // Determine overall limits on this connection group
Integer connectionGroupMaxConnections = connectionGroup.getModel().getMaxConnections(); Integer connectionGroupMaxConnections = connectionGroup.getModel().getMaxConnections();
if (connectionGroupMaxConnections == null) if (connectionGroupMaxConnections == null)
connectionGroupMaxConnections = jdbcEnvironment.getDefaultMaxGroupConnections(); connectionGroupMaxConnections = environment.getDefaultMaxGroupConnections();
// Attempt to aquire connection group according to per-user limits // Attempt to aquire connection group according to per-user limits
Seat seat = new Seat(username, connectionGroup.getIdentifier()); Seat seat = new Seat(username, connectionGroup.getIdentifier());