mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-102: Clean up code style issues, remove the unnecessary getDefaultConnectionWeight method.
This commit is contained in:
@@ -82,17 +82,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
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -200,14 +200,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(
|
||||
|
@@ -200,14 +200,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(
|
||||
|
Reference in New Issue
Block a user