Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/incubator-guacamole-client/pull/161#discussion_r120145222
--- 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 --
Java will do this automatically, by the way. If you have something like:
Integer foo = 2; // Automatically wrapped within Integer by the Java
compiler
int bar = foo; // Automatically unwrapped by the Java compiler
things happen magically thanks to autoboxing / autounboxing:
https://docs.oracle.com/javase/tutorial/java/data/autoboxing.html
---
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.
---