diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java index b98e00653..681ec4057 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/ConnectionDirectory.java @@ -224,7 +224,7 @@ public class ConnectionDirectory implements Directory{ ConnectionParameterExample connectionParameterExample = new ConnectionParameterExample(); connectionParameterExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); connectionParameterDAO.deleteByExample(connectionParameterExample); - + // delete all permissions that refer to this connection ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample(); connectionPermissionExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID()); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java index 99de9fdc8..d20315f2e 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/MySQLConstants.java @@ -45,25 +45,25 @@ import net.sourceforge.guacamole.net.auth.permission.UserPermission; * @author James Muehlner */ public final class MySQLConstants { - + /** * This class should not be instantiated. */ private MySQLConstants() {} - + // Permission constants public static final String USER_READ = UserPermission.Type.READ.name(); public static final String USER_UPDATE = UserPermission.Type.UPDATE.name(); public static final String USER_DELETE = UserPermission.Type.DELETE.name(); public static final String USER_ADMINISTER = UserPermission.Type.ADMINISTER.name(); public static final String USER_CREATE = UserDirectoryPermission.Type.CREATE.name(); - + public static final String CONNECTION_READ = ConnectionPermission.Type.READ.name(); public static final String CONNECTION_UPDATE = ConnectionPermission.Type.UPDATE.name(); public static final String CONNECTION_DELETE = ConnectionPermission.Type.DELETE.name(); public static final String CONNECTION_ADMINISTER = ConnectionPermission.Type.ADMINISTER.name(); public static final String CONNECTION_CREATE = ConnectionDirectoryPermission.Type.CREATE.name(); - + public static final String SYSTEM_USER_CREATE = "USER_CREATE"; public static final String SYSTEM_CONNECTION_CREATE = "CONNECTION_CREATE"; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java index 98f3c2b28..658638268 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ConfigurationTranslationUtility.java @@ -41,48 +41,48 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; /** - * Provides functions for translating between GuacamoleConfiguration objects + * Provides functions for translating between GuacamoleConfiguration objects * and a collection of ConnectionParameter database records. * @author James Muehlner */ public class ConfigurationTranslationUtility { - + /** * Get a GuacamoleConfiguration based on the provided protocol and parameters. * @param protocol the protocol used (VNC, RDP, etc) * @param parameters the parameter database records to translate - * @return + * @return */ public GuacamoleConfiguration getConfiguration(String protocol, Iterable parameters) { GuacamoleConfiguration configuration = new GuacamoleConfiguration(); configuration.setProtocol(protocol); - + for(ConnectionParameter parameter : parameters) { configuration.setParameter(parameter.getParameter_name(), parameter.getParameter_value()); } - + return configuration; } - + /** * Creates a list of ConnectionParameter database records based on the provided connectionID and GuacamoleConfiguration. * @param connectionID the ID of the connection that these parameters are for * @param configuration the configuration to pull the parameter values from - * @return + * @return */ public List getConnectionParameters(int connectionID, GuacamoleConfiguration configuration) { List connectionParameters = new ArrayList(); - + for(String parameterName : configuration.getParameterNames()) { ConnectionParameter connectionParameter = new ConnectionParameter(); String parameterValue = configuration.getParameter(parameterName); connectionParameter.setConnection_id(connectionID); connectionParameter.setParameter_name(parameterName); connectionParameter.setParameter_value(parameterValue); - + connectionParameters.add(connectionParameter); } - + return connectionParameters; } } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java index 0ebe3d819..90c4ed083 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/PasswordEncryptionUtility.java @@ -42,7 +42,7 @@ import net.sourceforge.guacamole.net.auth.Credentials; * @author James Muehlner */ public interface PasswordEncryptionUtility { - + /** * Checks if the provided Credentials are correct, compared with what the values from the database. * @param credentials @@ -52,7 +52,7 @@ public interface PasswordEncryptionUtility { * @return true if the provided credentials match what's in the database for that user. */ public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, byte[] dbSalt); - + /** * Creates a password hash based on the provided username, password, and salt. * @param username diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java index a449e7154..916ea05ce 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/ProviderUtility.java @@ -63,59 +63,59 @@ import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; public class ProviderUtility { @Inject UserMapper userDAO; - + @Inject ConnectionMapper connectionDAO; - + @Inject ConnectionHistoryMapper connectionHistoryDAO; - + @Inject Provider mySQLUserProvider; - + @Inject Provider mySQLConnectionProvider; - + @Inject Provider mySQLConnectionRecordProvider; - + @Inject Provider mySQLGuacamoleSocketProvider; - + /** * Create a new user based on the provided object. * @param user * @return the new MySQLUser object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLUser getNewMySQLUser(User user) throws GuacamoleException { MySQLUser mySQLUser = mySQLUserProvider.get(); mySQLUser.initNew(user); return mySQLUser; } - + /** * Get the user based on the username of the provided object. * @param user * @return the new MySQLUser object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLUser getExistingMySQLUser(User user) throws GuacamoleException { return getExistingMySQLUser(user.getUsername()); } - + /** * Get the user based on the username of the provided object. * @param name * @return the new MySQLUser object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLUser getExistingMySQLUser(String name) throws GuacamoleException { MySQLUser mySQLUser = mySQLUserProvider.get(); mySQLUser.initExisting(name); return mySQLUser; } - + /** * Get an existing MySQLUser from a user database record. * @param user @@ -126,7 +126,7 @@ public class ProviderUtility { mySQLUser.init(user); return mySQLUser; } - + /** * Get an existing MySQLUser from a user ID. * @param id @@ -140,42 +140,42 @@ public class ProviderUtility { return null; return getExistingMySQLUser(users.get(0)); } - - + + /** * Create a new connection based on the provided object. * @param connection * @return the new Connection object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLConnection getNewMySQLConnection(Connection connection) throws GuacamoleException { MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); mySQLConnection.initNew(connection); return mySQLConnection; } - + /** * Get the connection based on the connection name of the provided object. * @param connection * @return the new Connection object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLConnection getExistingMySQLConnection(Connection connection) throws GuacamoleException { return getExistingMySQLConnection(connection.getIdentifier()); } - + /** * Get the connection based on the connection name of the provided object. * @param name * @return the new Connection object. - * @throws GuacamoleException + * @throws GuacamoleException */ public MySQLConnection getExistingMySQLConnection(String name) throws GuacamoleException { MySQLConnection mySQLConnection = mySQLConnectionProvider.get(); mySQLConnection.initExisting(name); return mySQLConnection; } - + /** * Get an existing MySQLConnection from a connection database record. * @param connection @@ -186,7 +186,7 @@ public class ProviderUtility { mySQLConnection.init(connection); return mySQLConnection; } - + /** * Get an existing MySQLConnection from a connection ID. * @param id @@ -200,7 +200,7 @@ public class ProviderUtility { return null; return getExistingMySQLConnection(connections.get(0)); } - + /** * Gets a list of existing MySQLConnectionRecord from the database. These represent * the history records of the connection. @@ -219,7 +219,7 @@ public class ProviderUtility { } return connectionRecords; } - + /** * Create a MySQLConnectionRecord object around a single ConnectionHistory database record. * @param history @@ -230,12 +230,12 @@ public class ProviderUtility { record.init(history); return record; } - + /** * Create a MySQLGuacamoleSocket using the provided ConfiguredGuacamoleSocket and connection ID. * @param socket * @param connectionID - * @return + * @return */ public MySQLGuacamoleSocket getMySQLGuacamoleSocket(ConfiguredGuacamoleSocket socket, int connectionID) { MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java index 3b31322d5..f2c38c477 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/utility/SecureRandomSaltUtility.java @@ -42,9 +42,9 @@ import java.security.SecureRandom; * @author James Muehlner */ public class SecureRandomSaltUtility implements SaltUtility { - + SecureRandom secureRandom = new SecureRandom(); - + @Override public byte[] generateSalt() { byte[] salt = new byte[32];