GUACAMOLE-102: Clean up code style issues, remove the unnecessary getDefaultConnectionWeight method.
Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/commit/d2d54302 Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/d2d54302 Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/d2d54302 Branch: refs/heads/master Commit: d2d543028f0fa6ced798375ccd91270b5b6f54a7 Parents: f66bbd2 Author: Nick Couchman <[email protected]> Authored: Mon Jun 5 15:13:19 2017 -0400 Committer: Nick Couchman <[email protected]> Committed: Mon Jun 5 21:43:18 2017 -0400 ---------------------------------------------------------------------- .../org/apache/guacamole/auth/jdbc/JDBCEnvironment.java | 11 ----------- .../auth/jdbc/connection/ModeledConnection.java | 3 +-- .../jdbc/tunnel/RestrictedGuacamoleTunnelService.java | 4 ++-- .../apache/guacamole/auth/mysql/MySQLEnvironment.java | 8 -------- .../guacamole/auth/postgresql/PostgreSQLEnvironment.java | 8 -------- 5 files changed, 3 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/d2d54302/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/JDBCEnvironment.java ---------------------------------------------------------------------- diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/JDBCEnvironment.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/JDBCEnvironment.java index a856d2a..53935e6 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/JDBCEnvironment.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/JDBCEnvironment.java @@ -83,17 +83,6 @@ public abstract class JDBCEnvironment extends LocalEnvironment { public abstract int getDefaultMaxConnections() throws GuacamoleException; /** - * Returns the connection weight for the purpose of WRR calculation - * - * @return - * The weight of the connection. - * - * @throws GuacamoleException - * If an error occurs while retrieving the property. - */ - public abstract int getDefaultConnectionWeight() throws GuacamoleException; - - /** * Returns the default maximum number of concurrent connections to allow to * any one connection group, unless specified differently on an individual * connection group. Zero denotes unlimited. http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/d2d54302/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/connection/ModeledConnection.java ---------------------------------------------------------------------- diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/connection/ModeledConnection.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/connection/ModeledConnection.java index 7e11a76..29a8b6f 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/connection/ModeledConnection.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/connection/ModeledConnection.java @@ -417,12 +417,11 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod * * @return * The weight of the connection. - * */ public int getConnectionWeight() { Integer connectionWeight = getModel().getConnectionWeight(); - if(connectionWeight == null) + if (connectionWeight == null) return 1; return connectionWeight; http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/d2d54302/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java ---------------------------------------------------------------------- diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java index bee5dd3..d4ab8aa 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/RestrictedGuacamoleTunnelService.java @@ -188,7 +188,7 @@ public class RestrictedGuacamoleTunnelService public int compare(ModeledConnection a, ModeledConnection b) { return ((getActiveConnections(a).size() + 1) * b.getConnectionWeight() - - (getActiveConnections(b).size() + 1) * a.getConnectionWeight()); + (getActiveConnections(b).size() + 1) * a.getConnectionWeight()); } @@ -202,7 +202,7 @@ public class RestrictedGuacamoleTunnelService // If connection weight is zero or negative, this host is disabled and should not be used. if (connection.getConnectionWeight() < 1) { - logger.warn("Weight for {} is < 1, connection will be skipped.", connection.getName()); + logger.debug("Weight for {} is < 1, connection will be skipped.", connection.getName()); continue; } http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/d2d54302/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLEnvironment.java ---------------------------------------------------------------------- diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLEnvironment.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLEnvironment.java index 6495fcc..088d186 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLEnvironment.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-mysql/src/main/java/org/apache/guacamole/auth/mysql/MySQLEnvironment.java @@ -201,14 +201,6 @@ public class MySQLEnvironment extends JDBCEnvironment { } @Override - public int getDefaultConnectionWeight() throws GuacamoleException { - return getProperty( - MySQLGuacamoleProperties.MYSQL_DEFAULT_CONNECTION_WEIGHT, - DEFAULT_CONNECTION_WEIGHT - ); - } - - @Override public int getDefaultMaxGroupConnections() throws GuacamoleException { return getProperty( MySQLGuacamoleProperties.MYSQL_DEFAULT_MAX_GROUP_CONNECTIONS, http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/d2d54302/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/java/org/apache/guacamole/auth/postgresql/PostgreSQLEnvironment.java ---------------------------------------------------------------------- diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/java/org/apache/guacamole/auth/postgresql/PostgreSQLEnvironment.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/java/org/apache/guacamole/auth/postgresql/PostgreSQLEnvironment.java index e0ad4ec..1f4b6e5 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/java/org/apache/guacamole/auth/postgresql/PostgreSQLEnvironment.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-postgresql/src/main/java/org/apache/guacamole/auth/postgresql/PostgreSQLEnvironment.java @@ -201,14 +201,6 @@ public class PostgreSQLEnvironment extends JDBCEnvironment { } @Override - public int getDefaultConnectionWeight() throws GuacamoleException { - return getProperty( - PostgreSQLGuacamoleProperties.POSTGRESQL_DEFAULT_CONNECTION_WEIGHT, - DEFAULT_CONNECTION_WEIGHT - ); - } - - @Override public int getDefaultMaxGroupConnections() throws GuacamoleException { return getProperty( PostgreSQLGuacamoleProperties.POSTGRESQL_DEFAULT_MAX_GROUP_CONNECTIONS,
