Ticket #269: The utility classes should more properly be known as services.

This commit is contained in:
James Muehlner
2013-02-25 18:39:49 -08:00
parent 91539ba7b2
commit 7a01ddb4f6
14 changed files with 50 additions and 50 deletions

View File

@@ -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.ConnectionParameterExample;
import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample; 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.model.ConnectionPermissionKey;
import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService;
import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService;
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration; import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
import org.mybatis.guice.transactional.Transactional; import org.mybatis.guice.transactional.Transactional;
@@ -71,10 +71,10 @@ public class ConnectionDirectory implements Directory<String, Connection>{
private MySQLUser user; private MySQLUser user;
@Inject @Inject
PermissionCheckUtility permissionCheckUtility; PermissionCheckService permissionCheckUtility;
@Inject @Inject
ProviderUtility providerUtility; ProviderService providerUtility;
@Inject @Inject
ConnectionMapper connectionDAO; ConnectionMapper connectionDAO;

View File

@@ -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.UserMapper;
import net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper; 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.properties.MySQLGuacamoleProperties;
import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService;
import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService;
import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService;
import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService;
import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService;
import net.sourceforge.guacamole.net.auth.mysql.utility.SecureRandomSaltUtility; import net.sourceforge.guacamole.net.auth.mysql.service.SecureRandomSaltService;
import net.sourceforge.guacamole.net.auth.mysql.utility.Sha256PasswordEncryptionUtility; import net.sourceforge.guacamole.net.auth.mysql.service.Sha256PasswordEncryptionService;
import net.sourceforge.guacamole.properties.GuacamoleProperties; import net.sourceforge.guacamole.properties.GuacamoleProperties;
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory; import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
import org.mybatis.guice.MyBatisModule; import org.mybatis.guice.MyBatisModule;
@@ -154,11 +154,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider {
bind(MySQLUserContext.class); bind(MySQLUserContext.class);
bind(UserDirectory.class); bind(UserDirectory.class);
bind(MySQLUser.class); bind(MySQLUser.class);
bind(SaltUtility.class).to(SecureRandomSaltUtility.class); bind(SaltService.class).to(SecureRandomSaltService.class);
bind(PasswordEncryptionUtility.class).to(Sha256PasswordEncryptionUtility.class); bind(PasswordEncryptionService.class).to(Sha256PasswordEncryptionService.class);
bind(PermissionCheckUtility.class); bind(PermissionCheckService.class);
bind(ProviderUtility.class); bind(ProviderService.class);
bind(ConfigurationTranslationUtility.class); bind(ConfigurationTranslationService.class);
bind(ActiveConnectionSet.class).toInstance(activeConnectionSet); bind(ActiveConnectionSet.class).toInstance(activeConnectionSet);
} }

View File

@@ -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.ConnectionParameter;
import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample; 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.properties.MySQLGuacamoleProperties;
import net.sourceforge.guacamole.net.auth.mysql.utility.ConfigurationTranslationUtility; import net.sourceforge.guacamole.net.auth.mysql.service.ConfigurationTranslationService;
import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService;
import net.sourceforge.guacamole.properties.GuacamoleProperties; import net.sourceforge.guacamole.properties.GuacamoleProperties;
import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket; import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket;
import net.sourceforge.guacamole.protocol.GuacamoleClientInformation; import net.sourceforge.guacamole.protocol.GuacamoleClientInformation;
@@ -68,13 +68,13 @@ public class MySQLConnection implements Connection {
ConnectionParameterMapper connectionParameterDAO; ConnectionParameterMapper connectionParameterDAO;
@Inject @Inject
ProviderUtility providerUtility; ProviderService providerUtility;
@Inject @Inject
ActiveConnectionSet activeConnectionSet; ActiveConnectionSet activeConnectionSet;
@Inject @Inject
ConfigurationTranslationUtility configurationTranslationUtility; ConfigurationTranslationService configurationTranslationUtility;
private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection; private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection;

View File

@@ -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.ConnectionMapper;
import net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper; 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.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. * 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. * Service for creating and retrieving objects.
*/ */
@Inject @Inject
ProviderUtility providerUtility; ProviderService providerUtility;
/** /**
* Initialize this MySQLConnectionRecord with the database record it * Initialize this MySQLConnectionRecord with the database record it

View File

@@ -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.dao.UserMapper;
import net.sourceforge.guacamole.net.auth.mysql.model.UserExample; 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.model.UserWithBLOBs;
import net.sourceforge.guacamole.net.auth.mysql.utility.PasswordEncryptionUtility; import net.sourceforge.guacamole.net.auth.mysql.service.PasswordEncryptionService;
import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService;
import net.sourceforge.guacamole.net.auth.mysql.utility.SaltUtility; import net.sourceforge.guacamole.net.auth.mysql.service.SaltService;
import net.sourceforge.guacamole.net.auth.permission.Permission; import net.sourceforge.guacamole.net.auth.permission.Permission;
/** /**
@@ -63,13 +63,13 @@ public class MySQLUser implements User {
UserMapper userDAO; UserMapper userDAO;
@Inject @Inject
PasswordEncryptionUtility passwordUtility; PasswordEncryptionService passwordUtility;
@Inject @Inject
SaltUtility saltUtility; SaltService saltUtility;
@Inject @Inject
PermissionCheckUtility permissionCheckUtility; PermissionCheckService permissionCheckUtility;
Set<Permission> permissions; Set<Permission> permissions;

View File

@@ -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.UserExample;
import net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample; 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.model.UserPermissionKey;
import net.sourceforge.guacamole.net.auth.mysql.utility.PermissionCheckUtility; import net.sourceforge.guacamole.net.auth.mysql.service.PermissionCheckService;
import net.sourceforge.guacamole.net.auth.mysql.utility.ProviderUtility; import net.sourceforge.guacamole.net.auth.mysql.service.ProviderService;
import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionDirectoryPermission;
import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission; import net.sourceforge.guacamole.net.auth.permission.ConnectionPermission;
import net.sourceforge.guacamole.net.auth.permission.Permission; 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. * Utility class for checking various permissions, which will be injected.
*/ */
@Inject @Inject
PermissionCheckUtility permissionCheckUtility; PermissionCheckService permissionCheckUtility;
/** /**
* Utility class that provides convenient access to object creation and * Utility class that provides convenient access to object creation and
* retrieval functions. * retrieval functions.
*/ */
@Inject @Inject
ProviderUtility providerUtility; ProviderService providerUtility;
/** /**
* Set the user for this directory. * Set the user for this directory.

View File

@@ -1,5 +1,5 @@
package net.sourceforge.guacamole.net.auth.mysql.utility; package net.sourceforge.guacamole.net.auth.mysql.service;
/* ***** BEGIN LICENSE BLOCK ***** /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * 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. * and a collection of ConnectionParameter database records.
* @author James Muehlner * @author James Muehlner
*/ */
public class ConfigurationTranslationUtility { public class ConfigurationTranslationService {
/** /**
* Get a GuacamoleConfiguration based on the provided protocol and * Get a GuacamoleConfiguration based on the provided protocol and

View File

@@ -33,15 +33,15 @@
* the terms of any one of the MPL, the GPL or the LGPL. * the terms of any one of the MPL, the GPL or the LGPL.
* *
* ***** END LICENSE BLOCK ***** */ * ***** 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; import net.sourceforge.guacamole.net.auth.Credentials;
/** /**
* * A service to perform password encryption and checking.
* @author James Muehlner * @author James Muehlner
*/ */
public interface PasswordEncryptionUtility { public interface PasswordEncryptionService {
/** /**
* Checks if the provided Credentials are correct, compared with what the values from the database. * Checks if the provided Credentials are correct, compared with what the values from the database.

View File

@@ -33,7 +33,7 @@
* the terms of any one of the MPL, the GPL or the LGPL. * the terms of any one of the MPL, the GPL or the LGPL.
* *
* ***** END LICENSE BLOCK ***** */ * ***** 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.common.collect.Lists;
import com.google.inject.Inject; 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; 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 * @author James Muehlner
*/ */
public class PermissionCheckUtility { public class PermissionCheckService {
@Inject @Inject
UserMapper userDAO; UserMapper userDAO;

View File

@@ -33,7 +33,7 @@
* the terms of any one of the MPL, the GPL or the LGPL. * the terms of any one of the MPL, the GPL or the LGPL.
* *
* ***** END LICENSE BLOCK ***** */ * ***** 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.Inject;
import com.google.inject.Provider; import com.google.inject.Provider;
@@ -60,7 +60,7 @@ import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket;
* Provides convenient provider methods for MySQL specific implementations. * Provides convenient provider methods for MySQL specific implementations.
* @author James Muehlner * @author James Muehlner
*/ */
public class ProviderUtility { public class ProviderService {
@Inject @Inject
UserMapper userDAO; UserMapper userDAO;

View File

@@ -33,13 +33,13 @@
* the terms of any one of the MPL, the GPL or the LGPL. * the terms of any one of the MPL, the GPL or the LGPL.
* *
* ***** END LICENSE BLOCK ***** */ * ***** 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 * @author James Muehlner
*/ */
public interface SaltUtility { public interface SaltService {
/** /**
* Generates a new String that can be used as a password salt. * Generates a new String that can be used as a password salt.
* @return a new salt for password encryption. * @return a new salt for password encryption.

View File

@@ -1,5 +1,5 @@
package net.sourceforge.guacamole.net.auth.mysql.utility; package net.sourceforge.guacamole.net.auth.mysql.service;
/* ***** BEGIN LICENSE BLOCK ***** /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
@@ -43,7 +43,7 @@ import java.security.SecureRandom;
* Generates password salts via SecureRandom. * Generates password salts via SecureRandom.
* @author James Muehlner * @author James Muehlner
*/ */
public class SecureRandomSaltUtility implements SaltUtility { public class SecureRandomSaltService implements SaltService {
/** /**
* Instance of SecureRandom for generating the salt. * Instance of SecureRandom for generating the salt.

View File

@@ -1,5 +1,5 @@
package net.sourceforge.guacamole.net.auth.mysql.utility; package net.sourceforge.guacamole.net.auth.mysql.service;
/* ***** BEGIN LICENSE BLOCK ***** /* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1 * 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. * Provides a SHA-256 based implementation of the password encryption functionality.
* @author James Muehlner * @author James Muehlner
*/ */
public class Sha256PasswordEncryptionUtility implements PasswordEncryptionUtility { public class Sha256PasswordEncryptionService implements PasswordEncryptionService {
@Override @Override
public boolean checkCredentials(Credentials credentials, public boolean checkCredentials(Credentials credentials,

View File

@@ -3,5 +3,5 @@
* Service classes which help fill the needs of the MySQL authentication * Service classes which help fill the needs of the MySQL authentication
* provider. * provider.
*/ */
package net.sourceforge.guacamole.net.auth.mysql.utility; package net.sourceforge.guacamole.net.auth.mysql.service;