From 3a40393f3db1d64703d5b6af32bad32a9211a3bd Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 4 Mar 2013 00:41:29 -0800 Subject: [PATCH] Fix style issues. --- .../net/auth/mysql/ConnectionDirectory.java | 7 +++---- .../guacamole/net/auth/mysql/UserDirectory.java | 8 +++++--- .../auth/mysql/service/ConnectionService.java | 16 ++++++++-------- .../mysql/service/PermissionCheckService.java | 14 +++++++------- .../net/auth/mysql/service/UserService.java | 12 ++++++------ 5 files changed, 29 insertions(+), 28 deletions(-) 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 c5b6c57bd..11398ba12 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 @@ -38,7 +38,6 @@ package net.sourceforge.guacamole.net.auth.mysql; * ***** END LICENSE BLOCK ***** */ import com.google.inject.Inject; -import java.util.List; import java.util.Set; import net.sourceforge.guacamole.GuacamoleClientException; import net.sourceforge.guacamole.GuacamoleException; @@ -133,17 +132,17 @@ public class ConnectionDirectory implements Directory{ String identifier = object.getIdentifier().trim(); if(identifier.isEmpty()) throw new GuacamoleClientException("The connection identifier cannot be blank."); - + // Verify permission to create permissionCheckService.verifySystemAccess(this.user_id, MySQLConstants.SYSTEM_CONNECTION_CREATE); // Verify that no connection already exists with this identifier. - MySQLConnection previousConnection = + MySQLConnection previousConnection = connectionService.retrieveConnection(identifier, user_id); if(previousConnection != null) throw new GuacamoleClientException("That connection identifier is already in use."); - + // Create connection MySQLConnection connection = connectionService.createConnection( identifier, object.getConfiguration().getProtocol(), diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java index 67ce9c38c..4a432cf45 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/UserDirectory.java @@ -485,6 +485,8 @@ public class UserDirectory implements Directory permissions) throws GuacamoleException { @@ -499,7 +501,7 @@ public class UserDirectory implements Directory systemPermissionTypes = new ArrayList(); for (SystemPermission permission : permissions) @@ -585,7 +587,7 @@ public class UserDirectory implements Directory connectionHistories = + List connectionHistories = connectionHistoryDAO.selectByExampleWithRowbounds(example, rowBounds); // Convert history entries to connection records @@ -412,10 +412,10 @@ public class ConnectionService { connectionDAO.updateByPrimaryKeySelective(connection); } - + /** * Get the names of all the connections defined in the system. - * + * * @return A Set of names of all the connections defined in the system. */ public Set getAllConnectionNames() { @@ -428,19 +428,19 @@ public class ConnectionService { connectionDAO.selectByExample(new ConnectionExample()); for (Connection connection : connections) names.add(connection.getConnection_name()); - + return names; } /** * Get the connection IDs of all the connections defined in the system. - * + * * @return A list of connection IDs of all the connections defined in the system. */ public List getAllConnectionIDs() { - // Set of all present connection IDs + // Set of all present connection IDs List connectionIDs = new ArrayList(); // Query all connection IDs @@ -448,7 +448,7 @@ public class ConnectionService { connectionDAO.selectByExample(new ConnectionExample()); for (Connection connection : connections) connectionIDs.add(connection.getConnection_id()); - + return connectionIDs; } diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java index 059bbeb38..51ead4284 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/PermissionCheckService.java @@ -164,7 +164,7 @@ public class PermissionCheckService { // A system administrator has full access to everything. if(checkSystemAdministratorAccess(userID)) return true; - + // Check existence of requested permission UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andAffected_user_idEqualTo(affectedUserID).andPermissionEqualTo(permissionType); @@ -187,7 +187,7 @@ public class PermissionCheckService { // A system administrator has full access to everything. if(checkSystemAdministratorAccess(userID)) return true; - + // Check existence of requested permission ConnectionPermissionExample example = new ConnectionPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andConnection_idEqualTo(affectedConnectionID).andPermissionEqualTo(permissionType); @@ -207,14 +207,14 @@ public class PermissionCheckService { // A system administrator has full access to everything. if(checkSystemAdministratorAccess(userID)) return true; - + // Check existence of requested permission SystemPermissionExample example = new SystemPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(systemPermissionType); return systemPermissionDAO.countByExample(example) > 0; } - + /** * Checks whether a user has system administrator access to the system. @@ -244,7 +244,7 @@ public class PermissionCheckService { // A system administrator has access to all users. if(checkSystemAdministratorAccess(userID)) return userService.getAllUserIDs(); - + // Query all user permissions for the given user and permission type UserPermissionExample example = new UserPermissionExample(); example.createCriteria().andUser_idEqualTo(userID).andPermissionEqualTo(permissionType); @@ -296,7 +296,7 @@ public class PermissionCheckService { /** * Retrieve all existing usernames that the given user has permission to * perform the given operation upon. - * + * * @param userID The user whose permissions should be checked. * @param permissionType The permission to check. * @return A set of all usernames for which the given user has the given @@ -320,7 +320,7 @@ public class PermissionCheckService { /** * Retrieve all existing usernames that the given user has permission to * perform the given operation upon. - * + * * @param userID The user whose permissions should be checked. * @param permissionType The permission to check. * @return A set of all usernames for which the given user has the given diff --git a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java index e3b0552f0..fe3fa8b34 100644 --- a/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java +++ b/extensions/guacamole-auth-mysql/src/main/java/net/sourceforge/guacamole/net/auth/mysql/service/UserService.java @@ -337,10 +337,10 @@ public class UserService { userDAO.updateByPrimaryKeySelective(user); } - + /** * Get the usernames of all the users defined in the system. - * + * * @return A Set of usernames of all the users defined in the system. */ public Set getAllUsernames() { @@ -353,19 +353,19 @@ public class UserService { userDAO.selectByExample(new UserExample()); for (User user : users) usernames.add(user.getUsername()); - + return usernames; } /** * Get the user IDs of all the users defined in the system. - * + * * @return A list of user IDs of all the users defined in the system. */ public List getAllUserIDs() { - // Set of all present user IDs + // Set of all present user IDs List userIDs = new ArrayList(); // Query all user IDs @@ -373,7 +373,7 @@ public class UserService { userDAO.selectByExample(new UserExample()); for (User user : users) userIDs.add(user.getUser_id()); - + return userIDs; }