Ticket #269: Removed whitespace at end of lines.

This commit is contained in:
James Muehlner
2013-02-21 23:03:37 -08:00
parent b88088f226
commit 9f0bad5dbe
6 changed files with 46 additions and 46 deletions

View File

@@ -224,7 +224,7 @@ public class ConnectionDirectory implements Directory<String, Connection>{
ConnectionParameterExample connectionParameterExample = new ConnectionParameterExample();
connectionParameterExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID());
connectionParameterDAO.deleteByExample(connectionParameterExample);
// delete all permissions that refer to this connection
ConnectionPermissionExample connectionPermissionExample = new ConnectionPermissionExample();
connectionPermissionExample.createCriteria().andConnection_idEqualTo(mySQLConnection.getConnectionID());

View File

@@ -45,25 +45,25 @@ import net.sourceforge.guacamole.net.auth.permission.UserPermission;
* @author James Muehlner
*/
public final class MySQLConstants {
/**
* This class should not be instantiated.
*/
private MySQLConstants() {}
// Permission constants
public static final String USER_READ = UserPermission.Type.READ.name();
public static final String USER_UPDATE = UserPermission.Type.UPDATE.name();
public static final String USER_DELETE = UserPermission.Type.DELETE.name();
public static final String USER_ADMINISTER = UserPermission.Type.ADMINISTER.name();
public static final String USER_CREATE = UserDirectoryPermission.Type.CREATE.name();
public static final String CONNECTION_READ = ConnectionPermission.Type.READ.name();
public static final String CONNECTION_UPDATE = ConnectionPermission.Type.UPDATE.name();
public static final String CONNECTION_DELETE = ConnectionPermission.Type.DELETE.name();
public static final String CONNECTION_ADMINISTER = ConnectionPermission.Type.ADMINISTER.name();
public static final String CONNECTION_CREATE = ConnectionDirectoryPermission.Type.CREATE.name();
public static final String SYSTEM_USER_CREATE = "USER_CREATE";
public static final String SYSTEM_CONNECTION_CREATE = "CONNECTION_CREATE";
}

View File

@@ -41,48 +41,48 @@ import net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter;
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
/**
* Provides functions for translating between GuacamoleConfiguration objects
* Provides functions for translating between GuacamoleConfiguration objects
* and a collection of ConnectionParameter database records.
* @author James Muehlner
*/
public class ConfigurationTranslationUtility {
/**
* Get a GuacamoleConfiguration based on the provided protocol and parameters.
* @param protocol the protocol used (VNC, RDP, etc)
* @param parameters the parameter database records to translate
* @return
* @return
*/
public GuacamoleConfiguration getConfiguration(String protocol, Iterable<ConnectionParameter> parameters) {
GuacamoleConfiguration configuration = new GuacamoleConfiguration();
configuration.setProtocol(protocol);
for(ConnectionParameter parameter : parameters) {
configuration.setParameter(parameter.getParameter_name(), parameter.getParameter_value());
}
return configuration;
}
/**
* Creates a list of ConnectionParameter database records based on the provided connectionID and GuacamoleConfiguration.
* @param connectionID the ID of the connection that these parameters are for
* @param configuration the configuration to pull the parameter values from
* @return
* @return
*/
public List<ConnectionParameter> getConnectionParameters(int connectionID, GuacamoleConfiguration configuration) {
List<ConnectionParameter> connectionParameters = new ArrayList<ConnectionParameter>();
for(String parameterName : configuration.getParameterNames()) {
ConnectionParameter connectionParameter = new ConnectionParameter();
String parameterValue = configuration.getParameter(parameterName);
connectionParameter.setConnection_id(connectionID);
connectionParameter.setParameter_name(parameterName);
connectionParameter.setParameter_value(parameterValue);
connectionParameters.add(connectionParameter);
}
return connectionParameters;
}
}

View File

@@ -42,7 +42,7 @@ import net.sourceforge.guacamole.net.auth.Credentials;
* @author James Muehlner
*/
public interface PasswordEncryptionUtility {
/**
* Checks if the provided Credentials are correct, compared with what the values from the database.
* @param credentials
@@ -52,7 +52,7 @@ public interface PasswordEncryptionUtility {
* @return true if the provided credentials match what's in the database for that user.
*/
public boolean checkCredentials(Credentials credentials, byte[] dbPasswordHash, String dbUsername, byte[] dbSalt);
/**
* Creates a password hash based on the provided username, password, and salt.
* @param username

View File

@@ -63,59 +63,59 @@ import net.sourceforge.guacamole.protocol.ConfiguredGuacamoleSocket;
public class ProviderUtility {
@Inject
UserMapper userDAO;
@Inject
ConnectionMapper connectionDAO;
@Inject
ConnectionHistoryMapper connectionHistoryDAO;
@Inject
Provider<MySQLUser> mySQLUserProvider;
@Inject
Provider<MySQLConnection> mySQLConnectionProvider;
@Inject
Provider<MySQLConnectionRecord> mySQLConnectionRecordProvider;
@Inject
Provider<MySQLGuacamoleSocket> mySQLGuacamoleSocketProvider;
/**
* Create a new user based on the provided object.
* @param user
* @return the new MySQLUser object.
* @throws GuacamoleException
* @throws GuacamoleException
*/
public MySQLUser getNewMySQLUser(User user) throws GuacamoleException {
MySQLUser mySQLUser = mySQLUserProvider.get();
mySQLUser.initNew(user);
return mySQLUser;
}
/**
* Get the user based on the username of the provided object.
* @param user
* @return the new MySQLUser object.
* @throws GuacamoleException
* @throws GuacamoleException
*/
public MySQLUser getExistingMySQLUser(User user) throws GuacamoleException {
return getExistingMySQLUser(user.getUsername());
}
/**
* Get the user based on the username of the provided object.
* @param name
* @return the new MySQLUser object.
* @throws GuacamoleException
* @throws GuacamoleException
*/
public MySQLUser getExistingMySQLUser(String name) throws GuacamoleException {
MySQLUser mySQLUser = mySQLUserProvider.get();
mySQLUser.initExisting(name);
return mySQLUser;
}
/**
* Get an existing MySQLUser from a user database record.
* @param user
@@ -126,7 +126,7 @@ public class ProviderUtility {
mySQLUser.init(user);
return mySQLUser;
}
/**
* Get an existing MySQLUser from a user ID.
* @param id
@@ -140,42 +140,42 @@ public class ProviderUtility {
return null;
return getExistingMySQLUser(users.get(0));
}
/**
* Create a new connection based on the provided object.
* @param connection
* @return the new Connection object.
* @throws GuacamoleException
* @throws GuacamoleException
*/
public MySQLConnection getNewMySQLConnection(Connection connection) throws GuacamoleException {
MySQLConnection mySQLConnection = mySQLConnectionProvider.get();
mySQLConnection.initNew(connection);
return mySQLConnection;
}
/**
* Get the connection based on the connection name of the provided object.
* @param connection
* @return the new Connection object.
* @throws GuacamoleException
* @throws GuacamoleException
*/
public MySQLConnection getExistingMySQLConnection(Connection connection) throws GuacamoleException {
return getExistingMySQLConnection(connection.getIdentifier());
}
/**
* Get the connection based on the connection name of the provided object.
* @param name
* @return the new Connection object.
* @throws GuacamoleException
* @throws GuacamoleException
*/
public MySQLConnection getExistingMySQLConnection(String name) throws GuacamoleException {
MySQLConnection mySQLConnection = mySQLConnectionProvider.get();
mySQLConnection.initExisting(name);
return mySQLConnection;
}
/**
* Get an existing MySQLConnection from a connection database record.
* @param connection
@@ -186,7 +186,7 @@ public class ProviderUtility {
mySQLConnection.init(connection);
return mySQLConnection;
}
/**
* Get an existing MySQLConnection from a connection ID.
* @param id
@@ -200,7 +200,7 @@ public class ProviderUtility {
return null;
return getExistingMySQLConnection(connections.get(0));
}
/**
* Gets a list of existing MySQLConnectionRecord from the database. These represent
* the history records of the connection.
@@ -219,7 +219,7 @@ public class ProviderUtility {
}
return connectionRecords;
}
/**
* Create a MySQLConnectionRecord object around a single ConnectionHistory database record.
* @param history
@@ -230,12 +230,12 @@ public class ProviderUtility {
record.init(history);
return record;
}
/**
* Create a MySQLGuacamoleSocket using the provided ConfiguredGuacamoleSocket and connection ID.
* @param socket
* @param connectionID
* @return
* @return
*/
public MySQLGuacamoleSocket getMySQLGuacamoleSocket(ConfiguredGuacamoleSocket socket, int connectionID) {
MySQLGuacamoleSocket mySQLGuacamoleSocket = mySQLGuacamoleSocketProvider.get();

View File

@@ -42,9 +42,9 @@ import java.security.SecureRandom;
* @author James Muehlner
*/
public class SecureRandomSaltUtility implements SaltUtility {
SecureRandom secureRandom = new SecureRandom();
@Override
public byte[] generateSalt() {
byte[] salt = new byte[32];