GUACAMOLE-102: Finish adding connection weight attribute.

This commit is contained in:
Nick Couchman
2017-03-19 16:24:56 -04:00
committed by Nick Couchman
parent 025f77d1c4
commit 4aff2c1bb8
8 changed files with 36 additions and 4 deletions

View File

@@ -91,7 +91,7 @@ public abstract class JDBCEnvironment extends LocalEnvironment {
* @throws GuacamoleException * @throws GuacamoleException
* If an error occurs while retrieving the property. * If an error occurs while retrieving the property.
*/ */
public abstract int getConnectionWeight() throws GuacamoleException; public abstract int getDefaultConnectionWeight() throws GuacamoleException;
/** /**
* Returns the default maximum number of concurrent connections to allow to * Returns the default maximum number of concurrent connections to allow to

View File

@@ -119,7 +119,7 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
/** /**
* The connection weight for the WRR algorithm. * The connection weight for the WRR algorithm.
*/ */
public static final String CONNECTION_WEIGHT = "connection-weight"; public static final String CONNECTION_WEIGHT = "weight";
/** /**
* All attributes related to restricting user accounts, within a logical * All attributes related to restricting user accounts, within a logical
@@ -127,7 +127,8 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
*/ */
public static final Form CONCURRENCY_LIMITS = new Form("concurrency", Arrays.<Field>asList( public static final Form CONCURRENCY_LIMITS = new Form("concurrency", Arrays.<Field>asList(
new NumericField(MAX_CONNECTIONS_NAME), new NumericField(MAX_CONNECTIONS_NAME),
new NumericField(MAX_CONNECTIONS_PER_USER_NAME) new NumericField(MAX_CONNECTIONS_PER_USER_NAME),
new NumericField(CONNECTION_WEIGHT)
)); ));
/** /**

View File

@@ -19,6 +19,7 @@
"FIELD_HEADER_MAX_CONNECTIONS" : "Maximum number of connections:", "FIELD_HEADER_MAX_CONNECTIONS" : "Maximum number of connections:",
"FIELD_HEADER_MAX_CONNECTIONS_PER_USER" : "Maximum number of connections per user:", "FIELD_HEADER_MAX_CONNECTIONS_PER_USER" : "Maximum number of connections per user:",
"FIELD_HEADER_WEIGHT" : "Connection Weight for Load Balancing:",
"FIELD_HEADER_GUACD_HOSTNAME" : "Hostname:", "FIELD_HEADER_GUACD_HOSTNAME" : "Hostname:",
"FIELD_HEADER_GUACD_ENCRYPTION" : "Encryption:", "FIELD_HEADER_GUACD_ENCRYPTION" : "Encryption:",

View File

@@ -90,6 +90,7 @@ public class MySQLEnvironment extends JDBCEnvironment {
/** /**
* The default value for the connection weight for a connection in * The default value for the connection weight for a connection in
* a balancing group. * a balancing group.
*/
private int DEFAULT_CONNECTION_WEIGHT = 0; private int DEFAULT_CONNECTION_WEIGHT = 0;
/** /**

View File

@@ -181,7 +181,7 @@ public class MySQLGuacamoleProperties {
MYSQL_DEFAULT_CONNECTION_WEIGHT = MYSQL_DEFAULT_CONNECTION_WEIGHT =
new IntegerGuacamoleProperty() { new IntegerGuacamoleProperty() {
@Overide @Override
public String getName() { return "mysql-default-connection-weight"; } public String getName() { return "mysql-default-connection-weight"; }
}; };

View File

@@ -106,6 +106,9 @@ CREATE TABLE guacamole_connection (
max_connections integer, max_connections integer,
max_connections_per_user integer, max_connections_per_user integer,
-- Connection Weight
connection_weight integer,
-- Guacamole proxy (guacd) overrides -- Guacamole proxy (guacd) overrides
proxy_port integer, proxy_port integer,
proxy_hostname varchar(512), proxy_hostname varchar(512),

View File

@@ -0,0 +1,25 @@
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.
--
--
-- Add per-user password set date
--
ALTER TABLE guacamole_connection
ADD COLUMN connection_weight int;

View File

@@ -90,6 +90,7 @@ public class PostgreSQLEnvironment extends JDBCEnvironment {
/** /**
* The default value for the connection weight for a connection in * The default value for the connection weight for a connection in
* a balancing group. * a balancing group.
*/
private int DEFAULT_CONNECTION_WEIGHT = 0; private int DEFAULT_CONNECTION_WEIGHT = 0;
/** /**