mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Ticket #269: Make all fields private, change default methods to public.
This commit is contained in:
@@ -71,26 +71,26 @@ public class ConnectionDirectory implements Directory<String, Connection>{
|
|||||||
private int user_id;
|
private int user_id;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
PermissionCheckService permissionCheckUtility;
|
private PermissionCheckService permissionCheckUtility;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ProviderService providerUtility;
|
private ProviderService providerUtility;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionMapper connectionDAO;
|
private ConnectionMapper connectionDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionPermissionMapper connectionPermissionDAO;
|
private ConnectionPermissionMapper connectionPermissionDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionParameterMapper connectionParameterDAO;
|
private ConnectionParameterMapper connectionParameterDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the user for this directory.
|
* Set the user for this directory.
|
||||||
*
|
*
|
||||||
* @param user_id The ID of the user owning this connection directory.
|
* @param user_id The ID of the user owning this connection directory.
|
||||||
*/
|
*/
|
||||||
void init(int user_id) {
|
public void init(int user_id) {
|
||||||
this.user_id = user_id;
|
this.user_id = user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -62,19 +62,19 @@ import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
|||||||
public class MySQLConnection implements Connection {
|
public class MySQLConnection implements Connection {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionMapper connectionDAO;
|
private ConnectionMapper connectionDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionParameterMapper connectionParameterDAO;
|
private ConnectionParameterMapper connectionParameterDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ProviderService providerUtility;
|
private ProviderService providerUtility;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ActiveConnectionSet activeConnectionSet;
|
private ActiveConnectionSet activeConnectionSet;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConfigurationTranslationService configurationTranslationUtility;
|
private ConfigurationTranslationService configurationTranslationUtility;
|
||||||
|
|
||||||
private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection;
|
private net.sourceforge.guacamole.net.auth.mysql.model.Connection connection;
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ public class MySQLConnection implements Connection {
|
|||||||
/**
|
/**
|
||||||
* Create a default, empty connection.
|
* Create a default, empty connection.
|
||||||
*/
|
*/
|
||||||
MySQLConnection() {
|
public MySQLConnection() {
|
||||||
connection = new net.sourceforge.guacamole.net.auth.mysql.model.Connection();
|
connection = new net.sourceforge.guacamole.net.auth.mysql.model.Connection();
|
||||||
configuration = new GuacamoleConfiguration();
|
configuration = new GuacamoleConfiguration();
|
||||||
}
|
}
|
||||||
|
@@ -63,19 +63,19 @@ public class MySQLConnectionRecord implements ConnectionRecord {
|
|||||||
* DAO for accessing users.
|
* DAO for accessing users.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
UserMapper userDAO;
|
private UserMapper userDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DAO for accessing connections.
|
* DAO for accessing connections.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionMapper connectionDAO;
|
private ConnectionMapper connectionDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service for creating and retrieving objects.
|
* Service for creating and retrieving objects.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
ProviderService providerUtility;
|
private ProviderService providerUtility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize this MySQLConnectionRecord with the database record it
|
* Initialize this MySQLConnectionRecord with the database record it
|
||||||
|
@@ -53,7 +53,7 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket {
|
|||||||
* Injected ActiveConnectionSet which will contain all active connections.
|
* Injected ActiveConnectionSet which will contain all active connections.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
ActiveConnectionSet activeConnectionSet;
|
private ActiveConnectionSet activeConnectionSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The wrapped socket.
|
* The wrapped socket.
|
||||||
|
@@ -59,14 +59,23 @@ public class MySQLUser extends AbstractUser {
|
|||||||
*/
|
*/
|
||||||
private Integer userID;
|
private Integer userID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for encrypting passwords.
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
PasswordEncryptionService passwordUtility;
|
private PasswordEncryptionService passwordUtility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for generating random salts.
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
SaltService saltUtility;
|
private SaltService saltUtility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for checking permissions.
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
PermissionCheckService permissionCheckUtility;
|
private PermissionCheckService permissionCheckUtility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The set of current permissions a user has.
|
* The set of current permissions a user has.
|
||||||
|
@@ -82,7 +82,7 @@ public class MySQLUserContext implements UserContext {
|
|||||||
*
|
*
|
||||||
* @param user_id The ID of the user owning this context.
|
* @param user_id The ID of the user owning this context.
|
||||||
*/
|
*/
|
||||||
void init(int user_id) {
|
public void init(int user_id) {
|
||||||
this.user_id = user_id;
|
this.user_id = user_id;
|
||||||
userDirectory.init(user_id);
|
userDirectory.init(user_id);
|
||||||
connectionDirectory.init(user_id);
|
connectionDirectory.init(user_id);
|
||||||
|
@@ -93,50 +93,56 @@ public class UserDirectory implements Directory<String, net.sourceforge.guacamol
|
|||||||
* DAO for accessing users, which will be injected.
|
* DAO for accessing users, which will be injected.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
UserMapper userDAO;
|
private UserMapper userDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DAO for accessing connections, which will be injected.
|
* DAO for accessing connections, which will be injected.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionMapper connectionDAO;
|
private ConnectionMapper connectionDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DAO for accessing user permissions, which will be injected.
|
* DAO for accessing user permissions, which will be injected.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
UserPermissionMapper userPermissionDAO;
|
private UserPermissionMapper userPermissionDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DAO for accessing connection permissions, which will be injected.
|
* DAO for accessing connection permissions, which will be injected.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionPermissionMapper connectionPermissionDAO;
|
private ConnectionPermissionMapper connectionPermissionDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DAO for accessing system permissions, which will be injected.
|
* DAO for accessing system permissions, which will be injected.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
SystemPermissionMapper systemPermissionDAO;
|
private SystemPermissionMapper systemPermissionDAO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class for checking various permissions, which will be injected.
|
* Utility class for checking various permissions, which will be injected.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
PermissionCheckService permissionCheckUtility;
|
private 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
|
||||||
ProviderService providerUtility;
|
private ProviderService providerUtility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for encrypting passwords.
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
PasswordEncryptionService passwordUtility;
|
private PasswordEncryptionService passwordUtility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Service for generating random salts.
|
||||||
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
SaltService saltUtility;
|
private SaltService saltUtility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the user for this directory.
|
* Set the user for this directory.
|
||||||
@@ -144,7 +150,7 @@ public class UserDirectory implements Directory<String, net.sourceforge.guacamol
|
|||||||
* @param user_id The ID of the user whose permissions define the visibility
|
* @param user_id The ID of the user whose permissions define the visibility
|
||||||
* of other users in this directory.
|
* of other users in this directory.
|
||||||
*/
|
*/
|
||||||
void init(int user_id) {
|
public void init(int user_id) {
|
||||||
this.user_id = user_id;
|
this.user_id = user_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,25 +78,25 @@ import net.sourceforge.guacamole.net.auth.permission.UserPermission;
|
|||||||
public class PermissionCheckService {
|
public class PermissionCheckService {
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
UserMapper userDAO;
|
private UserMapper userDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionMapper connectionDAO;
|
private ConnectionMapper connectionDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
UserPermissionMapper userPermissionDAO;
|
private UserPermissionMapper userPermissionDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ConnectionPermissionMapper connectionPermissionDAO;
|
private ConnectionPermissionMapper connectionPermissionDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
SystemPermissionMapper systemPermissionDAO;
|
private SystemPermissionMapper systemPermissionDAO;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
Provider<MySQLUser> mySQLUserProvider;
|
private Provider<MySQLUser> mySQLUserProvider;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
Provider<MySQLConnection> mySQLConnectionProvider;
|
private Provider<MySQLConnection> mySQLConnectionProvider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verifies that the user has read access to the given user. If not, throws a GuacamoleSecurityException.
|
* Verifies that the user has read access to the given user. If not, throws a GuacamoleSecurityException.
|
||||||
|
Reference in New Issue
Block a user