mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-08 06:01:22 +00:00
GUACAMOLE-102: Merge support for weighted least-connections (WLC) balancing algorithm.
This commit is contained in:
@@ -81,7 +81,7 @@ public abstract class JDBCEnvironment extends LocalEnvironment {
|
|||||||
* If an error occurs while retrieving the property.
|
* If an error occurs while retrieving the property.
|
||||||
*/
|
*/
|
||||||
public abstract int getDefaultMaxConnections() throws GuacamoleException;
|
public abstract int getDefaultMaxConnections() throws GuacamoleException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the default maximum number of concurrent connections to allow to
|
* Returns the default maximum number of concurrent connections to allow to
|
||||||
* any one connection group, unless specified differently on an individual
|
* any one connection group, unless specified differently on an individual
|
||||||
|
@@ -54,6 +54,13 @@ public class ConnectionModel extends ChildObjectModel {
|
|||||||
*/
|
*/
|
||||||
private Integer maxConnectionsPerUser;
|
private Integer maxConnectionsPerUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The weight of the connection for the purposes of calculating
|
||||||
|
* WLC algorithm. null indicates nothing has been set, and anything less
|
||||||
|
* than 1 eliminates the system from being used for connections.
|
||||||
|
*/
|
||||||
|
private Integer connectionWeight;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The identifiers of all readable sharing profiles associated with this
|
* The identifiers of all readable sharing profiles associated with this
|
||||||
* connection.
|
* connection.
|
||||||
@@ -164,6 +171,31 @@ public class ConnectionModel extends ChildObjectModel {
|
|||||||
return maxConnectionsPerUser;
|
return maxConnectionsPerUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the connection weight for load balancing.
|
||||||
|
*
|
||||||
|
* @param connectionWeight
|
||||||
|
* The weight of the connection used in load balancing.
|
||||||
|
* The value is not required for the connection (null), and
|
||||||
|
* values less than 1 will prevent the connection from being
|
||||||
|
* used.
|
||||||
|
*/
|
||||||
|
public void setConnectionWeight(Integer connectionWeight) {
|
||||||
|
this.connectionWeight = connectionWeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the connection weight used in applying weighted
|
||||||
|
* load balancing algorithms.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* The connection weight used in applying weighted
|
||||||
|
* load balancing aglorithms.
|
||||||
|
*/
|
||||||
|
public Integer getConnectionWeight() {
|
||||||
|
return connectionWeight;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the maximum number of connections that can be established to this
|
* Sets the maximum number of connections that can be established to this
|
||||||
* connection concurrently by any one user.
|
* connection concurrently by any one user.
|
||||||
|
@@ -116,6 +116,11 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
*/
|
*/
|
||||||
public static final String MAX_CONNECTIONS_PER_USER_NAME = "max-connections-per-user";
|
public static final String MAX_CONNECTIONS_PER_USER_NAME = "max-connections-per-user";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The connection weight attribute used for weighted load balancing algorithms.
|
||||||
|
*/
|
||||||
|
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
|
||||||
* form.
|
* form.
|
||||||
@@ -125,12 +130,20 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
new NumericField(MAX_CONNECTIONS_PER_USER_NAME)
|
new NumericField(MAX_CONNECTIONS_PER_USER_NAME)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All attributes related to load balancing in a logical form.
|
||||||
|
*/
|
||||||
|
public static final Form LOAD_BALANCING = new Form("load-balancing", Arrays.<Field>asList(
|
||||||
|
new NumericField(CONNECTION_WEIGHT)
|
||||||
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All possible attributes of connection objects organized as individual,
|
* All possible attributes of connection objects organized as individual,
|
||||||
* logical forms.
|
* logical forms.
|
||||||
*/
|
*/
|
||||||
public static final Collection<Form> ATTRIBUTES = Collections.unmodifiableCollection(Arrays.asList(
|
public static final Collection<Form> ATTRIBUTES = Collections.unmodifiableCollection(Arrays.asList(
|
||||||
CONCURRENCY_LIMITS,
|
CONCURRENCY_LIMITS,
|
||||||
|
LOAD_BALANCING,
|
||||||
GUACD_PARAMETERS
|
GUACD_PARAMETERS
|
||||||
));
|
));
|
||||||
|
|
||||||
@@ -265,6 +278,9 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set connection weight
|
||||||
|
attributes.put(CONNECTION_WEIGHT, NumericField.format(getModel().getConnectionWeight()));
|
||||||
|
|
||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,6 +326,13 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
else
|
else
|
||||||
getModel().setProxyEncryptionMethod(null);
|
getModel().setProxyEncryptionMethod(null);
|
||||||
|
|
||||||
|
// Translate connection weight attribute
|
||||||
|
try { getModel().setConnectionWeight(NumericField.parse(attributes.get(CONNECTION_WEIGHT))); }
|
||||||
|
catch (NumberFormatException e) {
|
||||||
|
logger.warn("Not setting the connection weight: {}", e.getMessage());
|
||||||
|
logger.debug("Unable to parse numeric attribute.", e);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -393,6 +416,23 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
port != null ? port : defaultConfig.getPort(),
|
port != null ? port : defaultConfig.getPort(),
|
||||||
encryptionMethod != null ? encryptionMethod : defaultConfig.getEncryptionMethod()
|
encryptionMethod != null ? encryptionMethod : defaultConfig.getEncryptionMethod()
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the weight of the connection used in applying weighted
|
||||||
|
* load balancing algorithms, or a default of 1 if the
|
||||||
|
* attribute is undefined.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* The weight of the connection used in applying weighted
|
||||||
|
* load balancing algorithms.
|
||||||
|
*/
|
||||||
|
public int getConnectionWeight() {
|
||||||
|
|
||||||
|
Integer connectionWeight = getModel().getConnectionWeight();
|
||||||
|
if (connectionWeight == null)
|
||||||
|
return 1;
|
||||||
|
return connectionWeight;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,6 +33,8 @@ import org.apache.guacamole.GuacamoleResourceConflictException;
|
|||||||
import org.apache.guacamole.auth.jdbc.JDBCEnvironment;
|
import org.apache.guacamole.auth.jdbc.JDBCEnvironment;
|
||||||
import org.apache.guacamole.auth.jdbc.connectiongroup.ModeledConnectionGroup;
|
import org.apache.guacamole.auth.jdbc.connectiongroup.ModeledConnectionGroup;
|
||||||
import org.apache.guacamole.auth.jdbc.user.RemoteAuthenticatedUser;
|
import org.apache.guacamole.auth.jdbc.user.RemoteAuthenticatedUser;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -44,6 +46,11 @@ import org.apache.guacamole.auth.jdbc.user.RemoteAuthenticatedUser;
|
|||||||
public class RestrictedGuacamoleTunnelService
|
public class RestrictedGuacamoleTunnelService
|
||||||
extends AbstractGuacamoleTunnelService {
|
extends AbstractGuacamoleTunnelService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logger for this class.
|
||||||
|
*/
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(RestrictedGuacamoleTunnelService.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The environment of the Guacamole server.
|
* The environment of the Guacamole server.
|
||||||
*/
|
*/
|
||||||
@@ -180,8 +187,24 @@ public class RestrictedGuacamoleTunnelService
|
|||||||
@Override
|
@Override
|
||||||
public int compare(ModeledConnection a, ModeledConnection b) {
|
public int compare(ModeledConnection a, ModeledConnection b) {
|
||||||
|
|
||||||
return getActiveConnections(a).size()
|
// Active connections
|
||||||
- getActiveConnections(b).size();
|
int connA = getActiveConnections(a).size();
|
||||||
|
int connB = getActiveConnections(b).size();
|
||||||
|
|
||||||
|
// Assigned weight
|
||||||
|
int weightA = a.getConnectionWeight();
|
||||||
|
int weightB = b.getConnectionWeight();
|
||||||
|
|
||||||
|
// Calculated weight of connections
|
||||||
|
int calcWeightA = connA * weightB;
|
||||||
|
int calcWeightB = connB * weightA;
|
||||||
|
|
||||||
|
// If calculated weights are equal, return difference in assigned weight
|
||||||
|
if (calcWeightA == calcWeightB)
|
||||||
|
return (weightA - weightB);
|
||||||
|
|
||||||
|
// Return different in calculated weights
|
||||||
|
return (calcWeightA - calcWeightB);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -193,6 +216,12 @@ public class RestrictedGuacamoleTunnelService
|
|||||||
// Return the first unreserved connection
|
// Return the first unreserved connection
|
||||||
for (ModeledConnection connection : sortedConnections) {
|
for (ModeledConnection connection : sortedConnections) {
|
||||||
|
|
||||||
|
// If connection weight is less than 1 this host is disabled and should not be used.
|
||||||
|
if (connection.getConnectionWeight() < 1) {
|
||||||
|
logger.debug("Weight for {} is < 1, connection will be skipped.", connection.getName());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// 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());
|
||||||
if (tryAdd(activeSeats, seat,
|
if (tryAdd(activeSeats, seat,
|
||||||
|
@@ -20,6 +20,8 @@
|
|||||||
"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:",
|
||||||
|
|
||||||
"FIELD_HEADER_GUACD_HOSTNAME" : "Hostname:",
|
"FIELD_HEADER_GUACD_HOSTNAME" : "Hostname:",
|
||||||
"FIELD_HEADER_GUACD_ENCRYPTION" : "Encryption:",
|
"FIELD_HEADER_GUACD_ENCRYPTION" : "Encryption:",
|
||||||
"FIELD_HEADER_GUACD_PORT" : "Port:",
|
"FIELD_HEADER_GUACD_PORT" : "Port:",
|
||||||
@@ -28,8 +30,9 @@
|
|||||||
"FIELD_OPTION_GUACD_ENCRYPTION_NONE" : "None (unencrypted)",
|
"FIELD_OPTION_GUACD_ENCRYPTION_NONE" : "None (unencrypted)",
|
||||||
"FIELD_OPTION_GUACD_ENCRYPTION_SSL" : "SSL / TLS",
|
"FIELD_OPTION_GUACD_ENCRYPTION_SSL" : "SSL / TLS",
|
||||||
|
|
||||||
"SECTION_HEADER_CONCURRENCY" : "Concurrency Limits",
|
"SECTION_HEADER_CONCURRENCY" : "Concurrency Limits",
|
||||||
"SECTION_HEADER_GUACD" : "Guacamole Proxy Parameters (guacd)"
|
"SECTION_HEADER_LOAD_BALANCING" : "Load Balancing",
|
||||||
|
"SECTION_HEADER_GUACD" : "Guacamole Proxy Parameters (guacd)"
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@@ -34,7 +34,6 @@ CREATE TABLE `guacamole_connection_group` (
|
|||||||
`max_connections_per_user` int(11),
|
`max_connections_per_user` int(11),
|
||||||
`enable_session_affinity` boolean NOT NULL DEFAULT 0,
|
`enable_session_affinity` boolean NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
|
||||||
PRIMARY KEY (`connection_group_id`),
|
PRIMARY KEY (`connection_group_id`),
|
||||||
UNIQUE KEY `connection_group_name_parent` (`connection_group_name`, `parent_id`),
|
UNIQUE KEY `connection_group_name_parent` (`connection_group_name`, `parent_id`),
|
||||||
|
|
||||||
@@ -65,6 +64,10 @@ CREATE TABLE `guacamole_connection` (
|
|||||||
-- Concurrency limits
|
-- Concurrency limits
|
||||||
`max_connections` int(11),
|
`max_connections` int(11),
|
||||||
`max_connections_per_user` int(11),
|
`max_connections_per_user` int(11),
|
||||||
|
|
||||||
|
-- Connection weight
|
||||||
|
`connection_weight` int(11),
|
||||||
|
|
||||||
|
|
||||||
PRIMARY KEY (`connection_id`),
|
PRIMARY KEY (`connection_id`),
|
||||||
UNIQUE KEY `connection_name_parent` (`connection_name`, `parent_id`),
|
UNIQUE KEY `connection_name_parent` (`connection_name`, `parent_id`),
|
||||||
|
@@ -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-connection weight
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE guacamole_connection
|
||||||
|
ADD COLUMN connection_weight int(11);
|
@@ -37,6 +37,7 @@
|
|||||||
<result column="proxy_port" property="proxyPort" jdbcType="INTEGER"/>
|
<result column="proxy_port" property="proxyPort" jdbcType="INTEGER"/>
|
||||||
<result column="proxy_encryption_method" property="proxyEncryptionMethod" jdbcType="VARCHAR"
|
<result column="proxy_encryption_method" property="proxyEncryptionMethod" jdbcType="VARCHAR"
|
||||||
javaType="org.apache.guacamole.net.auth.GuacamoleProxyConfiguration$EncryptionMethod"/>
|
javaType="org.apache.guacamole.net.auth.GuacamoleProxyConfiguration$EncryptionMethod"/>
|
||||||
|
<result column="connection_weight" property="connectionWeight" jdbcType="INTEGER"/>
|
||||||
|
|
||||||
<!-- Associated sharing profiles -->
|
<!-- Associated sharing profiles -->
|
||||||
<collection property="sharingProfileIdentifiers" resultSet="sharingProfiles" ofType="java.lang.String"
|
<collection property="sharingProfileIdentifiers" resultSet="sharingProfiles" ofType="java.lang.String"
|
||||||
@@ -95,7 +96,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE connection_id IN
|
WHERE connection_id IN
|
||||||
<foreach collection="identifiers" item="identifier"
|
<foreach collection="identifiers" item="identifier"
|
||||||
@@ -126,7 +128,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id
|
JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id
|
||||||
WHERE guacamole_connection.connection_id IN
|
WHERE guacamole_connection.connection_id IN
|
||||||
@@ -162,7 +165,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE
|
WHERE
|
||||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if>
|
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=VARCHAR}</if>
|
||||||
@@ -189,7 +193,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
#{object.name,jdbcType=VARCHAR},
|
#{object.name,jdbcType=VARCHAR},
|
||||||
@@ -199,7 +204,8 @@
|
|||||||
#{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
#{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
||||||
#{object.proxyHostname,jdbcType=VARCHAR},
|
#{object.proxyHostname,jdbcType=VARCHAR},
|
||||||
#{object.proxyPort,jdbcType=INTEGER},
|
#{object.proxyPort,jdbcType=INTEGER},
|
||||||
#{object.proxyEncryptionMethod,jdbcType=VARCHAR}
|
#{object.proxyEncryptionMethod,jdbcType=VARCHAR},
|
||||||
|
#{object.connectionWeight,jdbcType=INTEGER}
|
||||||
)
|
)
|
||||||
|
|
||||||
</insert>
|
</insert>
|
||||||
@@ -214,7 +220,8 @@
|
|||||||
max_connections_per_user = #{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
max_connections_per_user = #{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
||||||
proxy_hostname = #{object.proxyHostname,jdbcType=VARCHAR},
|
proxy_hostname = #{object.proxyHostname,jdbcType=VARCHAR},
|
||||||
proxy_port = #{object.proxyPort,jdbcType=INTEGER},
|
proxy_port = #{object.proxyPort,jdbcType=INTEGER},
|
||||||
proxy_encryption_method = #{object.proxyEncryptionMethod,jdbcType=VARCHAR}
|
proxy_encryption_method = #{object.proxyEncryptionMethod,jdbcType=VARCHAR},
|
||||||
|
connection_weight = #{object.connectionWeight,jdbcType=INTEGER}
|
||||||
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}
|
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
@@ -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),
|
||||||
|
@@ -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-connection weight
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE guacamole_connection
|
||||||
|
ADD COLUMN connection_weight int;
|
@@ -37,6 +37,7 @@
|
|||||||
<result column="proxy_port" property="proxyPort" jdbcType="INTEGER"/>
|
<result column="proxy_port" property="proxyPort" jdbcType="INTEGER"/>
|
||||||
<result column="proxy_encryption_method" property="proxyEncryptionMethod" jdbcType="VARCHAR"
|
<result column="proxy_encryption_method" property="proxyEncryptionMethod" jdbcType="VARCHAR"
|
||||||
javaType="org.apache.guacamole.net.auth.GuacamoleProxyConfiguration$EncryptionMethod"/>
|
javaType="org.apache.guacamole.net.auth.GuacamoleProxyConfiguration$EncryptionMethod"/>
|
||||||
|
<result column="connection_weight" property="connectionWeight" jdbcType="INTEGER"/>
|
||||||
|
|
||||||
<!-- Associated sharing profiles -->
|
<!-- Associated sharing profiles -->
|
||||||
<collection property="sharingProfileIdentifiers" resultSet="sharingProfiles" ofType="java.lang.String"
|
<collection property="sharingProfileIdentifiers" resultSet="sharingProfiles" ofType="java.lang.String"
|
||||||
@@ -95,7 +96,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE connection_id IN
|
WHERE connection_id IN
|
||||||
<foreach collection="identifiers" item="identifier"
|
<foreach collection="identifiers" item="identifier"
|
||||||
@@ -126,7 +128,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id
|
JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id
|
||||||
WHERE guacamole_connection.connection_id IN
|
WHERE guacamole_connection.connection_id IN
|
||||||
@@ -162,7 +165,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
FROM guacamole_connection
|
FROM guacamole_connection
|
||||||
WHERE
|
WHERE
|
||||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
||||||
@@ -189,7 +193,8 @@
|
|||||||
max_connections_per_user,
|
max_connections_per_user,
|
||||||
proxy_hostname,
|
proxy_hostname,
|
||||||
proxy_port,
|
proxy_port,
|
||||||
proxy_encryption_method
|
proxy_encryption_method,
|
||||||
|
connection_weight
|
||||||
)
|
)
|
||||||
VALUES (
|
VALUES (
|
||||||
#{object.name,jdbcType=VARCHAR},
|
#{object.name,jdbcType=VARCHAR},
|
||||||
@@ -199,7 +204,8 @@
|
|||||||
#{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
#{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
||||||
#{object.proxyHostname,jdbcType=VARCHAR},
|
#{object.proxyHostname,jdbcType=VARCHAR},
|
||||||
#{object.proxyPort,jdbcType=INTEGER},
|
#{object.proxyPort,jdbcType=INTEGER},
|
||||||
#{object.proxyEncryptionMethod,jdbcType=VARCHAR}::guacamole_proxy_encryption_method
|
#{object.proxyEncryptionMethod,jdbcType=VARCHAR}::guacamole_proxy_encryption_method,
|
||||||
|
#{object.connectionWeight,jdbcType=INTEGER}
|
||||||
)
|
)
|
||||||
|
|
||||||
</insert>
|
</insert>
|
||||||
@@ -214,7 +220,8 @@
|
|||||||
max_connections_per_user = #{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
max_connections_per_user = #{object.maxConnectionsPerUser,jdbcType=INTEGER},
|
||||||
proxy_hostname = #{object.proxyHostname,jdbcType=VARCHAR},
|
proxy_hostname = #{object.proxyHostname,jdbcType=VARCHAR},
|
||||||
proxy_port = #{object.proxyPort,jdbcType=INTEGER},
|
proxy_port = #{object.proxyPort,jdbcType=INTEGER},
|
||||||
proxy_encryption_method = #{object.proxyEncryptionMethod,jdbcType=VARCHAR}::guacamole_proxy_encryption_method
|
proxy_encryption_method = #{object.proxyEncryptionMethod,jdbcType=VARCHAR}::guacamole_proxy_encryption_method,
|
||||||
|
connection_weight = #{object.connectionWeight,jdbcType=INTEGER}
|
||||||
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}::integer
|
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}::integer
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user