Ticket #269: Fix whitespace errors.

This commit is contained in:
Michael Jumper
2013-03-03 14:52:49 -08:00
parent 0810d082d3
commit 8e3ea61126
6 changed files with 23 additions and 23 deletions

View File

@@ -59,12 +59,12 @@ public class ActiveConnectionSet {
*/ */
@Inject @Inject
private ConnectionHistoryMapper connectionHistoryDAO; private ConnectionHistoryMapper connectionHistoryDAO;
/** /**
* Set of all the connections that are currently active. * Set of all the connections that are currently active.
*/ */
private Set<Integer> activeConnectionSet = new HashSet<Integer>(); private Set<Integer> activeConnectionSet = new HashSet<Integer>();
/** /**
* Check if a connection is currently in use. * Check if a connection is currently in use.
* @param connectionID The connection to check the status of. * @param connectionID The connection to check the status of.
@@ -73,7 +73,7 @@ public class ActiveConnectionSet {
public boolean isActive(int connectionID) { public boolean isActive(int connectionID) {
return activeConnectionSet.contains(connectionID); return activeConnectionSet.contains(connectionID);
} }
/** /**
* Set a connection as open. * Set a connection as open.
* @param connectionID The ID of the connection that is being opened. * @param connectionID The ID of the connection that is being opened.
@@ -81,20 +81,20 @@ public class ActiveConnectionSet {
* @return The ID of the history record created for this open connection. * @return The ID of the history record created for this open connection.
*/ */
public int openConnection(int connectionID, int userID) { public int openConnection(int connectionID, int userID) {
// Create the connection history record // Create the connection history record
ConnectionHistory connectionHistory = new ConnectionHistory(); ConnectionHistory connectionHistory = new ConnectionHistory();
connectionHistory.setConnection_id(connectionID); connectionHistory.setConnection_id(connectionID);
connectionHistory.setUser_id(userID); connectionHistory.setUser_id(userID);
connectionHistory.setStart_date(new Date()); connectionHistory.setStart_date(new Date());
connectionHistoryDAO.insert(connectionHistory); connectionHistoryDAO.insert(connectionHistory);
// Mark the connection as active // Mark the connection as active
activeConnectionSet.add(connectionID); activeConnectionSet.add(connectionID);
return connectionHistory.getHistory_id(); return connectionHistory.getHistory_id();
} }
/** /**
* Set a connection as closed. * Set a connection as closed.
* @param connectionID The ID of the connection that is being opened. * @param connectionID The ID of the connection that is being opened.
@@ -103,18 +103,18 @@ public class ActiveConnectionSet {
*/ */
public void closeConnection(int connectionID, int historyID) public void closeConnection(int connectionID, int historyID)
throws GuacamoleException { throws GuacamoleException {
// Get the existing history record // Get the existing history record
ConnectionHistory connectionHistory = ConnectionHistory connectionHistory =
connectionHistoryDAO.selectByPrimaryKey(historyID); connectionHistoryDAO.selectByPrimaryKey(historyID);
if(connectionHistory == null) if(connectionHistory == null)
throw new GuacamoleException("History record not found."); throw new GuacamoleException("History record not found.");
// Update the connection history record to mark that it is now closed // Update the connection history record to mark that it is now closed
connectionHistory.setEnd_date(new Date()); connectionHistory.setEnd_date(new Date());
connectionHistoryDAO.updateByPrimaryKey(connectionHistory); connectionHistoryDAO.updateByPrimaryKey(connectionHistory);
// Remove the connection from the set of active connections. // Remove the connection from the set of active connections.
activeConnectionSet.remove(connectionID); activeConnectionSet.remove(connectionID);
} }

View File

@@ -59,7 +59,7 @@ public class MySQLConnection extends AbstractConnection {
* The ID associated with this connection in the database. * The ID associated with this connection in the database.
*/ */
private Integer connectionID; private Integer connectionID;
/** /**
* The ID of the user who queried or created this connection. * The ID of the user who queried or created this connection.
*/ */
@@ -116,7 +116,7 @@ public class MySQLConnection extends AbstractConnection {
setConfiguration(config); setConfiguration(config);
this.history.addAll(history); this.history.addAll(history);
this.userID = userID; this.userID = userID;
} }
@Override @Override

View File

@@ -51,12 +51,12 @@ public class MySQLConnectionRecord implements ConnectionRecord {
* The start date of the ConnectionRecord. * The start date of the ConnectionRecord.
*/ */
private Date startDate; private Date startDate;
/** /**
* The end date of the ConnectionRecord. * The end date of the ConnectionRecord.
*/ */
private Date endDate; private Date endDate;
/** /**
* The name of the user that is associated with this ConnectionRecord. * The name of the user that is associated with this ConnectionRecord.
*/ */

View File

@@ -65,7 +65,7 @@ public class MySQLGuacamoleSocket implements GuacamoleSocket {
* socket. * socket.
*/ */
private int connectionID; private int connectionID;
/** /**
* The ID of the history record associated with this instance of the * The ID of the history record associated with this instance of the
* connection. * connection.

View File

@@ -114,7 +114,7 @@ public class ConnectionService {
*/ */
@Inject @Inject
private ActiveConnectionSet activeConnectionSet; private ActiveConnectionSet activeConnectionSet;
/** /**
* Service managing users. * Service managing users.
*/ */
@@ -282,7 +282,7 @@ public class ConnectionService {
* connection. * connection.
*/ */
public List<MySQLConnectionRecord> retrieveHistory(int connectionID) { public List<MySQLConnectionRecord> retrieveHistory(int connectionID) {
// Retrieve history records relating to given connection ID // Retrieve history records relating to given connection ID
ConnectionHistoryExample example = new ConnectionHistoryExample(); ConnectionHistoryExample example = new ConnectionHistoryExample();
example.createCriteria().andConnection_idEqualTo(connectionID); example.createCriteria().andConnection_idEqualTo(connectionID);
@@ -299,10 +299,10 @@ public class ConnectionService {
for(ConnectionHistory history : connectionHistories) { for(ConnectionHistory history : connectionHistories) {
userIDSet.add(history.getUser_id()); userIDSet.add(history.getUser_id());
} }
// Get all the usernames for the users who are in the history // Get all the usernames for the users who are in the history
Map<Integer, String> usernameMap = userService.retrieveUsernames(userIDSet); Map<Integer, String> usernameMap = userService.retrieveUsernames(userIDSet);
// Create the new ConnectionRecords // Create the new ConnectionRecords
for(ConnectionHistory history : connectionHistories) { for(ConnectionHistory history : connectionHistories) {
Date startDate = history.getStart_date(); Date startDate = history.getStart_date();
@@ -349,7 +349,7 @@ public class ConnectionService {
// Mark this connection as active // Mark this connection as active
int historyID = activeConnectionSet.openConnection(connection.getConnectionID(), userID); int historyID = activeConnectionSet.openConnection(connection.getConnectionID(), userID);
// Return new MySQLGuacamoleSocket // Return new MySQLGuacamoleSocket
MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get(); MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get();
mySQLGuacamoleSocket.init(socket, connection.getConnectionID(), historyID); mySQLGuacamoleSocket.init(socket, connection.getConnectionID(), historyID);

View File

@@ -360,7 +360,7 @@ public class PermissionCheckService {
// Set of all permissions // Set of all permissions
Set<SystemPermission> permissions = new HashSet<SystemPermission>(); Set<SystemPermission> permissions = new HashSet<SystemPermission>();
// And finally, system permissions // And finally, system permissions
SystemPermissionExample systemPermissionExample = new SystemPermissionExample(); SystemPermissionExample systemPermissionExample = new SystemPermissionExample();
systemPermissionExample.createCriteria().andUser_idEqualTo(userID); systemPermissionExample.createCriteria().andUser_idEqualTo(userID);