GUACAMOLE-919: Fix style issues, improve comments.

This commit is contained in:
Douglas Heriot
2020-07-08 14:02:46 +10:00
parent 0528ca0564
commit 6cf9787f7b
3 changed files with 13 additions and 12 deletions

View File

@@ -72,7 +72,7 @@ public class PostgreSQLAuthenticationProviderModule implements Module {
// Only set if > 0. Underlying backend does not take 0 as not-set. // Only set if > 0. Underlying backend does not take 0 as not-set.
int defaultStatementTimeout = environment.getPostgreSQLDefaultStatementTimeout(); int defaultStatementTimeout = environment.getPostgreSQLDefaultStatementTimeout();
if(defaultStatementTimeout > 0) { if (defaultStatementTimeout > 0) {
myBatisProperties.setProperty("mybatis.configuration.defaultStatementTimeout", String.valueOf(defaultStatementTimeout)); myBatisProperties.setProperty("mybatis.configuration.defaultStatementTimeout", String.valueOf(defaultStatementTimeout));
} }

View File

@@ -49,17 +49,18 @@ public class PostgreSQLEnvironment extends JDBCEnvironment {
private static final int DEFAULT_PORT = 5432; private static final int DEFAULT_PORT = 5432;
/** /**
* The default defaultStatementTimeout (in seconds), * The default number of seconds the driver will wait for a response from
* if POSTGRESQL_DEFAULT_STATEMENT_TIMEOUT is not specified. * the database. A value of 0 (the default) means the timeout is disabled.
* Default to 0 (no timeout, property won't be set)
* https://mybatis.org/mybatis-3/configuration.html
*/ */
private static final int DEFAULT_DEFAULT_STATEMENT_TIMEOUT = 0; private static final int DEFAULT_STATEMENT_TIMEOUT = 0;
/** /**
* The default socketTimeout (in seconds), if POSTGRESQL_SOCKET_TIMEOUT is not specified. * The default timeout (in seconds) used for socket read operations.
* Default to 0 (no timeout) * If reading from the server takes longer than this value, the
* https://jdbc.postgresql.org/documentation/head/connect.html * connection is closed. This can be used to handle network problems
* such as a dropped connection to the database. Similar to
* DEFAULT_STATEMENT_TIMEOUT, it will also abort queries that take too
* long. The value 0 (the default) means the timeout is disabled.
*/ */
private static final int DEFAULT_SOCKET_TIMEOUT = 0; private static final int DEFAULT_SOCKET_TIMEOUT = 0;
@@ -279,7 +280,7 @@ public class PostgreSQLEnvironment extends JDBCEnvironment {
public int getPostgreSQLDefaultStatementTimeout() throws GuacamoleException { public int getPostgreSQLDefaultStatementTimeout() throws GuacamoleException {
return getProperty( return getProperty(
PostgreSQLGuacamoleProperties.POSTGRESQL_DEFAULT_STATEMENT_TIMEOUT, PostgreSQLGuacamoleProperties.POSTGRESQL_DEFAULT_STATEMENT_TIMEOUT,
DEFAULT_DEFAULT_STATEMENT_TIMEOUT DEFAULT_STATEMENT_TIMEOUT
); );
} }

View File

@@ -95,7 +95,7 @@ public class PostgreSQLGuacamoleProperties {
}; };
/** /**
* Sets the number of seconds the driver will wait for * The number of seconds the driver will wait for
* a response from the database. * a response from the database.
*/ */
public static final IntegerGuacamoleProperty public static final IntegerGuacamoleProperty
@@ -107,7 +107,7 @@ public class PostgreSQLGuacamoleProperties {
}; };
/** /**
* Sets the number of seconds the driver will wait in a read() call * The number of seconds the driver will wait in a read() call
* on the TCP connection to the database. * on the TCP connection to the database.
*/ */
public static final IntegerGuacamoleProperty public static final IntegerGuacamoleProperty