mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-317: Expose "failover-only" attribute for connections.
This commit is contained in:
@@ -32,6 +32,7 @@ import org.apache.guacamole.auth.jdbc.tunnel.GuacamoleTunnelService;
|
|||||||
import org.apache.guacamole.GuacamoleException;
|
import org.apache.guacamole.GuacamoleException;
|
||||||
import org.apache.guacamole.auth.jdbc.JDBCEnvironment;
|
import org.apache.guacamole.auth.jdbc.JDBCEnvironment;
|
||||||
import org.apache.guacamole.auth.jdbc.base.ModeledChildDirectoryObject;
|
import org.apache.guacamole.auth.jdbc.base.ModeledChildDirectoryObject;
|
||||||
|
import org.apache.guacamole.form.BooleanField;
|
||||||
import org.apache.guacamole.form.EnumField;
|
import org.apache.guacamole.form.EnumField;
|
||||||
import org.apache.guacamole.form.Field;
|
import org.apache.guacamole.form.Field;
|
||||||
import org.apache.guacamole.form.Form;
|
import org.apache.guacamole.form.Form;
|
||||||
@@ -121,6 +122,13 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
*/
|
*/
|
||||||
public static final String CONNECTION_WEIGHT = "weight";
|
public static final String CONNECTION_WEIGHT = "weight";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name of the attribute which controls whether the connection should
|
||||||
|
* be used as a spare only (all other non-spare connections within the same
|
||||||
|
* balancing group should be preferred).
|
||||||
|
*/
|
||||||
|
public static final String FAILOVER_ONLY_NAME = "failover-only";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All attributes related to restricting user accounts, within a logical
|
* All attributes related to restricting user accounts, within a logical
|
||||||
* form.
|
* form.
|
||||||
@@ -134,7 +142,8 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
* All attributes related to load balancing in a logical form.
|
* All attributes related to load balancing in a logical form.
|
||||||
*/
|
*/
|
||||||
public static final Form LOAD_BALANCING = new Form("load-balancing", Arrays.<Field>asList(
|
public static final Form LOAD_BALANCING = new Form("load-balancing", Arrays.<Field>asList(
|
||||||
new NumericField(CONNECTION_WEIGHT)
|
new NumericField(CONNECTION_WEIGHT),
|
||||||
|
new BooleanField(FAILOVER_ONLY_NAME, "true")
|
||||||
));
|
));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -281,6 +290,9 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
// Set connection weight
|
// Set connection weight
|
||||||
attributes.put(CONNECTION_WEIGHT, NumericField.format(getModel().getConnectionWeight()));
|
attributes.put(CONNECTION_WEIGHT, NumericField.format(getModel().getConnectionWeight()));
|
||||||
|
|
||||||
|
// Set whether connection is failover-only
|
||||||
|
attributes.put(FAILOVER_ONLY_NAME, getModel().isFailoverOnly() ? "true" : null);
|
||||||
|
|
||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,6 +345,9 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
logger.debug("Unable to parse numeric attribute.", e);
|
logger.debug("Unable to parse numeric attribute.", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Translate failover-only attribute
|
||||||
|
getModel().setFailoverOnly("true".equals(attributes.get(FAILOVER_ONLY_NAME)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -20,6 +20,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_FAILOVER_ONLY" : "Use for failover only:",
|
||||||
"FIELD_HEADER_WEIGHT" : "Connection weight:",
|
"FIELD_HEADER_WEIGHT" : "Connection weight:",
|
||||||
|
|
||||||
"FIELD_HEADER_GUACD_HOSTNAME" : "Hostname:",
|
"FIELD_HEADER_GUACD_HOSTNAME" : "Hostname:",
|
||||||
|
Reference in New Issue
Block a user