Ticket #263: Added parentID for created connections and groups.

This commit is contained in:
James Muehlner
2013-08-07 22:48:36 -07:00
parent a631180699
commit e715e99509
4 changed files with 9 additions and 4 deletions

View File

@@ -179,7 +179,7 @@ public class ConnectionDirectory implements Directory<String, Connection>{
// Create connection // Create connection
MySQLConnection connection = connectionService.createConnection( MySQLConnection connection = connectionService.createConnection(
name, object.getConfiguration().getProtocol(), user_id); name, object.getConfiguration().getProtocol(), user_id, parentID);
// Add connection parameters // Add connection parameters
createConfigurationValues(connection.getConnectionID(), createConfigurationValues(connection.getConnectionID(),

View File

@@ -162,7 +162,7 @@ public class ConnectionGroupDirectory implements Directory<String, ConnectionGro
// Create connection group // Create connection group
MySQLConnectionGroup connectionGroup = connectionGroupService MySQLConnectionGroup connectionGroup = connectionGroupService
.createConnectionGroup(name, user_id); .createConnectionGroup(name, user_id, parentID);
// Finally, give the current user full access to the newly created // Finally, give the current user full access to the newly created
// connection group. // connection group.

View File

@@ -276,11 +276,13 @@ public class ConnectionGroupService {
* @return A new MySQLConnectionGroup containing the data of the newly created * @return A new MySQLConnectionGroup containing the data of the newly created
* connection group. * connection group.
*/ */
public MySQLConnectionGroup createConnectionGroup(String name, int userID) { public MySQLConnectionGroup createConnectionGroup(String name, int userID,
Integer parentID) {
// Initialize database connection // Initialize database connection
ConnectionGroup connectionGroup = new ConnectionGroup(); ConnectionGroup connectionGroup = new ConnectionGroup();
connectionGroup.setConnection_group_name(name); connectionGroup.setConnection_group_name(name);
connectionGroup.setParent_id(parentID);
// Create connection // Create connection
connectionGroupDAO.insert(connectionGroup); connectionGroupDAO.insert(connectionGroup);

View File

@@ -376,15 +376,18 @@ public class ConnectionService {
* @param name The name to assign to the new connection. * @param name The name to assign to the new connection.
* @param protocol The protocol to assign to the new connection. * @param protocol The protocol to assign to the new connection.
* @param userID The ID of the user who created this connection. * @param userID The ID of the user who created this connection.
* @param parentID The ID of the parent connection group.
* @return A new MySQLConnection containing the data of the newly created * @return A new MySQLConnection containing the data of the newly created
* connection. * connection.
*/ */
public MySQLConnection createConnection(String name, String protocol, int userID) { public MySQLConnection createConnection(String name, String protocol,
int userID, Integer parentID) {
// Initialize database connection // Initialize database connection
Connection connection = new Connection(); Connection connection = new Connection();
connection.setConnection_name(name); connection.setConnection_name(name);
connection.setProtocol(protocol); connection.setProtocol(protocol);
connection.setParent_id(parentID);
// Create connection // Create connection
connectionDAO.insert(connection); connectionDAO.insert(connection);