Github user necouchman commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-client/pull/161#discussion_r120185733
--- Diff:
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/connection/ConnectionModel.java
---
@@ -165,6 +172,33 @@ public Integer getMaxConnectionsPerUser() {
}
/**
+ * Sets the connection weight.
+ *
+ * @param connectionWeight
+ * The weight of the connection. null is acceptable, negative
values
+ * indicate that the connection should not be used.
+ */
+ public void setConnectionWeight(Integer connectionWeight) {
+ this.connectionWeight = connectionWeight;
+ }
+
+ /**
+ * Returns the connection weight used in calculating the
+ * weighted algorithms.
+ *
+ * @return
+ * The connection weight as an int. If the weight is
+ * null a default weight of 1 is returned. Zero and
+ * negative numbers are used to indicate the system is
+ * unavailable.
+ */
+ public int getConnectionWeight() {
+ if (connectionWeight == null)
+ return 1;
+ return connectionWeight.intValue();
--- End diff --
I think I ran into an issue with the automatic (un)boxing stuff and went
that route, but it seems to be fine, now, so I've cleaned that up. Also moved
the null check/default code to the ModeledConnection class.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---