mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-102: Code cleanup - remove unused default parameters; improve commentary and use more standard variable names.
This commit is contained in:
@@ -188,23 +188,23 @@ public class RestrictedGuacamoleTunnelService
|
|||||||
public int compare(ModeledConnection a, ModeledConnection b) {
|
public int compare(ModeledConnection a, ModeledConnection b) {
|
||||||
|
|
||||||
// Active connections
|
// Active connections
|
||||||
int Ca = getActiveConnections(a).size();
|
int connA = getActiveConnections(a).size();
|
||||||
int Cb = getActiveConnections(b).size();
|
int connB = getActiveConnections(b).size();
|
||||||
|
|
||||||
// Assigned weight
|
// Assigned weight
|
||||||
int Wa = a.getConnectionWeight();
|
int weightA = a.getConnectionWeight();
|
||||||
int Wb = b.getConnectionWeight();
|
int weightB = b.getConnectionWeight();
|
||||||
|
|
||||||
// Net weight of connections
|
// Calculated weight of connections
|
||||||
int NWa = Ca * Wb;
|
int calcWeightA = connA * weightB;
|
||||||
int NWb = Cb * Wa;
|
int calcWeightB = connB * weightA;
|
||||||
|
|
||||||
// If net weights are equal, return difference in weight
|
// If calculated weights are equal, return difference in assigned weight
|
||||||
if (NWa == NWb)
|
if (calcWeightA == calcWeightB)
|
||||||
return (Wa - Wb);
|
return (weightA - weightB);
|
||||||
|
|
||||||
// Return different in net weights
|
// Return different in calculated weights
|
||||||
return (NWa - NWb);
|
return (calcWeightA - calcWeightB);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -174,18 +174,6 @@ public class MySQLGuacamoleProperties {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* The connection weight for connections in balancing groups.
|
|
||||||
*/
|
|
||||||
public static final IntegerGuacamoleProperty
|
|
||||||
MYSQL_DEFAULT_CONNECTION_WEIGHT =
|
|
||||||
new IntegerGuacamoleProperty() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() { return "mysql-default-connection-weight"; }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum number of concurrent connections to allow to any one
|
* The maximum number of concurrent connections to allow to any one
|
||||||
* connection group by an individual user. Zero denotes
|
* connection group by an individual user. Zero denotes
|
||||||
|
@@ -157,15 +157,6 @@ public class PostgreSQLGuacamoleProperties {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public static final IntegerGuacamoleProperty
|
|
||||||
POSTGRESQL_DEFAULT_CONNECTION_WEIGHT =
|
|
||||||
new IntegerGuacamoleProperty() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getName() { return "postgresql-default-connection-weight"; }
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum number of concurrent connections to allow to any one
|
* The maximum number of concurrent connections to allow to any one
|
||||||
* connection group. Zero denotes unlimited.
|
* connection group. Zero denotes unlimited.
|
||||||
|
Reference in New Issue
Block a user