mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-31 09:03:21 +00:00 
			
		
		
		
	Ticket #269: The utility classes should more properly be known as services.
This commit is contained in:
		| @@ -53,8 +53,8 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; | ||||
| import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; | ||||
| import org.mybatis.guice.transactional.Transactional; | ||||
|  | ||||
| @@ -71,10 +71,10 @@ public class ConnectionDirectory implements Directory<String, Connection>{ | ||||
|     private MySQLUser user; | ||||
|  | ||||
|     @Inject | ||||
|     PermissionCheckUtility permissionCheckUtility; | ||||
|     PermissionCheckService permissionCheckUtility; | ||||
|  | ||||
|     @Inject | ||||
|     ProviderUtility providerUtility; | ||||
|     ProviderService providerUtility; | ||||
|  | ||||
|     @Inject | ||||
|     ConnectionMapper connectionDAO; | ||||
|   | ||||
| @@ -55,13 +55,13 @@ import net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.SecureRandomSaltUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.Sha256PasswordEncryptionUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.SecureRandomSaltService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.Sha256PasswordEncryptionService; | ||||
| import net.sourceforge.guacamole.properties.GuacamoleProperties; | ||||
| import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; | ||||
| import org.mybatis.guice.MyBatisModule; | ||||
| @@ -154,11 +154,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider { | ||||
|                     bind(MySQLUserContext.class); | ||||
|                     bind(UserDirectory.class); | ||||
|                     bind(MySQLUser.class); | ||||
|                     bind(SaltUtility.class).to(SecureRandomSaltUtility.class); | ||||
|                     bind(PasswordEncryptionUtility.class).to(Sha256PasswordEncryptionUtility.class); | ||||
|                     bind(PermissionCheckUtility.class); | ||||
|                     bind(ProviderUtility.class); | ||||
|                     bind(ConfigurationTranslationUtility.class); | ||||
|                     bind(SaltService.class).to(SecureRandomSaltService.class); | ||||
|                     bind(PasswordEncryptionService.class).to(Sha256PasswordEncryptionService.class); | ||||
|                     bind(PermissionCheckService.class); | ||||
|                     bind(ProviderService.class); | ||||
|                     bind(ConfigurationTranslationService.class); | ||||
|                     bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); | ||||
|  | ||||
|                 } | ||||
|   | ||||
| @@ -48,8 +48,8 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.properties.MySQLGuacamoleProperties; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; | ||||
| import net.sourceforge.guacamole.properties.GuacamoleProperties; | ||||
| import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; | ||||
| import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; | ||||
| @@ -68,13 +68,13 @@ public class MySQLConnection implements Connection { | ||||
|     ConnectionParameterMapper connectionParameterDAO; | ||||
|  | ||||
|     @Inject | ||||
|     ProviderUtility providerUtility; | ||||
|     ProviderService providerUtility; | ||||
|  | ||||
|     @Inject | ||||
|     ActiveConnectionSet activeConnectionSet; | ||||
|  | ||||
|     @Inject | ||||
|     ConfigurationTranslationUtility configurationTranslationUtility; | ||||
|     ConfigurationTranslationService configurationTranslationUtility; | ||||
|  | ||||
|     private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection; | ||||
|  | ||||
|   | ||||
| @@ -45,7 +45,7 @@ import net.sourceforge.guacamole.net.auth.User; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; | ||||
|  | ||||
| /** | ||||
|  * A ConnectionRecord which is based on data stored in MySQL. | ||||
| @@ -75,7 +75,7 @@ public class MySQLConnectionRecord implements ConnectionRecord { | ||||
|      * Service for creating and retrieving objects. | ||||
|      */ | ||||
|     @Inject | ||||
|     ProviderUtility providerUtility; | ||||
|     ProviderService providerUtility; | ||||
|  | ||||
|     /** | ||||
|      * Initialize this MySQLConnectionRecord with the database record it | ||||
|   | ||||
| @@ -46,9 +46,9 @@ import net.sourceforge.guacamole.net.auth.User; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.SaltService; | ||||
| import net.sourceforge.guacamole.net.auth.permission.Permission; | ||||
|  | ||||
| /** | ||||
| @@ -63,13 +63,13 @@ public class MySQLUser implements User { | ||||
|     UserMapper userDAO; | ||||
|  | ||||
|     @Inject | ||||
|     PasswordEncryptionUtility passwordUtility; | ||||
|     PasswordEncryptionService passwordUtility; | ||||
|  | ||||
|     @Inject | ||||
|     SaltUtility saltUtility; | ||||
|     SaltService saltUtility; | ||||
|  | ||||
|     @Inject | ||||
|     PermissionCheckUtility permissionCheckUtility; | ||||
|     PermissionCheckService permissionCheckUtility; | ||||
|  | ||||
|     Set<Permission> permissions; | ||||
|  | ||||
|   | ||||
| @@ -63,8 +63,8 @@ import net.sourceforge.guacamole.net.auth.mysql.model.User; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService; | ||||
| import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService; | ||||
| import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; | ||||
| import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; | ||||
| import net.sourceforge.guacamole.net.auth.permission.Permission; | ||||
| @@ -119,14 +119,14 @@ public class UserDirectory implements Directory<String, net.sourceforge.guacamol | ||||
|      * Utility class for checking various permissions, which will be injected. | ||||
|      */ | ||||
|     @Inject | ||||
|     PermissionCheckUtility permissionCheckUtility; | ||||
|     PermissionCheckService permissionCheckUtility; | ||||
|  | ||||
|     /** | ||||
|      * Utility class that provides convenient access to object creation and | ||||
|      * retrieval functions. | ||||
|      */ | ||||
|     @Inject | ||||
|     ProviderUtility providerUtility; | ||||
|     ProviderService providerUtility; | ||||
|  | ||||
|     /** | ||||
|      * Set the user for this directory. | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| 
 | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
| /* ***** BEGIN LICENSE BLOCK ***** | ||||
|  * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||||
| @@ -47,7 +47,7 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; | ||||
|  * and a collection of ConnectionParameter database records. | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public class ConfigurationTranslationUtility { | ||||
| public class ConfigurationTranslationService { | ||||
| 
 | ||||
|     /** | ||||
|      * Get a GuacamoleConfiguration based on the provided protocol and | ||||
| @@ -33,15 +33,15 @@ | ||||
|  * the terms of any one of the MPL, the GPL or the LGPL. | ||||
|  * | ||||
|  * ***** END LICENSE BLOCK ***** */ | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
| import net.sourceforge.guacamole.net.auth.Credentials; | ||||
| 
 | ||||
| /** | ||||
|  * | ||||
|  * A service to perform password encryption and checking. | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public interface PasswordEncryptionUtility { | ||||
| public interface PasswordEncryptionService { | ||||
| 
 | ||||
|     /** | ||||
|      * Checks if the provided Credentials are correct, compared with what the values from the database. | ||||
| @@ -33,7 +33,7 @@ | ||||
|  * the terms of any one of the MPL, the GPL or the LGPL. | ||||
|  * | ||||
|  * ***** END LICENSE BLOCK ***** */ | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
| import com.google.common.collect.Lists; | ||||
| import com.google.inject.Inject; | ||||
| @@ -72,10 +72,10 @@ import net.sourceforge.guacamole.net.auth.permission.UserDirectoryPermission; | ||||
| import net.sourceforge.guacamole.net.auth.permission.UserPermission; | ||||
| 
 | ||||
| /** | ||||
|  * A utility to retrieve information about what objects a user has permission to. | ||||
|  * A service to retrieve information about what objects a user has permission to. | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public class PermissionCheckUtility { | ||||
| public class PermissionCheckService { | ||||
| 
 | ||||
|     @Inject | ||||
|     UserMapper userDAO; | ||||
| @@ -33,7 +33,7 @@ | ||||
|  * the terms of any one of the MPL, the GPL or the LGPL. | ||||
|  * | ||||
|  * ***** END LICENSE BLOCK ***** */ | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
| import com.google.inject.Inject; | ||||
| import com.google.inject.Provider; | ||||
| @@ -60,7 +60,7 @@ import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; | ||||
|  * Provides convenient provider methods for MySQL specific implementations. | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public class ProviderUtility { | ||||
| public class ProviderService { | ||||
|     @Inject | ||||
|     UserMapper userDAO; | ||||
| 
 | ||||
| @@ -33,13 +33,13 @@ | ||||
|  * the terms of any one of the MPL, the GPL or the LGPL. | ||||
|  * | ||||
|  * ***** END LICENSE BLOCK ***** */ | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
| /** | ||||
|  * | ||||
|  * A service to generate password salts. | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public interface SaltUtility { | ||||
| public interface SaltService { | ||||
|     /** | ||||
|      * Generates a new String that can be used as a password salt. | ||||
|      * @return a new salt for password encryption. | ||||
| @@ -1,5 +1,5 @@ | ||||
| 
 | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
| /* ***** BEGIN LICENSE BLOCK ***** | ||||
|  * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||||
| @@ -43,7 +43,7 @@ import java.security.SecureRandom; | ||||
|  * Generates password salts via SecureRandom. | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public class SecureRandomSaltUtility implements SaltUtility { | ||||
| public class SecureRandomSaltService implements SaltService { | ||||
| 
 | ||||
|     /** | ||||
|      * Instance of SecureRandom for generating the salt. | ||||
| @@ -1,5 +1,5 @@ | ||||
| 
 | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
| /* ***** BEGIN LICENSE BLOCK ***** | ||||
|  * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | ||||
| @@ -48,7 +48,7 @@ import net.sourceforge.guacamole.net.auth.Credentials; | ||||
|  * Provides a SHA-256 based implementation of the password encryption functionality. | ||||
|  * @author James Muehlner | ||||
|  */ | ||||
| public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtility { | ||||
| public class Sha256PasswordEncryptionService implements PasswordEncryptionService { | ||||
| 
 | ||||
|     @Override | ||||
|     public boolean checkCredentials(Credentials credentials, | ||||
| @@ -3,5 +3,5 @@ | ||||
|  * Service classes which help fill the needs of the MySQL authentication | ||||
|  * provider. | ||||
|  */ | ||||
| package net.sourceforge.guacamole.net.auth.mysql.utility; | ||||
| package net.sourceforge.guacamole.net.auth.mysql.service; | ||||
| 
 | ||||
		Reference in New Issue
	
	Block a user