Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
GUAC-1373: Add default constants. Clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-jumper committed Nov 12, 2015
1 parent 920ce67 commit 5cb2283
Showing 1 changed file with 17 additions and 3 deletions.
Expand Up @@ -41,7 +41,18 @@ public class MySQLEnvironment extends JDBCEnvironment {
private static final Logger logger = LoggerFactory.getLogger(MySQLEnvironment.class);

/**
* Constructs a new MysqlEnvironment.
* The default host to connect to, if MYSQL_HOSTNAME is not specified.
*/
private static final String DEFAULT_HOSTNAME = "localhost";

/**
* The default port to connect to, if MYSQL_PORT is not specified.
*/
private static final int DEFAULT_PORT = 3306;

/**
* Constructs a new MySQLEnvironment, providing access to MySQL-specific
* configuration options.
*
* @throws GuacamoleException
* If an error occurs while setting up the underlying JDBCEnvironment.
Expand Down Expand Up @@ -238,7 +249,10 @@ public int getDefaultMaxGroupConnectionsPerUser() throws GuacamoleException {
* If an error occurs while retrieving the property value.
*/
public String getMySQLHostname() throws GuacamoleException {
return getProperty(MySQLGuacamoleProperties.MYSQL_HOSTNAME, "localhost");
return getProperty(
MySQLGuacamoleProperties.MYSQL_HOSTNAME,
DEFAULT_HOSTNAME
);
}

/**
Expand All @@ -253,7 +267,7 @@ public String getMySQLHostname() throws GuacamoleException {
* If an error occurs while retrieving the property value.
*/
public int getMySQLPort() throws GuacamoleException {
return getProperty(MySQLGuacamoleProperties.MYSQL_PORT, 3306);
return getProperty(MySQLGuacamoleProperties.MYSQL_PORT, DEFAULT_PORT);
}

/**
Expand Down

0 comments on commit 5cb2283

Please sign in to comment.